You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CI CUDA CI not running in lock-file update automated PR #29781
Discussed in #29576 (comment), for now we need to remember to unset "CUDA CI" label and set it again manually on automated array API lock-file PRs like #29766.
From #29576 (comment), maybe this is due to triggering a workflow from a workflow limitations, see doc. Apparently you need a PAT rather than the default GITHUB_TOKEN when you are in this case. The last example in the doc is very similar to our use case I think:
Conversely, the following workflow uses GITHUB_TOKEN to add a label to an issue. It will not trigger any workflows that run when a label is added.
I don't remember if we have a PAT for some of the CI that we could try to see whether that fixes the issue ...
changed the title [-]CUDA CI not running in lock-file update automated PR[/-][+]CI CUDA CI not running in lock-file update automated PR[/+]on Sep 4, 2024
This scope allows the bot to create and edit its own issues. It is best to use a
github account that does **not** have commit access to the public repo.
it seems that this is a PAT from @scikit-learn-bot that only has repo:public_repo.
It might not be enough to change a label on its own PR but it's worth a try. Otherwise we could elevate the permissions of the bot account and/or create a new PAT with elevated permissions to set the label.
Ah yes, I did not want to give @scikit-learn-bot to have any write permissions. For @scikit-learn-bot's token to have the permissions to add a label we'll need to:
Give the PAT the public_repo permission (I can not find a smaller permission
Another option is to trigger add workflow_dispatch to .github/workflows/cuda-ci.yml and trigger it from .github/workflows/update-lock-files.yml. (I have not tested this idea, but it should work)
When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN, with the exception of workflow_dispatch and repository_dispatch, will not create a new workflow run.
I think this explains why the label is added but there is no response to the label being added (the workflow doesn't start running).
I am unsure, but think we should not add workflow_dispatch to the CUDA CI workflow, even though the docs make me think this would allow a workflow to trigger this workflow. The reason not to add it is that the workflow then runs in the context of main, which creates cache poisoning, etc problems.
I think the simplest fix is to add scikit-learn-bot to the Contributor Experience team so that it has Triage permission and is able to add/remove labels. We can use the same PAT that we are already using which does have the public_repo permission.
I think adding scikit-learn-bot Triage rights is not too bad. Going over Triage permissions the worst that could happen (in case scikit-learn-bot was taken over by a malicious actor) is that scikit-learn-bot can be used to:
set/unset "CUDA CI" label multiple times to mine bitcoins
close issues/PRs
hide comments
plus some special powers for discussions (which we don't use very often) like locking/deleting a discussion (deleting an issue can not be done with only Triage rights just to be 100% explicit)
I have opened #29994 that uses the already existing PAT token.
If there is no objection, I'll add scikit-learn-bot to the Contributor experience team and if #2994 is merged by next Monday we can see if it actually works on the next automatic lock-file update PRs 🤞.
Looking at this again, I rather not add a bot account to the contributor experience team. We'll have to special case the bot account in build_tools/generate_authors_table.py.
We already have a "Robots team". We can add scikit-learn-bot there and give it triage permissions?
Activity
[-]CUDA CI not running in lock-file update automated PR[/-][+]CI CUDA CI not running in lock-file update automated PR[/+]ogrisel commentedon Sep 5, 2024
Indeed this sounds like a valid explanation.
.github/workflows/update_tracking_issue.ymluses${{ secrets.BOT_GITHUB_TOKEN }}which might be a PAT although I am not sure.It's also used in
.github/workflows/update-lock-files.ymlby thepeter-evans/create-pull-requestaction.EDIT: this might be a PAT based on https://github.com/peter-evans/create-pull-request?tab=readme-ov-file#token.
ogrisel commentedon Sep 5, 2024
Based on
scikit-learn/maint_tools/update_tracking_issue.py
Lines 8 to 11 in 390ce98
repo:public_repo.It might not be enough to change a label on its own PR but it's worth a try. Otherwise we could elevate the permissions of the bot account and/or create a new PAT with elevated permissions to set the label.
Maybe @thomasjpfan knows better.
ogrisel commentedon Sep 5, 2024
/cc @betatim who might also be interested in this discussion.
thomasjpfan commentedon Sep 14, 2024
Ah yes, I did not want to give @scikit-learn-bot to have any write permissions. For @scikit-learn-bot's token to have the permissions to add a label we'll need to:
public_repopermission (I can not find a smaller permissionAnother option is to trigger add
workflow_dispatchto.github/workflows/cuda-ci.ymland trigger it from.github/workflows/update-lock-files.yml. (I have not tested this idea, but it should work)betatim commentedon Oct 2, 2024
From the docs that Loic linked:
I think this explains why the label is added but there is no response to the label being added (the workflow doesn't start running).
I am unsure, but think we should not add
workflow_dispatchto the CUDA CI workflow, even though the docs make me think this would allow a workflow to trigger this workflow. The reason not to add it is that the workflow then runs in the context ofmain, which creates cache poisoning, etc problems.lesteve commentedon Oct 2, 2024
I think the simplest fix is to add
scikit-learn-botto the Contributor Experience team so that it has Triage permission and is able to add/remove labels. We can use the same PAT that we are already using which does have thepublic_repopermission.I think adding scikit-learn-bot Triage rights is not too bad. Going over Triage permissions the worst that could happen (in case scikit-learn-bot was taken over by a malicious actor) is that scikit-learn-bot can be used to:
I have opened #29994 that uses the already existing PAT token.
If there is no objection, I'll add scikit-learn-bot to the Contributor experience team and if #2994 is merged by next Monday we can see if it actually works on the next automatic lock-file update PRs 🤞.
thomasjpfan commentedon Oct 3, 2024
Looking at this again, I rather not add a bot account to the contributor experience team. We'll have to special case the bot account in
build_tools/generate_authors_table.py.We already have a "Robots team". We can add
scikit-learn-botthere and give it triage permissions?lesteve commentedon Oct 7, 2024
I have created a Triage robots team with Triage rights and added scikit-learn-bot to it. I think this was the simplest thing to do.
FYI, there was an old Privileged robots (IIRC was needed for LGTM at one point?) and I removed it while I was at it.