Repository navigation
ci(bench): drop stale github-pages artifacts so a re-run can deploy - #1960
Merged
Merged
Conversation
A re-run of Build Comparison Benchmark uploads a second artifact named
`github-pages`. actions/deploy-pages lists the artifacts of the whole RUN
(not the current attempt) and aborts when it finds two:
##[error]Error: Multiple artifacts named "github-pages" were
unexpectedly found for this workflow run. Artifact count is 2.
Re-running is the routine cure for the transient release-asset 504s that
kill the measure job, so the deploy was stranded on every retry: runs
42444946413 (both attempts) and 42466790090 (attempt 2) never published,
taking the client-facing mirror manifest on Pages with them.
`publish` now deletes any pre-existing `github-pages` artifact for this run
right before `upload-pages-artifact`, so the run always ends with exactly
one. Requires `actions: write` on the job. GH_API_URL exists solely so the
test can point the script at a fake API and execute it.
Verified against run 42466790090: after deleting the attempt-1 artifact by
hand, a re-run of the deploy job logged `Found 3 artifact(s)` ->
`Creating Pages deployment` -> `Reported success!` and the run went green.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
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.
Problem
Build Comparison Benchmarkcould not publish after any retry. A re-run uploads a second artifact namedgithub-pagesinto the same workflow run, andactions/deploy-pages@v4resolves the artifact by name across the whole run, not the current attempt (api-client.js->artifactClient.listArtifacts()), aborting when the count is not 1:Re-running is the routine cure for the transient release-asset 504s that kill the measure job, so this hit the two runs that were retried today: 42444946413 (attempts 1 and 2) and 42466790090 (attempt 2). Nothing was deployed from them, so the Pages site — which also serves the client-facing
site/mirror/**manifest — went stale while the benchmark job burned ~2.5 h per attempt.Fix
publishdeletes any pre-existinggithub-pagesartifact for this run immediately beforeactions/upload-pages-artifact, so a run always ends with exactly one:Drop Pages artifacts uploaded by earlier attempts(listruns/{id}/artifacts,select(.name == "github-pages"),DELETE actions/artifacts/{id}; no-op on a first attempt);publishgainsactions: writefor the delete;GH_API_URLoverride (defaults tohttps://api.github.com) so the test can execute the script against a fake API.The benchmark snapshot/log artifacts are explicitly not matched.
Tests
ci/test_benchmark_publish.py(already wired intoci-workflow-drift+ci/local_gate) gains 5 tests, including one that runs the real step script against a stdlib fake GitHub API seeded with run 42466790090's shape (twogithub-pages, plus site/log artifacts) and asserts only the two page artifacts are DELETEd.Red witness: with
origin/main's workflow restored, the same module fails4 failures, 1 error; green with the fix.Live witness
Deleted the stale attempt-1 artifact (id 13612500409) from run 42466790090 and re-ran the failed deploy job: attempt 3 logged
Found 3 artifact(s)->Creating Pages deployment->Reported success!, and the run is nowsuccess(13:52:55Z). That is the manual version of what this step automates.Observation, not fixed here
In 42444946413 both attempts had
publishsucceed anddeploy-pagesreportskipped16 s after the upload — a second way to strand the site that no re-run repairs, since--faileddoes not re-run a skipped job. I could not reproduce or explain it from the logs in this pass; flagging it rather than guessing.