tools: add workflow to add label when there are 2+ approvals#64340
tools: add workflow to add label when there are 2+ approvals#64340aduh95 wants to merge 1 commit into
Conversation
And make the CQ use it to support adding the label on PRs with a single approval which are not 7 days old yet. Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
|
Review requested:
|
Can we aleviate this drawback? Often times a PR that's ready to land in the 2-7 period would get an approval with a nit, or just requests a small change before approving, you want to fix that nit but now can't land it with CQ even if the one who requested a small change re-approves because now it needs one more existing reviewer to either come back and approve or someone else entirely. #62498 OTOH just allowed to add the CQ label with one approval and it'd stay in the queue until a 2nd review comes or 7 days pass. No brain teasers. |
|
@panva you can add the
Approvals: 2+
|
Which label would that be? Can you explain this automation proposal here better? |
|
The automation runs every time a review is submitted or dismissed. It will count how many approvals from the team (TSC for semver-major PRs, collaborators for other PRs) on the HEAD (i.e. since the last non-empty commit), if that's more that 2 and there are no changes requested, it adds
Approvals: 2+
To answer this specifically, the answer is: definitely yes, I had to add some logic to check if the review was on the last commit. |
And make the CQ use it to support adding the label on PRs with a single approval which are not 7 days old yet.
I've tested it with nodejs/node-auto-test#45, seems to be working fine. Here are a few caveats:
pr_number.txtis user-mutable (if someone opens a PR, they could change the workflow to pass arbitrary data to the file, which would then be consumed by the other workflow if it receives any review (which doesn't have to be positive nor from someone with Write access)), unless I've missed something the worst that could happen is that the label could be added/removed on the wrong PRlatestReviewJSON field ofgh pr viewas I find it unreliable at communicating if it's limited to "non-stale" reviews (i.e. did the PR head changed since that review)Alternative to #64262 and #62498