Repository navigation
release-receipts: discover scheduled evidence from repository artifacts (fix the red schedule at the source) - #90
Merged
Merged
Conversation
Contributor
Author
Old-source control run (the read's carried condition, Q4): GREENOne spot box (
Gate met. Squash-merged on all checks green, with |
luisleo526
marked this pull request as ready for review
October 20, 2026 17:50
luisleo526
added a commit
that referenced
this pull request
Oct 20, 2026
Brings in #90 (release-receipts: discover scheduled evidence from repository artifacts). It touches scripts/release_receipts.py, tests/test_release_binding.py, tests/test_release_receipts.py and the release-receipts fixtures; this branch touches none of them, so the merge has no conflict. README.md is unchanged by #90, so the pair-rule digest pin (lines 215-244) still holds. Co-Authored-By: Claude Sonnet 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.
release-receipts: discover scheduled evidence from repository artifacts (fix the red schedule at the source)
Problem (measured by reading
scripts/release_receipts.pyat mainfb133cf)The
release-receiptsschedule (every 15 minutes) goes red on the third pass inside an hour. One pass issues about 2,200 GitHub REST calls for a consumer with ~2,200 historical runs: it lists every run of the consumer workflow (repos/{repo}/actions/workflows/{workflow}/runs, ~22 pages), then asks for the artifact list of EACH run (repos/{repo}/actions/runs/{id}/artifacts), then downloads a zip per receipt. At the cron rate that exceeds the App installation's hourly quota, so a later pass gets a 403 mid-enumeration and lands in the catch-all inmain(), which prints one sentence for eight different exception types (the failing read looks like a timing race, but it is a race with the quota window created by the pass itself). Passes that fail are short (4m49, 8m46) against 11-18 min for green ones.Change (one source file, +23 lines)
collect()(scheduled path, norun_id) lists the consumer's artifacts ONCE at repository level (repos/{repo}/actions/artifacts), keeps those named like the policy artifact that are not expired, and takes the candidate runs fromartifact["workflow_run"]["id"]; only candidates get a run fetch.completedare skipped (this also removes the genuinely racy in-flight read).fetch_artifact()takes the already-listed artifacts; the callback path (--run-id) is unchanged and still requires a receipt artifact.main()now includes the exception text (diagnostics only).Tests (
tests/test_release_receipts.py+310,tests/test_release_binding.py5 lines, 4 new fixtures)Route-set assertions for 60- and 600-run histories (no workflow-runs listing, no per-run artifact listing), stored bytes compared with fixed fixtures, pickup of a run once it completes, workflow refusal, artifact validation, callbacks, and the diagnostic text. Run:
python3 -m unittest discover -s tests -p 'test_release_*.py'(this ispython-test.yml's job; nothing here ran on a Mac).Proof status (honest)
release_receipts.pywhere the new tests must fail) was ordered but its launcher was blocked by the merge-gate hook (carded for LAB-CX); not run.?name=filter, so a consumer repo that uploads many artifacts per run may still need many pages; (b) a candidate from ANOTHER workflow carrying the same artifact name now raisesInvalid("unexpected reporting workflow")and aborts the whole pass (fail-closed, like the rest ofcollect; before, the workflow-specific listing made it impossible). Do not merge until that read is posted.Base
fb133cf(hub main); one commit392c14f.