Fix PyPI canonical release recovery#111
Conversation
Signed-off-by: Nelson Spence <nelson@projectnavi.ai>
Review Summary by QodoImplement PyPI canonical dist recovery for immutable version releases
WalkthroughsDescription• Add canonical Python dist recovery path for PyPI immutable versions - Uses current build for new versions - Downloads and verifies PyPI-served files for existing versions • Implement release_pypi_canonical_dist.py with canonicalize/verify commands • Rewire release workflow to select canonical dist before attestation • Update invariant tests to validate new pypi-canonical-dist job • Hash-pin wheel/sdist installs in smoke tests and build workflows Diagramflowchart LR
build["build-wheels<br/>build-sdist<br/>build-crate"]
canonical["pypi-canonical-dist<br/>canonicalize"]
attest["attest<br/>provenance"]
release["release-assets-draft"]
publish["publish-pypi<br/>publish-crate"]
build -->|raw artifacts| canonical
canonical -->|canonical dist| attest
canonical -->|canonical dist| release
attest --> release
release --> publish
canonical -->|source flag| publish
File Changes1. tests/release_pypi_canonical_dist.py
|
Code Review by Qodo
1.
|
14c6d00 to
83c8506
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a canonical PyPI distribution handling mechanism for the release workflow, allowing the recovery path to download and verify immutable files already published on PyPI instead of relying on raw rebuilt artifacts. It adds a new script release_pypi_canonical_dist.py along with unit tests and updates the release invariants and documentation. The review feedback focuses on improving the robustness of the new script against transient network or CDN propagation errors. Specifically, the reviewer suggests raising exceptions instead of calling fail() immediately in fetch_pypi_payload and pypi_dist_map so that the retry loop in verify() can function as intended, with corresponding updates to canonicalize and verify to handle these exceptions gracefully.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Signed-off-by: Nelson Spence <nelson@projectnavi.ai>
Signed-off-by: Nelson Spence <nelson@projectnavi.ai>
Summary
Validation