-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Add check for Reviewed-By: line to merge.sh
#64363
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
+6
−1
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Really it should run
core-validate-commit, there are many more things that could go wrong – maybe we can also document somewhere that humans are never ever supposed to write aPR-URLtrailer manuallyThere 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'm not sufficiently familiar with
core-validate-committo make that change but if it can be called from here then that would probably make more sense.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 also considered adding an extra message to the error here (and on the PR-URL check) to say "Have you run 'git node land' first?" which would discourage an manual adding of the lines.
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.
Added additional message. Let me know if you're happy with the wording.
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.
With all due respect, if you can't figure that out, you probably shouldn't be using that script at all. Folks should be landing commits using the CQ, this script was added for power users to use when the edge cases that CQ won't handle – by "power user", what I mean is someone who knows what they're doing, and are able to fix their mistakes.
I'm not sure the use case of "the user amended the commit message" is covered by the added check, the mere presence of a
Reviewed-bytrailer says nothing about the validity of the commit message – but also, given that tool is meant for power users, do we actually want to try to outsmart the user? FWIW on GH we only enfore thePR-URLtrailer as well, so if you hadgit pushed (or used the GH web UI) instead of using the script, you would have come to the same result. If we want to enforceReviewed-by, that should happen at the GH level, not in this script IMO (and I'm not sure we need to enforce it, because it might have been the first time it has happened since we added the GH rule enforcing thatPR-URLtrailer is present)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.
My statement was more about the fact I hadn't looked at it before rather than not being able to figure it out.
While it would certainly be possible to include that I'm not sure we'd want to add a dependency on that into the script though since I don't think it currently has any other dependency on node itself currently.
But if you don't think this additional check and notice is appropriate for any use case I'll close the PR.
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.
It doesn't have a dependency on node AFAICT, the dependencies are listed in
node/tools/actions/merge.sh
Line 3 in 116302d
Definitely agree on that, adding deps should not be done lightly.
My point is that if we're adding a check, it shouldn't go on
merge.sh– it should be set as a rule on GH so it coversgit pushand folks using the web UI.Well I would still land the wording change reminding the user if they ran
git node land