Skip to content
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

Extract PR labelling into separate GitHub Action #294

Closed
phillipj opened this issue Feb 28, 2021 · 5 comments
Closed

Extract PR labelling into separate GitHub Action #294

phillipj opened this issue Feb 28, 2021 · 5 comments

Comments

@phillipj
Copy link
Member

As already discussed in #264 and other threads here and there, we'd like to delegate as much as possible to the different repository contributors themselves, instead of having this github-bot being a bottleneck.

What we've been doing with the @nodejs-github-bot so far, by having the file paths -> labels configuration as code inside the github-bot' source code, has worked, but the downside of having to go into this repo and grasp how it works, to perform trivial labelling changes for the nodejs/node repository, isn't ideal for its contributors. It would be far better if they could be allowed to change a configuration file inside nodejs/node instead and for labelling to be done via a GitHub Action instead.


I'd like to jump onto copy-pasting most of what we have in the github-bot today, into a separate GitHub Action.

Don't hesitate to shout if anyone has ideas or already is on their way making this happen somehow.

@targos
Copy link
Member

targos commented Feb 28, 2021

Huge +1 to that! I think a custom action in a new repository makes sense.

@phillipj
Copy link
Member Author

Thanks for confirming the idea!

Forgot to mention that I skimmed through the existing Labeler Action source as its description matches exactly what we need: label PRs based on files being changed.

Although when comparing our existing rules to what the Labeler Action allows, it's not compatible. I wouldn't be surprised if we could have found a different ruleset for which we could have used Labeler, but that seems way more time consuming to me and involves a lot more people, than using what we've got, just applied differently (Node.js server vs GitHub Action).

@phillipj
Copy link
Member Author

phillipj commented Mar 14, 2021

After some tweaking and adjustments to the github-bot code, extracted into node-pr-labeler as a GitHub Action, I've got a working proof-of-concept:

Before using this Action in nodejs/node, I'm assuming it'll be preferable if it were moved into the nodejs organisation.

@targos any chance you know the process of moving repos into the nodejs org?

@targos
Copy link
Member

targos commented Mar 14, 2021

The process is documented here: https://github.com/nodejs/admin/blob/master/transfer-repo-into-the-org.md#transferring-an-existing-repository-into-the-organization

@phillipj
Copy link
Member Author

phillipj commented Mar 14, 2021 via email

targos pushed a commit to nodejs/node that referenced this issue Apr 25, 2021
Main goal of using a GitHub Action for labelling PRs has been to move
the mapping between files changed -> label into a configuration file
local to the nodejs/node repository.

Previously any changes to that mapping meant having to grasp the
nodejs/github-bot project, open a PR with the neccessary changes, get
approval from its maintainers before those changes finally got pushed
to production.

The logic involved in using the file paths / label configuration and
resolving the labels to be applied, has been moved into a custom GitHub
Action project: nodejs/node-pr-labeler.

Aside from removing the external dependency the nodejs-github-bot is in
practise, it also reduces the bar for contributors since the resulting
project is a lot smaller and less complex than nodejs/github-bot.

PR-URL: #38301
Fixes: nodejs/github-bot#294
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit to nodejs/node that referenced this issue Apr 25, 2021
Main goal of using a GitHub Action for labelling PRs has been to move
the mapping between files changed -> label into a configuration file
local to the nodejs/node repository.

Previously any changes to that mapping meant having to grasp the
nodejs/github-bot project, open a PR with the neccessary changes, get
approval from its maintainers before those changes finally got pushed
to production.

The logic involved in using the file paths / label configuration and
resolving the labels to be applied, has been moved into a custom GitHub
Action project: nodejs/node-pr-labeler.

Aside from removing the external dependency the nodejs-github-bot is in
practise, it also reduces the bar for contributors since the resulting
project is a lot smaller and less complex than nodejs/github-bot.

PR-URL: #38301
Fixes: nodejs/github-bot#294
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit to nodejs/node that referenced this issue Apr 25, 2021
Main goal of using a GitHub Action for labelling PRs has been to move
the mapping between files changed -> label into a configuration file
local to the nodejs/node repository.

Previously any changes to that mapping meant having to grasp the
nodejs/github-bot project, open a PR with the neccessary changes, get
approval from its maintainers before those changes finally got pushed
to production.

The logic involved in using the file paths / label configuration and
resolving the labels to be applied, has been moved into a custom GitHub
Action project: nodejs/node-pr-labeler.

Aside from removing the external dependency the nodejs-github-bot is in
practise, it also reduces the bar for contributors since the resulting
project is a lot smaller and less complex than nodejs/github-bot.

PR-URL: #38301
Fixes: nodejs/github-bot#294
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
richardlau pushed a commit to nodejs/node that referenced this issue Jul 5, 2021
Main goal of using a GitHub Action for labelling PRs has been to move
the mapping between files changed -> label into a configuration file
local to the nodejs/node repository.

Previously any changes to that mapping meant having to grasp the
nodejs/github-bot project, open a PR with the neccessary changes, get
approval from its maintainers before those changes finally got pushed
to production.

The logic involved in using the file paths / label configuration and
resolving the labels to be applied, has been moved into a custom GitHub
Action project: nodejs/node-pr-labeler.

Aside from removing the external dependency the nodejs-github-bot is in
practise, it also reduces the bar for contributors since the resulting
project is a lot smaller and less complex than nodejs/github-bot.

PR-URL: #38301
Fixes: nodejs/github-bot#294
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
richardlau pushed a commit to nodejs/node that referenced this issue Jul 23, 2021
Main goal of using a GitHub Action for labelling PRs has been to move
the mapping between files changed -> label into a configuration file
local to the nodejs/node repository.

Previously any changes to that mapping meant having to grasp the
nodejs/github-bot project, open a PR with the neccessary changes, get
approval from its maintainers before those changes finally got pushed
to production.

The logic involved in using the file paths / label configuration and
resolving the labels to be applied, has been moved into a custom GitHub
Action project: nodejs/node-pr-labeler.

Aside from removing the external dependency the nodejs-github-bot is in
practise, it also reduces the bar for contributors since the resulting
project is a lot smaller and less complex than nodejs/github-bot.

PR-URL: #38301
Fixes: nodejs/github-bot#294
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants