Skip to content

feat: cache results across invocations#122

Merged
sitaktif merged 4 commits intobazel-contrib:mainfrom
sitaktif:add-cache-directory-option
Mar 17, 2026
Merged

feat: cache results across invocations#122
sitaktif merged 4 commits intobazel-contrib:mainfrom
sitaktif:add-cache-directory-option

Conversation

@sitaktif
Copy link
Copy Markdown
Collaborator

@sitaktif sitaktif commented Mar 2, 2026

Add a cache layer for target-determinator results. The cache key is based on the digest of the git tree object among other fields.

The configured target metadata is not stored in the cache because they take a lot space and are not needed except for -verbose mode. The cache is not read from (but results are saved) if -verbose is set.

One can disable the loading and saving to cache with --nocache_results.

Other changes:

  • Add a --cache-dir option to customise the path of worktree caching and results caching.
  • The path to the worktree cache is now in the "worktrees" sub-directory. Results are under "results" subdirectory.

Fixes #3

Add a cache layer for target-determinator results. The cache key is
based on the digest of the git tree object among other fields.

The configured target metadata is not stored in the cache because they
take a lot space and are not needed except for `-verbose` mode. The
cache is not read from (but results are saved) if `-verbose` is set.

One can disable the loading and saving to cache with
`--nocache_results`.

Other changes:
- Add a --cache-dir option to customise the path of worktree caching and
  results caching.
- The path to the worktree cache is now in the "worktrees"
  sub-directory. Results are under "results" subdirectory.
@sitaktif sitaktif requested a review from illicitonion March 3, 2026 15:15
Comment thread pkg/cache.go Outdated
Comment thread pkg/target_determinator.go Outdated
Comment thread pkg/bazel.go
Comment thread pkg/target_determinator.go Outdated
Comment thread pkg/target_determinator.go Outdated
Comment thread pkg/bazel.go
@sitaktif
Copy link
Copy Markdown
Collaborator Author

@mkosiba merging now, but happy to separately amend the docs as you see fit

@sitaktif sitaktif merged commit a3b782f into bazel-contrib:main Mar 17, 2026
2 checks passed
@sitaktif sitaktif deleted the add-cache-directory-option branch March 17, 2026 10:12
@sitaktif
Copy link
Copy Markdown
Collaborator Author

Forgot to squash - I force pushed to main. Commit: de509bf

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.

CLI support base commit hash file as an input

2 participants