Repository navigation
Pin the win_arm64 scikit-learn to one version so the security audit cannot go red on its own - #11112
Conversation
…annot go red on its own The ARM64 branch of this requirement landed as `scikit-learn>=1.8.0`, which tests/security/test_scan_packages.py rejects and which is currently failing on main. The guard is not style. scripts/scan_packages_baseline.json records findings keyed by a hash of the scanned file's contents, and scikit-learn carries 13 such entries. A floating version means the next upstream release changes those contents, every one of the 13 stops matching, and the security audit turns red on whichever unrelated pull request happens to run after the publish. The test says exactly that in its own failure message. 1.8.0 is the lowest release that ships win_arm64 wheels, confirmed against PyPI, so it satisfies the reason the ARM64 branch exists while staying as close to the 1.7.1 pin on the other branch as wheel availability allows. tests/security passes 700 with 6 skipped after the change; the same suite fails on main today.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6fd764f6fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # branch as close to 1.7.1 as the wheel availability allows. | ||
| scikit-learn==1.7.1; sys_platform != "win32" or platform_machine != "ARM64" | ||
| scikit-learn>=1.8.0; sys_platform == "win32" and platform_machine == "ARM64" | ||
| scikit-learn==1.8.0; sys_platform == "win32" and platform_machine == "ARM64" |
There was a problem hiding this comment.
Reconcile the ARM64 floor regression test with this exact pin
This exact pin deterministically breaks tests/studio/install/test_diffusers_pin.py::test_the_win_arm64_floor_is_the_first_release_that_has_a_wheel, whose scikit-learn case requires the literal scikit-learn>=1.8.0 to preserve the earliest-wheel floor. Running that test against this commit produces 1 failed, 3 passed, so the broader suite remains red even though the security test is repaired; the floor guard and the new exact-pin invariant need to be reconciled in the same change.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and the right thing to flag: the two invariants genuinely could not both hold as written. Fixed in 6e5d0e4ce, which landed after this review.
The floor test asserted the >= spelling literally, but what it is for is that the resolver is not pushed above the first release carrying a win_arm64 wheel. An exact pin at that same version is that floor with the ceiling closed as well, so it now accepts either operator.
Not interchangeable in the other direction, which is why the pin is the side that stays. scan_packages_baseline.json keys its reviewed-benign findings by a hash of the scanned file contents, so a floating spec makes all 13 of this package's baseline entries stop matching the day upstream publishes, and reds the security audit on an unrelated PR. That is what is failing on main today.
test_diffusers_pin.py plus tests/security/: 147 passed. Setting the pin to 1.9.0 still fails the floor check, so the loosened test has not stopped biting.
The scikit-learn ARM64 branch has to be pinned exactly, because scan_packages_baseline.json keys its reviewed-benign findings by a hash of the scanned file's contents: a floating spec makes all 13 of this package's baseline entries stop matching the moment upstream publishes, and the security audit goes red on an unrelated PR. That is what is failing on main today. test_the_win_arm64_floor_is_the_first_release_that_has_a_wheel asserted the >= spelling literally, so the two invariants could not both hold. It now accepts == at the same version, which is the same floor with the ceiling closed as well, and still rejects any floor above the first release carrying a win_arm64 wheel.
|
Correct, and already addressed by 6e5d0e4, which landed after the commit you reviewed. Confirming it rather than asserting it, since the two guards now have to hold at once:
The relaxed floor guard is still doing its job, checked by mutation rather than by reading it:
So the two are complementary and only the intended spelling satisfies both: the floor guard still rejects a version above the first release carrying a I also checked the version claim against PyPI rather than the comment: the releases publishing |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
@codex security review |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…annot go red on its own (unslothai#11112) * Pin the win_arm64 scikit-learn to one version so the security audit cannot go red on its own The ARM64 branch of this requirement landed as `scikit-learn>=1.8.0`, which tests/security/test_scan_packages.py rejects and which is currently failing on main. The guard is not style. scripts/scan_packages_baseline.json records findings keyed by a hash of the scanned file's contents, and scikit-learn carries 13 such entries. A floating version means the next upstream release changes those contents, every one of the 13 stops matching, and the security audit turns red on whichever unrelated pull request happens to run after the publish. The test says exactly that in its own failure message. 1.8.0 is the lowest release that ships win_arm64 wheels, confirmed against PyPI, so it satisfies the reason the ARM64 branch exists while staying as close to the 1.7.1 pin on the other branch as wheel availability allows. tests/security passes 700 with 6 skipped after the change; the same suite fails on main today. * Let the ARM64 wheel floor be satisfied by an exact pin The scikit-learn ARM64 branch has to be pinned exactly, because scan_packages_baseline.json keys its reviewed-benign findings by a hash of the scanned file's contents: a floating spec makes all 13 of this package's baseline entries stop matching the moment upstream publishes, and the security audit goes red on an unrelated PR. That is what is failing on main today. test_the_win_arm64_floor_is_the_first_release_that_has_a_wheel asserted the >= spelling literally, so the two invariants could not both hold. It now accepts == at the same version, which is the same floor with the ceiling closed as well, and still rejects any floor above the first release carrying a win_arm64 wheel. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: danielhanchen <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
tests/security/test_scan_packages.py::test_digest_pinned_packages_are_pinned_on_every_supported_pythonis failing on main right now. I confirmed it againstorigin/mainin a detached worktree, so it is independent of any open PR.Why this matters beyond a red test
The guard is not a style rule.
scripts/scan_packages_baseline.jsonrecords findings keyed by a hash of the scanned file's contents, and scikit-learn carries 13 such entries. A floating version means the next upstream release changes those contents, all 13 stop matching, and the security audit turns red on whichever unrelated pull request happens to run after the publish. The test's own failure message says precisely this:So this is a latent trap as much as a current failure: it is red today, and it would have become red again at an arbitrary future moment.
The fix
Pin the ARM64 branch to
==1.8.0.I checked PyPI rather than trusting the comment: the releases carrying
win_arm64wheels are1.8.0,1.9.0and1.9.1. 1.8.0 is the lowest, which satisfies the reason the ARM64 branch exists at all (the neighbouring comment notes 1.7.1 would source-build there) while staying as close as wheel availability allows to the==1.7.1pin on the other branch.The comment now records why both lines must be exact pins, so the next person editing them does not reintroduce a range.
Verification
tests/security/: 700 passed, 6 skipped. The same suite fails onmaintoday.scikit-learnappears in only one requirements file; the other reference is a Colab freeze snapshot (scripts/data/colab_pip_freeze.gpu.txt), which is captured output rather than a spec and is untouched.No behaviour change for any platform other than Windows ARM64, where the resolved version moves from "whatever is newest at install time" to a fixed 1.8.0.