Skip to content

CI CUDA CI not running in lock-file update automated PR #29781

Closed

Description

@lesteve

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 ...

Activity

  1. added
    Needs Triage
    on Sep 4, 2024
  2. added and removed
    Needs Triage
    on Sep 4, 2024
  3. 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
  4. ogrisel commented on Sep 5, 2024

    @ogrisel
    Member

    Indeed this sounds like a valid explanation.

    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 ...

    .github/workflows/update_tracking_issue.yml uses ${{ secrets.BOT_GITHUB_TOKEN }} which might be a PAT although I am not sure.

    It's also used in .github/workflows/update-lock-files.yml by the peter-evans/create-pull-request action.

    EDIT: this might be a PAT based on https://github.com/peter-evans/create-pull-request?tab=readme-ov-file#token.

  5. ogrisel commented on Sep 5, 2024

    @ogrisel
    Member

    Based on

    The GitHub token only requires the `repo:public_repo` scope are described in
    https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes.
    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.

    Maybe @thomasjpfan knows better.

  6. ogrisel commented on Sep 5, 2024

    @ogrisel
    Member

    /cc @betatim who might also be interested in this discussion.

  7. thomasjpfan commented on Sep 14, 2024

    @thomasjpfan
    Member

    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
    • Add @scikit-learn-bot to the triage team

    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)

  8. betatim commented on Oct 2, 2024

    @betatim
    Member

    From the docs that Loic linked:

    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.

  9. lesteve commented on Oct 2, 2024

    @lesteve
    MemberAuthor

    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 🤞.

  10. thomasjpfan commented on Oct 3, 2024

    @thomasjpfan
    Member

    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?

  11. lesteve commented on Oct 7, 2024

    @lesteve
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions