ci: cache the API state of the hourly workflows #4787

Merged
adriadam10 merged 1 commit from upstream-pr/4787 into main 2026-10-12 21:54:10 +00:00
adriadam10 commented 2026-10-12 21:52:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T21:52:27Z.


What

CI on main fails with API rate limit exceeded for installation (HTTP 403) in PR overlap, Progress (deploy-pages status polling) and Conflict label. That is the GITHUB_TOKEN budget, 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-overlap listed the comments of each PR (--paginate) on every push to main and every hour: 200+ requests per run.
  • area-labels ran labeler over 200 PRs every hour (several requests per PR).
  • conflict-label runs 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 in actions/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 nullglob makes an empty report directory a no-op.
  • area-labels: the head SHA plus the labeler.yml blob SHA is kept per PR; labeler runs only on PRs where it changed, at most 40 per run. A cold cache or a labeler.yml change refills over a few hours instead of in one burst.
  • conflict-label: concurrency with cancel-in-progress, so only the latest push is processed.
  • progress-comment is unchanged: its content changes on every run, so there is nothing to cache.

Expected while this merges: the failures continue until the budget resets. main pushes keep failing until the rate limit window has passed, and the first run of each cached workflow starts with an empty cache. area-labels refills 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-overlap comment loop was run locally with a stub gh over 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. The area-labels selection (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_conventions passes.
On my fork (adriadam10/AnyPS5, workflow_dispatch on this branch, two runs each): actions/cache/restore and save work, 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 from marker=). nullglob covers the same case, and that test will need to follow this script if both merge.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4835417476 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4787). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-12T21:52:27Z. --- ### What CI on `main` fails with `API rate limit exceeded for installation` (HTTP 403) in `PR overlap`, `Progress` (deploy-pages status polling) and `Conflict label`. That is the `GITHUB_TOKEN` budget, 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-overlap` listed the comments of each PR (`--paginate`) on every push to `main` and every hour: 200+ requests per run. - `area-labels` ran `labeler` over 200 PRs every hour (several requests per PR). - `conflict-label` runs 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 in `actions/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 nullglob` makes an empty report directory a no-op. - `area-labels`: the head SHA plus the `labeler.yml` blob SHA is kept per PR; `labeler` runs only on PRs where it changed, at most 40 per run. A cold cache or a `labeler.yml` change refills over a few hours instead of in one burst. - `conflict-label`: `concurrency` with `cancel-in-progress`, so only the latest push is processed. - `progress-comment` is unchanged: its content changes on every run, so there is nothing to cache. Expected while this merges: the failures continue until the budget resets. `main` pushes keep failing until the rate limit window has passed, and the first run of each cached workflow starts with an empty cache. `area-labels` refills 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-overlap` comment loop was run locally with a stub `gh` over 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. The `area-labels` selection (`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_conventions` passes. On my fork (`adriadam10/AnyPS5`, `workflow_dispatch` on this branch, two runs each): `actions/cache/restore` and `save` work, 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 from `marker=`). `nullglob` covers the same case, and that test will need to follow this script if both merge. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!4787
No description provided.