Repository navigation
CI Add label when linting fails - #32751
Conversation
|
I took inspiration on the |
|
Here is a PR on my fork where I tested it : FrancoisPgm#3 |
I am not sure how to check for another workflow status, but anyway the Linter workflow appears as successful even when the linting fails, I think it might be so that the artifacts are uploaded anyway after the linting failed so they can be retrieved by the commenter bot. |
Probably? I guess looking at the content of the log file is the most convenient thing you have. In an ideal world we would rewrite this script with PyGithub because it looks like there are many things that are a bit cumbersome with REST API calls. One downside is that we would be relying on a dependency, and you never know things can break. We are already using PyGithub for others parts of the CI, and so far no breaking change has bitten us (I think). |
|
also cc @adrinjalali who was interested by the "CI:Linter failure" label IIRC. |
OK I tried to be bold, but I changed my mind after 5 minutes. I would rather merge this on Monday to be around in case there is an unexpected side-effect 😅 |
|
All right, let's merge this and see what happens! |
|
I tested this in #32745 (comment) and it seems to work fine 🎉. The label was added on linter failure and then removed when linting passes.
|
|
This is slightly off topic, (but better then creating a new issue for that.) Now that we communicate I think only posting the comment if the linting is broken is also easier for new contributors to digest, since it will be posted right below the commit that made the linter unhappy instead of outside of the timeline (the update in the old comment can be missed). What do people think about removing the comment if the linter passes? I think we had briefly talked about it on the scientific python summit. |
|
I like the idea of not having a comment when everything is ok, a "no news good news" approach which minimizes noise. |
|
I was kind of thinking the same thing lately that we could only have a comment when linting fails and delete the comment when linting succeeds. I don't think we care too much about keeping the comment history. The thing I would suggest:
Some reasons why I slighly prefer to delete the comment:
|

Reference Issues/PRs
What does this implement/fix? Explain your changes.
The "Bot linter comment" action now adds a "CI : lniter fails" label to a PR if the linter fails, or removes it if the linter succeeds.
Any other comments?
This change requires a label with the name "CI : linter fails" (or any relevant name) to be created.