Repository navigation
MNT Split into build-wheels and publish workflows - #18
Conversation
I have a small preference for this PR, for simplicity reasons at least for now. I guess we can always change our mind later if we realize the additional wheel rebuilding is too painful in practice? We were already doing the additional rebuilding in our previous setup, right? Once in the PR with |
|
Can anyone from the Given the limited permissions on |
Yes, that was the idea I think. You could decide to only trigger the workflow in PRs from maintainers or something like this if we want to be more restrictive. It's a bit annoying to have to maintain two slightly different Overall I don't know 🤷. My initial personal conservative instinct was to follow numpy and scipy approach and see later if we wanted to be more adventurous ... |
|
So I chatted with an agent to investigate the security implications of having a tl;dr is that it seems OKish but I would kind of like a second opinion on this ... cc @ogrisel @thomasjpfan, see chat session below. I am also in two minds for the upcoming 1.10 release (penciled in end November), my gut is telling me "let's follow the numpy + scipy approach and revisit this PR later" but that would require us to tweak a bit our habits and update the doc. I can also see how not changing our release habits too much is a good thing, but someone needs to review this PR closely and test it (I am not sure how much testing was done but agents are very good at testing this kind of things). So overall I am like I don't really know 🤷. Agent chat about security implications🧠 What's the security implications of workflow_call in #18. Does workflow_call called from scikit-learn trigger have access to the secrets inside the scikit-learn-release repo in principle? 🤖 No: calling workflow_call from scikit-learn does not grant access to secrets stored in scikit-learn-release. The reusable workflow executes in the caller’s security context; its location supplies the workflow code, not that repository’s privileges. GitHub’s rules are:
For PR #18 (#18), the separation looks sensible:
The main remaining concern is executing untrusted scikit-learn code during builds. Keep those builds without secrets, avoid secrets: inherit, use a read-only caller token, and ensure privileged publishing only consumes artifacts from trusted runs. Pinning the cross-repository workflow call to a commit SHA also prevents later changes to the reusable workflow from silently changing what the caller executes. References: GitHub’s secrets-passing rules (https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows#passing-inputs-and-secrets-to-a-reusable-workflow) and caller context and token permissions (https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations#github-context). 🧠 So if I use ${{ secrets.BLA }} in scikit-learn-release build-wheels.yaml it is actually the secrets from the scikit-learn repo when called from scikit-learn? 🤖 Yes—provided the scikit-learn caller passes it: jobs: Then ${{ secrets.BLA }} inside build-wheels.yml refers to the passed value from scikit-learn. Explicitly passing it requires declaring BLA under on.workflow_call.secrets in the reusable workflow. Alternatively, secrets: inherit passes the caller’s available secrets without individual declarations. Without either, ${{ secrets.BLA }} resolves to an empty string, even if BLA exists in scikit-learn-release. 🧠 Clarify this:
My main question is: is secrets.BLA empty when called from scikit-learn ? 🤖 Yes. In your scenario, It would only have a value if the |
|
I think the workflow in this PR is safe today. We'll need to be extra careful to make sure it continues to be safe. Top of mind:
permissions:
contents: read
|
|
Let's merge this one and iterate! |
Alternative version of #16
Closes #13
Closes #14
Closes #15
Toward #6
This PR proposes to rework the workflows to separate the concerns and required permissions. It makes the release workflow closer to what we've been doing so far. It also allows to safely test the wheels from scikit-learn without keeping 2 wheel config in sync.
The release steps would look as follow:
(using [cd build] just calls the
build-wheelsworkflow from this repo, but it can't publish or anything, so it's safe)(this way the author of the release PR can iterate and test the wheels, whereas right now we need a maintainer of the release repo to test the wheels against that PR)
publishworkflow for the maintenance branch.(this workflows calls build-wheels and then publishes to testpypi and pypi in a row)
Remark: similar structure as the other PR. The difference is that the publish workflow directly calls build-wheels and uses the artifacts within the job, so no need to loop through previous build workflows.
The nightly builds become:
nightlyworkflow. It uses thebuild-wheelsworkflow, then uploads to anaconda.(essentially the same as before)
(commented for now since it requires some setup in sklearn)
Side notes:
Follow-up:
publish.ymlinstead ofwheels.yml.