Skip to content

ci(affected): cache only coverage.db, not full target/affected - #2517

Merged
max-sixty merged 1 commit into
mainfrom
cache-only-coverage-db
May 1, 2026
Merged

max-sixty merged 1 commit into
mainfrom
cache-only-coverage-db

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Summary

cargo-affected leaves per-collect profraw bundles (~5 GB on this repo) in target/affected/profraw-<PID>/. The CI cache was saving the parent dir, so a single collect saturates the 10 GB repo cache cap and evicts every other cache — which is why PRs were missing both the exact-match and prefix-fallback keys and falling back to the full suite.

Narrow save/restore to target/affected/coverage.db (~225 MB). With this, multiple main-collect caches can coexist and PRs are far more likely to hit the prefix-fallback.

Cleaning up the profraw bundles inside cargo-affected itself is a separate follow-up (also benefits local devs whose target/affected/ currently grows by 13 GB per cargo affected collect until they cargo clean).

Test plan

  • CI green on this PR (the affected-tests job will still cache-miss until a main-collect runs against the new path; that's expected)
  • After merge, next push to main saves a small (~225 MB) cache
  • Subsequent PR runs hit the prefix-fallback and benefit from selection

🤖 Generated with Claude Code

cargo-affected leaves per-collect profraw bundles in
`target/affected/profraw-<PID>/` (~5 GB on this repo). Caching the
parent dir ships those into the GitHub Actions cache, where a single
collect saturates the 10 GB repo cap and evicts every other cache —
so PRs miss both the exact-match and prefix-fallback restore keys and
fall back to running the full suite.

Narrow both save and restore to `target/affected/coverage.db` (~225 MB).
Cleaning up the profraw bundles themselves is a separate follow-up in
cargo-affected; until then this keeps the cached payload small enough
for multiple collects to coexist.

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty
max-sixty merged commit a9150bb into main May 1, 2026
28 checks passed
@max-sixty
max-sixty deleted the cache-only-coverage-db branch May 1, 2026 04:29
max-sixty added a commit that referenced this pull request May 2, 2026
…#2520)

Comment-only follow-up to #2517 and the cargo-affected sibling-reachable
change (max-sixty/cargo-affected#9). The cache-strategy comment in the
workflow still described the old "fallback widens to all tests"
semantics; it now describes the current behavior — sibling collect_shas
drive normal selection, full-suite widening fires only when no cache
exists at all.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants