ci(publish): retry testpypi-smoke install to tolerate index propagation lag#57
Merged
Conversation
…on lag TestPyPI's /simple/ index is eventually-consistent (Fastly CDN): a just- uploaded version can take tens of seconds to a couple minutes to become installable. The smoke step ran a single pip install seconds after the test-pypi upload, racing the index and failing spuriously with "No matching distribution". Wrap the install in a retry loop (10x30s, ~5min ceiling, early-exit on success) and add --no-cache-dir so pip does not replay a cached negative index response. Route the version through env: for script-injection safety. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Document the failure mode fixed in the prior commit (TestPyPI /simple/ index propagation lag racing the post-publish smoke install) and its retry mitigation as row 8 of the pre-mortem table. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
testpypi-smokejob inPublish (TestPyPI)./simple/index is eventually-consistent (Fastly CDN). Thetest-pypijob uploadsonepin==X.Y.Z.devNand succeeds;testpypi-smokeruns ~8s later andpip installs that exact pinned version, racing the index before it propagates → spuriousNo matching distribution.build→smoke-install→test-pypiall passed, onlytestpypi-smokefailed; the version0.6.1.dev4was present on TestPyPI ~1h later (HTTP 200). Upload was fine — smoke just ran too early.Change
pip install … && onepin --versionin a retry loop: 10 attempts × 30s (~5 min ceiling), early-exit on success.--no-cache-dirso pip doesn't replay a cached negative index response across attempts.env: VERSION(referenced as"${VERSION}") — GitHub-recommended script-injection mitigation, defense-in-depth atop the existing PEP-440 validation.set -euo pipefail+ explicitexit 0/exit 1preserves correct pass/fail semantics. Happy path unchanged (attempt 1 passes if index warm).Reviews
/codex review, xhigh): PASS — 0 findings. "Retry loop correctly handles TestPyPI propagation delays; passes actionlint + shell syntax; no regressions."--no-cache-dirscope; the ~5-min budget covers it in practice) + 3 LOW (optional polish: empty-VERSIONguard, trailing-iterationsleep,--extra-index-urldep-confusion). None blocking.Verification
python -c "import yaml; yaml.safe_load(...)"— parses, 5 jobs intact.actionlint .github/workflows/publish.yml— clean.bash -non the embedded retry script — clean.workflow_dispatch).Notes
.github/workflows/); no Python touched, so thediff-cover/onepin._cligate is not triggered.promote-prod.yml(PyPI lane) has a pre-publish preflight but no post-publish smoke install — no analogous race, no change needed.🤖 Generated with Claude Code