ci: cache the API state of the hourly workflows #4787
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4787"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T21:52:27Z.
What
CI on
mainfails withAPI rate limit exceeded for installation(HTTP 403) inPR overlap,Progress(deploy-pages status polling) andConflict label. That is theGITHUB_TOKENbudget, about 1000 requests per hour for the whole repository, shared by every workflow. It is not a per-user limit.Two hourly workflows spent most of it by walking every open PR on each run:
pr-overlaplisted the comments of each PR (--paginate) on every push tomainand every hour: 200+ requests per run.area-labelsranlabelerover 200 PRs every hour (several requests per PR).conflict-labelruns on every push and retries up to 5 times 120 s apart, so consecutive pushes stacked full passes.Nothing is removed; the same results are produced with fewer requests:
pr-overlap: a hash of each report is kept inactions/cache. Only PRs whose report changed read their comments. The state is saved even if the job fails (so a run that hits the limit still advances) and pruned when a PR closes.shopt -s nullglobmakes an empty report directory a no-op.area-labels: the head SHA plus thelabeler.ymlblob SHA is kept per PR;labelerruns only on PRs where it changed, at most 40 per run. A cold cache or alabeler.ymlchange refills over a few hours instead of in one burst.conflict-label:concurrencywithcancel-in-progress, so only the latest push is processed.progress-commentis unchanged: its content changes on every run, so there is nothing to cache.Expected while this merges: the failures continue until the budget resets.
mainpushes keep failing until the rate limit window has passed, and the first run of each cached workflow starts with an empty cache.area-labelsrefills at 40 PRs per run. After that, a run with no changes makes no per-PR requests.Open decision for the maintainer: a token with a bigger budget (GitHub App or PAT in a secret, 5000+/h) would be the long-term fix; it needs a secret only the owner can create.
Tested
Linux. The
pr-overlapcomment loop was run locally with a stubghover three runs: first run 5 calls, second run with unchanged reports 0 calls, third run only the changed PR was read and the closed one was pruned from the state. Thearea-labelsselection (jq) was run for an empty cache, no change, one changed + one new + one closed PR, and 100 PRs (capped at 40). All workflow YAML parses;check_conventionspasses.On my fork (
adriadam10/AnyPS5,workflow_dispatchon this branch, two runs each):actions/cache/restoreandsavework, the second run restored the key saved by the first, and both workflows succeeded. The fork has no open PRs, so the request count itself was not measured there.Overlaps with #4534 on
pr-overlap.yml(a guard for an empty report directory, with a test that extracts the script frommarker=).nullglobcovers the same case, and that test will need to follow this script if both merge.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)