-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Actions: Add change note checker #5214
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
Actions: Add change note checker #5214
Conversation
I think we had something similar somewhere that worked like so: Anything without a change note that looks like it might need a change note (based on changed file paths, I guess) cannot be merged without a manually added label "don't-need-change-note" or something like that. |
So I guess what I'm saying is that, yes, I think this should block merging, and that the "Minor change" label ought to be renamed to something including "change note" to make it clear what it means to apply that label. |
I was planning on putting this in the description of the label. I think "Doesn't need change note" is too long for a label. |
https://github.com/github/codeql-go/labels uses a "no-change-note-required" label. |
Possibly a good idea to check with the Go team how exactly they're using these change-note-related labels? |
Note to self: we should also exclude the |
Nice 💪
yes
I would like a more clear name for the label than "Minor change" as well, so I'm all for using the "no-change-note-required" as well 👍 |
Any thoughts on feedback for the user? Is adding a label sufficient, or would it be better for it to add a comment instead? |
CI fails for lots of reasons, so as long as you can click on the failed check and see why, then I don't think the PR needs any sort of feedback. |
I agree with |
Alright, in that case one more thing needs to be decided: when should the check trigger? However, I think if it is to fail the CI, then it would be bothersome to already trigger when the PR is created. Imagine I'm creating a PR early in the process, before I even know what the change note should say. I think it would be bothersome for the CI to fail outright, since that'll mean extra effort in order to figure out whether the CI failure is due to test issues (which is very relevant at that stage) or due to a missing change note (which is less relevant). In other words, I'm leaning towards only triggering when the PR is not in draft mode. |
Sounds good to me. |
- Fail the CI check if change note is missing. - Disregards changes outside of `*/ql/src`. - Runs the workflow on label changes, and upon moving the PR out of draft mode. - Only fails the CI check if the PR is out of draft. - Changes label to `no-change-note-required`.
@@ -0,0 +1,33 @@ | |||
on: | |||
pull_request_target: |
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.
Note this makes this workflow security-sensitive, because it'll run on PRs from forks but in the context of the base repo and branch. That's what you need here, but be extra careful not to use data from the event payload (PR body, etc) in the body of a script.
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.
Hmm... So I am using some data from the payload (to wit, the list of files contained therein), but I guess that might be okay.
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.
I think that's ok, especially as it's coming back from the API rather than directly from the event payload.
Removes the checkout action, as this is no longer needed, and folds the `grep` into `jq`.
@@ -0,0 +1,33 @@ | |||
on: | |||
pull_request_target: |
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.
I think that's ok, especially as it's coming back from the API rather than directly from the event payload.
Checks whether a change note is present on a PR (assuming it should be) and adds a label to indicate when its not.
Considers all
.ql
and.qll
files relevant, unless:experimental
, orIf any relevant files are found, and there is no corresponding change note, the label "Needs change note" is applied to the PR.
I'm thinking we may want to roll this out to just the Python team at first. I have tested it manually, but I can't guarantee that it works perfectly.
Open questions:
cc: @RasmusWL @calumgrant @adityasharad