-
Notifications
You must be signed in to change notification settings - Fork 107
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
feat: check fast-track approvals #588
Conversation
Codecov Report
@@ Coverage Diff @@
## main #588 +/- ##
==========================================
- Coverage 82.57% 80.39% -2.19%
==========================================
Files 35 37 +2
Lines 1750 1846 +96
==========================================
+ Hits 1445 1484 +39
- Misses 305 362 +57
Continue to review full report at Codecov.
|
lib/pr_checker.js
Outdated
r.user.login !== requestor && | ||
collaborators.includes(r.user.login))) { | ||
cli.error('The fast-track request requires' + | ||
" at least one collaborator's 👍."); |
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.
Fast tracking requires two collaborator approvals.
The pull request can be fast-tracked if two collaborators approve the fast-tracking request. To land, the pull request itself still needs two collaborator approvals and a passing CI.
Would it be possible to implement logic such that it checks to see if the person that requested fast-tracking is also the author of the PR and, if so, checks for two collaborator fast-track 👍 reactions, and otherwise accepts one collaborator fast-track 👍 reaction as long as it's not a 👍 from either the PR author or the collaborator proposing fast-tracking?
In other words:
If fast-track requester is PR author:
Require 2 👍 reactions from collaborators who are not the PR author
else:
Require 1 👍 reaction from a collaborator who is not the PR author or the collaborator who requested fast-tracking
Thanks for tackling this problem. The absence of fast-track confirmation is definitely a good loophole to fix! |
0fda488
to
2524533
Compare
2524533
to
80beb8a
Compare
@@ -9,6 +9,8 @@ const WAIT_TIME_SINGLE_APPROVAL = 24 * 7; | |||
|
|||
const GITHUB_SUCCESS_CONCLUSIONS = ['SUCCESS', 'NEUTRAL', 'SKIPPED']; | |||
|
|||
const FAST_TRACK_RE = /^Fast-track has been requested by @(.+?)\. Please 👍 to approve\.$/; |
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.
Would it be possible to loosen this regex so if the wording of the comment changes in the future, it doesn't require to update ncu? (I don't see why we would need to change the wording anyway, so definitely not a blocking comment, just a thought)
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 thought about it, but I'm afraid it would match a comment that is not a fast-track request (eg. if someone quotes the fast-track request comment).
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
ping @Trott |
No description provided.