Add automated labelling to staged-recipes
See original GitHub issueThis is a proposal to add automated labelling to the staged-recipes repo using GitHub actions. I’m opening this as an issue instead of a PR as I wanted to get some input first what everybody else thinks. As conda-forge is generally very hands-on I didn’t want to add too much automation and thought that the following would be a good start:
-
Label PRs based on the requested team. This is pretty straightforward and would only add a label with the pinged team. It would make browsing PRs easier and quicker as you can see if it’s in your domain or not. Additionally, even PRs by new contributors that cannot yet ping a team are labelled and can be marked as ready for review.
The GitHub actions yaml would be something like this:
name: Label PRs on: issue_comment: types: [created] jobs: label-pr: name: Label PR if: ${{ github.event.issue.pull_request }} runs-on: ubuntu-latest strategy: matrix: include: - label: 'staged-recipes' comment: '@conda-forge/staged-recipes' - label: 'python' comment: '@conda-forge/help-python' - label: 'python-c' comment: '@conda-forge/help-python-c' - label: 'r' comment: '@conda-forge/help-r' - label: 'java' comment: '@conda-forge/help-java' - label: 'nodejs' comment: '@conda-forge/help-nodejs' - label: 'c-cpp' comment: '@conda-forge/help-c-cpp' - label: 'perl' comment: '@conda-forge/help-perl' - label: 'julia' comment: '@conda-forge/help-julia' - label: 'ruby' comment: '@conda-forge/help-ruby' steps: - name: team-label if: contains(github.event.comment.body, matrix.comment) env: label: ${{ matrix.label }} uses: actions/github-script@v6 with: script: | github.rest.issues.addLabels({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, labels: [process.env.label, 'review-requested'] })
I tested the code locally and noticed a couple of small issues:
- conda-forge/help-python-c also includes conda-forge/help-python as it checks if the string is included.
- Currently runs for every label as the
if
is only checked during the run. Maybe there is a better way.
-
Add review-requested lables This would be set with the above action and the reviewer can then remove it again manually (can also be automated probably).
The benefit of this is that sometimes PRs are missed because no-one reviewed them which would now be visible. So instead of going to each PR and checking if it has been reviewed yet, it can be seen from the overview page.
Additionally, the staged-recipes team can see if the reason another team member commented was because they reviewed the PR or are the author and actually still need a review.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:20 (20 by maintainers)
Top GitHub Comments
That seems fine to me. Let’s not the perfect be the enemy of the good or w/e.
Correction : A review from anyone (regardless of team membership) will clear the “review-requested” tag. Normal comments would not affect the ‘review-requested’ label because reviews and comments have separate triggers.