Skip to content

Restructure cache key paths and add strategy to graph key#92

Merged
xytan0056 merged 1 commit into
mainfrom
tanx/cache-key-restructure
May 29, 2026
Merged

Restructure cache key paths and add strategy to graph key#92
xytan0056 merged 1 commit into
mainfrom
tanx/cache-key-restructure

Conversation

@xytan0056
Copy link
Copy Markdown
Contributor

The previous cache key layout had inconsistencies that made the on-disk cache hard to browse and audit.
Reorganize cache key layout to be per-remote, then per-category**, withexplicit suffix labels:

  • <remote>/graphs/<treehash>/<strategy>[_requests-options-<md5>]
  • <remote>/treehashes/base-sha-<sha>[_request-urls-<md5>]
  • <remote>/compared-targets/<h1>_<h2>[_requests-options-<md5>]
  • <remote>/compared-targets-and-edges/<h1>_<h2>[_requests-options-<md5>]

@xytan0056 xytan0056 requested review from a team as code owners May 29, 2026 05:31
Comment thread core/common/utils.go
// requests), so neither requestOptions nor the computation strategy is part
// of this key.
func GetTreehashCachePath(buildDescription *tangopb.BuildDescription) string {
return filepath.Join("treehash", ToShortRemote(buildDescription.Remote), fmt.Sprintf("treehash-map-%s", buildDescription.BaseSha), GetReqsHash(buildDescription.Requests)) + "-" + buildDescription.Strategy.String()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no need to have strategy to identify treehash, which should be uniquely determined by base+ urls

@xytan0056 xytan0056 merged commit 810fb1a into main May 29, 2026
6 checks passed
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