Repository navigation
publish: upload the snapshot as a paced draft so a secondary rate limit cannot stall it - #648
Conversation
…it cannot stall it A testing snapshot has about 500 assets. Since 2026-12-05 19:35 UTC every `gh release create` of the Aurora Nightly 2026-12-06.2 snapshot was refused by GitHub's secondary rate limit while the organisation was busy (runs 47555497555 and 47567962407, four attempts): collect and sign passed each time, but the release step failed and gh-retry's fallback re-uploaded every file again with --clobber. scripts/gh-release-paced creates the release as a draft, uploads the files in batches of 40 with a 45 s pause (each batch skips files the draft already holds, so a rerun of the job resumes), checks that the assets match, then publishes the draft. A tag that is already published is refused. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
There was a problem hiding this comment.
Verdict: FINISH at cd94856
Failure: The workflow cannot resume an existing draft when planning runs again. The successful gh release view check in .github/workflows/publish.yml:129–131 exits with "Release ... already exists" for drafts as well as published releases. Replaying those exact lines with the PR's existing draft fixture returned 1 before the uploader could resume.
Failure: scripts/gh-release-paced:19–31 trusts an existing name as a completed upload and compares only names before publishing. With the PR's fixture seeded with a same-name, same-size stale RPM, the script returned 0 and published the release, while the newly uploaded SHA256SUMS failed for that RPM. The same path published an empty existing asset. GitHub documents that a failed upload can leave an empty asset in the starter state. Compare uploaded state and content digests before skipping or publishing. Keep the refusal for published tags.
Checked: All ten existing paced-release and retry tests passed. The three reproductions used their existing fake release state and the exact script and workflow fragment. No live release was created.
Review of the paced upload (App review on cd94856): - The plan step refused any existing release, so a run after an interrupted release step stopped at the draft it left. It now refuses only a published release and lets the release step resume a draft. - gh-release-paced skipped an asset by name only, so a stale or unfinished (empty, state "starter") asset could be published. It now skips an asset only when GitHub reports it uploaded with the SHA-256 of the local file, uploads anything else again, deletes assets that are not in the directory, and publishes only when every asset matches by digest. - Names are compared the way GitHub stores them (other characters become ".", as asset_name in sign-repository.py), so aura-1.0.0~b19 matches its asset aura-1.0.0.b19. - The final edit sets the target, so a resumed draft is tagged at this run's commit. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
|
Addressed at bf69f42: the plan step resumes a draft and refuses only a published release; assets are skipped only when uploaded with a matching SHA-256 (stale and starter-state assets are uploaded again, stray ones deleted); names compared as GitHub stores them; publish only when every digest matches. Tests cover each case. |
There was a problem hiding this comment.
Verdict: FINISH at bf69f42
Failure: A failed paginated inventory can still publish an unverified snapshot. At scripts/gh-release-paced:44–51, the while ... done < <(remote) loop never receives the exit status of gh api --paginate. The retry wrapper emits the final attempt's partial stdout before returning a failure. I replayed a draft whose first page returned all 30 expected uploaded digests and whose second page failed with HTTP 503 on every retry while a stray RPM remained there. The exact helper returned 0 and ran release edit --draft=false with the stray RPM still attached. Check the inventory command's successful exit before using its output, including the initial prune and the final publish check.
Checked: All 17 existing paced-release and retry tests pass at this revision. Draft admission now works, published releases are refused, and a complete inventory causes stale same-size and starter-state assets to be replaced. The remaining failure is the partial inventory path in the new implementation.
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
App review on bf69f42: the inventory loops read `gh api --paginate` through process substitution, which drops its exit status, and gh-retry passes on the partial stdout of a failed last attempt. A listing whose second page kept failing could therefore prune and publish from half an inventory. Each listing is now captured first and a failed one ends the script, before the prune, every batch and the final check. Tests cover a listing that fails on every call and one that fails only at the final check before publishing. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
|
Addressed at 391550d: every asset listing is captured first and a failed one (including partial pages then a 503) ends the script before the prune, each batch and the final check. Two new tests: a listing that fails on every call, and one that fails only at the final check before publishing; neither publishes. |
There was a problem hiding this comment.
Verdict: MERGE at 391550d
Checked: The release helper now checks the listing exit status in the main shell before consuming inventory at prune, upload and publish. I replayed the previous 30-entry page followed by a terminal HTTP 503 at both the initial listing and the final pre-publish listing. The helper returned 1 and left the release as a draft in both cases. Initial failure also left the stray asset untouched.
Checked: All 19 existing paced-release and retry tests passed, including draft admission, stale and starter asset replacement, expected-name matching, published-tag refusal and both inventory failure cases. No live release was created.
Adversarial Core Review at
|
|
Re-checked at
|
The release step of publish.yml uploads a testing snapshot (about 514 assets) in one
gh release create. Since 2026-12-05 19:35 UTC GitHub's secondary rate limit refused it on every attempt while the organisation was busy: runs 47555497555 (three attempts) and 47567962407 signed the Aurora Nightly 2026-12-06.2 set (kernel-aurora 7.3.0-55 with linux#2989), then failed to publish it. gh-retry backs off for seconds, and after a failed create it re-uploads every file with --clobber, so it cannot get past a sustained limit.scripts/gh-release-pacedcreates the release as a draft, or resumes the draft an interrupted run left. It uploads the files in batches of 40 with a 45 s pause. An asset is skipped only when GitHub reports ituploadedwith the SHA-256 of the local file, so stale or unfinished (empty,starter) assets are uploaded again. Assets that are not in the directory are deleted from the draft. Names are compared the way GitHub stores them (aura-1.0.0~b19becomesaura-1.0.0.b19, as asset_name in sign-repository.py). Every asset listing must succeed in full (a failed listing stops the script before any prune or publish). The draft is published, with the target set to this run's commit, only when every asset matches by digest. A published tag is refused. The plan step now refuses only a published release, so a new run resumes a draft (a draft has no tag yet, so next-tag.py picks its name again).Tested: buildbox at 391550d: no runtime change on a Mac (CI workflow only). tests/test_gh_release_paced.py (fake gh: batches and publish, a secondary limit retried, a half-uploaded draft resumed, a stale same-name asset replaced, an unfinished empty asset re-uploaded, a stray asset deleted, GitHub name mapping, a published tag refused, an inventory that fails on every listing or only at the final check publishes nothing; the plan step's draft check) and test_gh_retry.py pass; tests/ 868 passed. Checked against the live API that
gh release view --json databaseId,isDraftand the assets endpoint'sstate/digestfields have this shape.Risk: two-way · no Mac (Fedora Testing publication only; a snapshot release takes about 10 minutes longer)