Skip to content

Add github workflow to verify docs #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Nov 4, 2020

@javiereguiluz and @wouterj may have noticed that I found a few invalid use statement recently. I was trying out my script.

This PR will make sure that Carson is opening an issue when there are invalid use statements.

TODO:

I'll wait for other PRs to be merged to avoid conflicts. But I just wanted to show my intent.


- name: Open issue
env:
GITHUB_TOKEN: ${{ secrets.CARSONPROD_GITHUB_TOKEN }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be added as a secret

@wouterj
Copy link
Contributor

wouterj commented Nov 4, 2020

Hi @Nyholm. I like your excitement for improving Carsonbot!

However, I think it's better to add this rule to https://github.com/OskarStark/doctor-rst . It's the CI tool we're using the docs repository to check for all sorts of things (including PHP stuff, like alphabetically sorted use-statements). This way, we're immediately reminded of the error when it's introduced.

What do you think?

@Nyholm
Copy link
Member Author

Nyholm commented Nov 4, 2020

That is an excellent question. I’ve considered that too. But I decided not to do that.
Most of the invalid use statements in the docs is because the symfony source changed. Ie, the docs were valid at the time of merge.

If we added the check to the docs CI that would lead to the next PR made to the docs had red CI because unrelated changes.

This test is also relatively slow and most of the time it will not report any issues.

@Nyholm Nyholm marked this pull request as ready for review November 7, 2020 13:25
@Nyholm Nyholm mentioned this pull request Nov 7, 2020
@wouterj
Copy link
Contributor

wouterj commented Nov 7, 2020

I honestly am still not very sure about including this in carsonbot. I think the scope of carsonbot is management of PRs and issues (labelling, milestoning, commenting, etc). The scope of PhpUnit and DOCtor-rst is to validate the repository sources.

I agree that it might not be nice to break someones pull requests because of a change not made by them. We could make this job branch-only (so pull requests don't break). Also, classes in Symfony aren't suddenly moved. That only occurs on major releases and have a deprecation before. That means that there has been a doc issue about the move already, before the build actually breaks.

@Nyholm
Copy link
Member Author

Nyholm commented Nov 7, 2020

I would like to extend that scope. I would like Carson bot to also open issues like: symfony/symfony#38771 Currently it is another bot/script that opens that issue.

I also think this is not going to happen very often. It is only when we introduce new big features and refactor them. Ie, the RateLimit component was refactored a bit after the docs got merged.

At the very most, you will have one issue open on symfony/symfony-docs. And I dont really expect the bot to open more than 1 or 2 issues in 2020.

The reason why I think this is important is because it is really really hard to verify this manually.

@Nyholm Nyholm force-pushed the verify-docs branch 2 times, most recently from 5bede6a to 670af20 Compare November 14, 2020 10:36
<?php

if ($argc !== 3) {
echo "./docs-invalid-use.php path-to-docs path-to-symfony\n";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo


use Symfony\Component\Finder\Finder;
$finder = new Finder();
$finder->in($docs)->name('*.rst');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to include rst.inc files too

@stof
Copy link
Member

stof commented Apr 22, 2021

@Nyholm I think this would be better handled by a workflow running in the symfony-docs repo (based on a cron trigger) that would use https://github.com/symfony-tools/code-block-checker

@Nyholm
Copy link
Member Author

Nyholm commented Apr 23, 2021

Im closing this in favour of symfony-tools/code-block-checker#38

That would make this feature part of the CI instead of Carson.

@Nyholm Nyholm closed this Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants