Skip to content

allow filtering repo-content cache#166

Open
titusfortner wants to merge 1 commit into
bazel-contrib:mainfrom
titusfortner:repo-contents-cache
Open

allow filtering repo-content cache#166
titusfortner wants to merge 1 commit into
bazel-contrib:mainfrom
titusfortner:repo-contents-cache

Conversation

@titusfortner
Copy link
Copy Markdown
Contributor

@titusfortner titusfortner commented May 25, 2026

What

New boolean input repo-contents-cache, the extracted-repo directory Bazel 8+ stores at ${repository_cache}/contents is excluded from the saved GitHub cache via a !${repository_cache}/contents path pattern. No effect unless repository-cache is enabled.

Why

The repo contents cache (extracted repos + repo-rule results) sits inside the repository cache directory, so today it's silently included in the saved cache on Bazel 8+. Excluding contents keeps the download cache (the dominant time saver, since it avoids re-downloading) while dropping the saved size to ~2.3 GB. Opting in trades size for skipping re-extraction/repo-rule evaluation.

For Selenium's primary build cache-contents is 4.2GB of the 6.5GB total. When the GitHub limit is 10GB this is the difference between being able to use caching on our primary build and needing to disable it.

Default valiue

Defaulted to true to stay backward-compatible — current behavior already persists contents on Bazel 8+. Given the size data above, a strong case exists for changing the default to false; happy to flip if preferred.

Notes

  • Version-safe: on Bazel 7 there's no contents/ dir, so the exclusion is a no-op.
  • The exclusion lives in the shared repositoryCache.paths, so restore and save compute the same @actions/cache version. Toggling the input changes that version and invalidates existing repository caches (repopulated on next run).
  • Just setting --repo_contents_cache=  moves everything over to external cache, so it doesn't save space.

@titusfortner titusfortner marked this pull request as draft May 26, 2026 14:54
@titusfortner titusfortner force-pushed the repo-contents-cache branch from f506950 to f44df36 Compare May 26, 2026 17:06
@titusfortner
Copy link
Copy Markdown
Contributor Author

Verified current code is working. Reduced repository-cache from 3.7GB to 1.9GB,

You can see the last 2 jobs on this run: https://github.com/SeleniumHQ/selenium/actions/runs/26453263318/job/77898879869#step:57:3

=== Bazel cache sizes ===
  External:                 2.2G
  Repository Cache:         2.0G
  Repo Contents Cache:      4.3G
  Bazelisk:                 63M

and

  Saving repository cache, paths: ["/home/runner/.cache/bazel-repo/content_addressable"]
    /home/runner/.cache/bazel-repo/content_addressable: 2033.1MB
    total on disk: 2033.1MB

@titusfortner titusfortner marked this pull request as ready for review May 26, 2026 17:09
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.

1 participant