Add workflow to automatically label pull requests#9121
Add workflow to automatically label pull requests#9121hashhar wants to merge 1 commit intotrinodb:masterfrom
Conversation
|
Can we have any test PRs which is labeled as doc based on this workflow ? |
| name: "Pull Request Labeler" | ||
|
|
||
| on: | ||
| pull_request_target: |
There was a problem hiding this comment.
what is the value of the "pull_request_target" => ? association here?
guessing it it an empty map, consider:
| pull_request_target: | |
| pull_request_target: {} |
There was a problem hiding this comment.
also, shouldn't we limit this to types: [open]? let's allow humans to unlabel something, for example if only docs/READE is changed.
There was a problem hiding this comment.
Anything in the docs tree is docs related .. even if it is just the readme or the pom or whatever .. but yes, we should also allow unlabelling
| @@ -0,0 +1,18 @@ | |||
| name: "Pull Request Labeler" | |||
There was a problem hiding this comment.
just labeler should be fine (see ci.yml)
| - uses: actions/labeler@v3 | ||
| with: | ||
| repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
| sync-labels: true |
There was a problem hiding this comment.
if we go with types:open, we should remove this as no longer applicable
| with: | ||
| repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
| sync-labels: true | ||
| configuration-path: .github/config/labeler-config.yml |
There was a problem hiding this comment.
any particular reason not to use the default location (.github/labeler.yml)?
mosabua
left a comment
There was a problem hiding this comment.
I am good with the idea and approach. Would be interested to figure out if this also updates the label if files change? E.g. a code PR does not have the label but then an update to some docs is added in a follow up push. Imho this should then add the docs label.. we can however merge and revise later.
Also I hope this does not add too much time to the build overall.
| name: "Pull Request Labeler" | ||
|
|
||
| on: | ||
| pull_request_target: |
There was a problem hiding this comment.
Anything in the docs tree is docs related .. even if it is just the readme or the pom or whatever .. but yes, we should also allow unlabelling
|
This was done in a different way in #9674 That has the benefit that it'll work correctly even if someone manually mislabels or files change after the PR is created. |
|
Fair point, I'll create a new one/re-open after verifying if it works even when changes are made to an already open PR. |
Do you think it's a must-have? it's not a must-have for me. FWIW see labelling in https://github.com/apache/iceberg project: https://github.com/apache/iceberg/pulls/ |
I think we should add |
Should be possible by changing existing label config to: docs:
- all: ['docs/**']
I think using labels for tests filtering has the downside that labels are applied after CI run has already been dispatched. IMO labels are for human consumption/informational. Test filtering should be as automatic as possible (like it is for docs-check). |
For starting with this will add the
docslabel to any changes under thedocstree.We can eventually add more rules.
The end-goal is to use these labels to selectively run tests or run additional tests.
e.g. for docs the product tests don't make sense to run. Also for example if there are changes in Hive related code the
tests:hivelabel could be added automatically to ensure all the Hive product test configs run.In this PR no actions are being taken based on the label so nothing changes except triaging might be a little easier now.