-
Notifications
You must be signed in to change notification settings - Fork 31
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
Conversation
|
||
- name: Open issue | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CARSONPROD_GITHUB_TOKEN }} |
There was a problem hiding this comment.
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
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? |
That is an excellent question. I’ve considered that too. But I decided not to do that. 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. |
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. |
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. |
5bede6a
to
670af20
Compare
<?php | ||
|
||
if ($argc !== 3) { | ||
echo "./docs-invalid-use.php path-to-docs path-to-symfony\n"; |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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
@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 |
Im closing this in favour of symfony-tools/code-block-checker#38 That would make this feature part of the CI instead of Carson. |
@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.