Node: Autolabel PR's that are ready to land?

Created on 30 Apr 2020  路  5Comments  路  Source: nodejs/node

We already have a functionality in node land which check whether a PR can land or not, i.e. sufficient time and approvals etc. Would it be possible to create a bot that automatically checks this for PR`s and applies/removes a label accordingly on GitHub?

Might be helpful when going through PR's and trying to land them. Or what do you think @Trott @BridgeAR?

All 5 comments

Discussions have been taken on https://github.com/nodejs/build/issues/2201 recently.

It cannot be done in GitHub actions as they don't allow write permissions to add labels to PR's from forks.

The Node.js GitHub bot (https://github.com/nodejs/github-bot) does currently automatically apply labels on PR create.

I'm not sure something like that is feasible. For example, there are many times when I've seen people "request" one or more changes to be made, but click "approve" early with the assumption the changes will be made. There could also be concerns raised in the PR (not via the "request changes" mechanism) that have yet to be addressed.

FWIW, as a rudimentary substitute for something like this, I used to search for PRs that were open and approved in this repository, omitting certain labels (like the work-in-progress one). Then scroll down to ones that say 3 days or older (or reverse the sort order to be oldest first).

Something like this: https://github.com/nodejs/node/pulls?page=4&q=is%3Apr+is%3Aopen+review%3Aapproved+-label%3Asemver-major+-label%3A%22work+in+progress+%28WIP%29%22+-label%3Ablocked

@ronag it would definitely be possible to create such a bot but it has to know about a lot of special cases:

  • No open comment
  • Full CI is started after the last commit _or_ it's a documentation only change
  • At least one LG non-semver-major PRs and two for semver-major ones
  • No "blocked", "WIP" or "pending" label
  • It's not a draft

As @mscdex pointed out it won't be possible to catch requests for changes that are just regular comments that way but it should be sufficient to at least mark most PRs correct. I think as soon as such bot would be active, people would pay more attention how to ask for changes to prevent the bot from labeling it wrong.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

filipesilvaa picture filipesilvaa  路  3Comments

srl295 picture srl295  路  3Comments

jmichae3 picture jmichae3  路  3Comments

Brekmister picture Brekmister  路  3Comments

akdor1154 picture akdor1154  路  3Comments