Skip to content

ci: sweep caches at the end of the merge queue under the 10 GB budget (#1854) - #1867

Merged
zackees merged 2 commits into
masterfrom
fix/1854-end-of-queue-janitor
Oct 23, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/1854-end-of-queue-janitor

Conversation

@zackees

@zackees zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member

Closes #1854. Refs #1269, #1723, forge-ci/ci.yml#405.

Change

  • ci.yml now ends with a cache-janitor job: needs: [ci-pre, ci-gate] (so every other job, transitively), if: always() && github.event_name == 'merge_group', and the repo-wide cache-janitor group with cancel-in-progress: false. The merge queue serializes master's cache writes, so this sweep has the cache to itself and sees what the run just saved.
  • The ci.yml pin goes from 1a970f0 to a1917ce (feat(cache): merge queue policy; end-of-queue janitor enforces [cache].budget by LRU (#405) forge-ci/ci.yml#407). At that version the janitor runs a final repo-wide pass that evicts the least recently accessed caches until the total fits [cache].budget (10 GB). It keeps each family's newest entry and anything younger than 10 minutes, so GitHub's own LRU eviction never picks.
  • ci-pre.yml's janitor now sweeps master pushes only, not the start of queue runs.
  • CI Gate never waits on the sweep, so a janitor failure cannot eject a PR.
  • The janitor runs ci-lint via uvx at the pin, not bare python3, per ci/test_uv_run.py.
  • AGENTS.md and docs/ci-tooling.md describe the new placement.

This is what makes #1723's over-budget family declarations safe: live usage is held under 10 GB by our own sweep, not by GitHub.

RED → GREEN

  • RED c8368a363: ci/test_ci_pre.py + ci/test_ci_toml.py fail 4 (no final janitor, ci-pre still sweeps the queue, old pin).
  • GREEN: those tests plus ci/test_merge_queue.py pass; full ./lint passes.
  • ci-lint precheck --local at the new pin: GEN-022 reports nothing. The only difference from master is one more CACHE-013 for the janitor's setup-uv step, the same pattern as three existing ci.yml setup-uv steps that also have no exception.

The first real check is the first merge-group run after this lands; the janitor's before/after table will be in its log.

…budget (#1854)

ci.yml's final cache-janitor job needs every other job, runs on always()
for merge_group only, and holds the non-cancelling cache-janitor group.
At the forge-ci/ci.yml#405 pin it evicts least recently used caches down
to [cache].budget, so GitHub's eviction never picks. ci-pre.yml's sweep
now runs on master pushes only. CI Gate never waits on the sweep.
@zackees
zackees added this pull request to the merge queue Oct 23, 2026
Merged via the queue into master with commit 0611a09 Oct 23, 2026
30 checks passed
@zackees
zackees deleted the fix/1854-end-of-queue-janitor branch October 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ci: run the cache janitor at the end of the merge queue and enforce the 10 GB budget by LRU

1 participant