Publish the retained candidate on failed-jobs publication retries - #62
Merged
Merged
Conversation
Root cause: since 6b1a6d5 the publish job re-derived the version from its own GITHUB_RUN_ATTEMPT (release_channels.py --expected-version) and required it to equal the candidate version. A failed-jobs-only re-run keeps the preflight allocation and producer artifact from the earlier attempt (the documented retry contract), so the publisher computed 1.0.0-ci.24.2 for the retained 1.0.0-ci.24.1 candidate and refused it (run 36116514219, fd2eb8e). Before 6b1a6d5 the same retry path published the retained 1.0.0-ci.17.1 (run 35554989640); every publication since 6b1a6d5 succeeded in attempt 1, so the path went unexercised and the selection test covered attempt 1 only. No repository or environment configuration was involved. - release_channels.py keeps allocation unchanged and adds publication authorization: a main candidate must carry this run number and an allocation attempt no later than the current attempt; stable tags keep exact equality. The downloaded manifest must name this commit and version and a producing attempt of this run between the allocation and the current attempt, and the artifact name must be that producer's nuget-candidate-<run-id>-<attempt>. Other runs, attempts, candidates and unbound artifact names are rejected; packages.py verify still rechecks every package. - publish-nuget.yml passes the manifest and artifact name. - Offline tests cover initial execution, failed-jobs-only retry (retained or repacked artifact), full re-run (new allocation), stable tags across attempts and rejection of mismatched identities. - Packaging README and dependency policy document the retry contract. Co-Authored-By: Claude Opus 5.5 <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.
Fixes the publication failure of run 36116514219 (
fd2eb8e). A failed-jobs-only retry of Publish NuGet was rejected withCandidate version does not match publisher identity.Root cause (verified)
preflightallocates the main candidate version once, before build, as1.0.0-ci.<run number>.<attempt>. The packaging README documents that "retrying only failed downstream jobs retains the already allocated version and producer artifact".release_channels.py --expected-version, which re-derived the version from the publish job's ownGITHUB_RUN_ATTEMPTand required equality.preflight's1.0.0-ci.24.1, the publisher computed1.0.0-ci.24.2, and it refused the retained candidate.PACKAGE_VERSION: 1.0.0-ci.24.1in attempt 2.6cb0899) had a failed-jobs-only attempt 2:preflightwas carried over from attempt 1, and it published the retained1.0.0-ci.17.1.nugetenvironment admitted the job, and the failure is the tool's own check.Fix
release_channels.py: allocation is unchanged. A full re-run still allocates….<new attempt>and builds a new candidate.manifest.jsonmust name this commit and version, and a producing attempt of this run between the allocation and the current attempt.nuget-candidate-<run-id>-<attempt>.packages.py verifystill rechecks every package and hash.--skip-duplicate: an existing version fails, and partial uploads follow the documented full re-run.publish-nuget.ymlpasses the manifest and artifact name into the authorization.docs/dependency-policy.mdnow document the retry contract. They also note that a re-run executes the original commit's workflow, so this fix applies to runs of later commits.Validation
python -m unittest discover -s eng -p test_dependency_policy.py: 14 tests pass. The two new tests cover:main's module rejects the attempt-2 retry of1.0.0-ci.24.1exactly as in production.version=1.0.0-ci.24.1.eng/packagingtests need a packed candidate and run in CI's pack job. They error identically on unmodifiedmainwithoutartifacts/packages.🤖 Generated with Claude Code