Skip to content

👷 ci(check): pin test tool downloads and bump them weekly - #3293

Merged
gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:ci/pin-test-tool-downloads
Sep 23, 2026
Merged

gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:ci/pin-test-tool-downloads

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

The rp test legs downloaded the newest RustPython release, and the Windows legs the newest Nushell release, then ran both binaries with no integrity check. 🔒 A swapped release asset would run on our runners unnoticed, and an upstream release could change CI results without a commit here.

The check workflow now reads each tag and per-asset SHA-256 from tasks/ci-tools.json and runs sha256sum -c before installing. The pins match what CI resolves today: RustPython 2025-03-05-upd-webpack-19 and Nushell 0.115.1. Dependabot cannot bump release downloads, so the upgrade workflow rewrites the file every Monday and on manual dispatch, and its daily runs bump the wheels and leave the file alone. On the Monday and manual runs the read-only generate job runs tasks/upgrade_ci_tools.py, which finds the newest releases (RustPython through GraphQL, since the REST release listing for that repository returns nothing), downloads the assets, hashes them, compares each hash with the digest GitHub reports when one exists, and rewrites the data file. An unchanged tag keeps its recorded hashes, so an asset replaced under the same tag fails CI. The publish job accepts tasks/ci-tools.json as one more allowed path in the upgrade patch, and no workflow file changes through automation. 🤖

I folded the bump into the existing embedded-wheel pull request instead of opening a second one. It reuses the patch validator, the upgrade environment and the deploy key, and a second publish job would double that credential surface for a one-file change. The trade-off: when a new pip, setuptools or wheel sits inside the seven-day age window on a Monday, the tool bump waits a week with it, and a later daily run that finds new wheels rebuilds the pull request without the tool bump until the next Monday. The bump step gets the read-only job token, and runs outside tox -e upgrade so the third-party tools that environment installs cannot read it.

@gaborbernat gaborbernat added the security Fixes a vulnerability or hardens the supply chain, CI or release label Sep 22, 2026
@gaborbernat
gaborbernat force-pushed the ci/pin-test-tool-downloads branch from 6250034 to ba1cd37 Compare September 23, 2026 00:10
@gaborbernat gaborbernat changed the title ci(check): pin and verify RustPython and Nushell 👷 ci(check): pin test tool downloads and bump them daily Sep 23, 2026
@gaborbernat
gaborbernat force-pushed the ci/pin-test-tool-downloads branch from ba1cd37 to 4d3616a Compare September 23, 2026 00:13
@gaborbernat gaborbernat changed the title 👷 ci(check): pin test tool downloads and bump them daily 👷 ci(check): pin test tool downloads and bump them weekly Sep 23, 2026
@gaborbernat
gaborbernat force-pushed the ci/pin-test-tool-downloads branch from 4d3616a to 18a16c3 Compare September 23, 2026 00:14
The rp test legs ran the newest RustPython release and the Windows legs
the newest Nushell release, with no integrity check. A swapped release
asset would run on our runners unnoticed.

Dependabot cannot bump release downloads. The check workflow reads each
tag and per-asset SHA-256 from tasks/ci-tools.json. A Monday schedule of
the upgrade workflow, and manual dispatches, rewrite that file from the
read-only generate job after comparing each computed hash with the digest
GitHub reports. Daily runs bump the wheels and skip the file.

Keeping the pins in a data file lets the publish job validator accept one
extra JSON path, and automation never edits a workflow file. A tag that
has not moved keeps its recorded hashes, so an asset replaced under the
same tag fails CI.
@gaborbernat
gaborbernat force-pushed the ci/pin-test-tool-downloads branch from 18a16c3 to 3a4e2e6 Compare September 23, 2026 00:14
@gaborbernat
gaborbernat merged commit 6f7d442 into pypa:main Sep 23, 2026
65 checks passed
@gaborbernat
gaborbernat deleted the ci/pin-test-tool-downloads branch October 3, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security Fixes a vulnerability or hardens the supply chain, CI or release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant