.github: Add Python and Scripting labels to pull requests#32700
Conversation
9272f82 to
489370f
Compare
|
How was this tested? |
|
I ran numerous tests on my own repo. Given that it runs in a few seconds yet it takes hours of CI resources here and other unrelated tests frequently fail I did not replicate those tests on this repo. |
|
What will this do on e.g. my fork that does not have these labels? Is it a no-operation? (Our repo does not but that would be simple to add.) May consider changing "Lua" to "Scripting", that label already exists. |
|
It will add a Changing |
|
Add commented-out debugging commands for those who desire to test. |
|
Changed Lua to Scripting to use that preexsisting label. |
How was this tested?Try creating a pull request at https://github.com/cclauss/labels_by_language, adding It is quite difficult to test |
ff805f9 to
ce340e1
Compare
tpwrules
left a comment
There was a problem hiding this comment.
Do you think we need to remove labels if the PRs no longer contain those types of file? I see this runs on force pushes.
| if (filename.endsWith('.lua')) labels.add('Scripting'); | ||
| else if (filename.endsWith('.py')) labels.add('Python'); | ||
|
|
||
| if (labels.size === 2) break; |
There was a problem hiding this comment.
I don't think this super tiny optimization is worth the chance of forgetting to update it.
Are you saying that calling |
Add ___Lua___ and ___Python___ labels to pull requests that add, delete, or modify files containing those languages. Lua is currently 4.8%, and Python is 12.7% of this repo, so most pull requests will not modify these files. However, some contributors will have expertise in these languages and will be interested in reviewing pull requests that modify them. This quick GitHub Action will add labels to enable the rapid isolation of pull requests that contain these minority languages.
|
I'm saying this new workflow will update the labels on a PR if that PR is force pushed. That is what "synchronize" means AFAIK. But it can only ever add labels if the force push has a new type. Should it remove them too if the PR is force pushed to remove a change to a type of file? Not saying it needs to, just pointing out an observation and wondering your intention. |
|
I don't think the super-tiny optimization of dealing with forced revert is worth the chance of getting it wrong. |
tpwrules
left a comment
There was a problem hiding this comment.
Looks good, let's see how it does.
|
The default color of a new GitHub label is a drab black-and-white. See: Label colors can be set at: The Python logo color, Philadelphia (#306998), worked for me. |
|
Let's see how it goes. |
|
Add Python and Scripting labels to pull requests that add, delete, or modify files containing those languages.
is added to pull requests that modify
.pyfiles.Scriptingis added to pull requests that modify.luafiles.Summary
Classification & Testing (check all that apply and add your own)
Description
Lua is currently 4.8%, and Python is 12.7% of this repo, so most pull requests will not modify these files. However, some contributors will have expertise in these languages and will be interested in reviewing pull requests that modify them. This quick GitHub Action will add labels to enable the rapid isolation of pull requests that contain these minority languages.
How was this tested?
Pythonlabel to pull requests that modify.pyfiles ardupilot_wiki#7626It is quite difficult to test
pull_request_targettriggered GitHub Actions on a repo that you are not a maintainer of because GitHub purposefully makes it difficult to generatepull_request_targetevents.