Skip to content

Fix Actions cache key attribution - #1

Merged
brunoborges merged 1 commit into
mainfrom
fix-cache-attribution
Jul 29, 2026
Merged

Fix Actions cache key attribution#1
brunoborges merged 1 commit into
mainfrom
fix-cache-attribution

Conversation

@brunoborges

Copy link
Copy Markdown
Collaborator

Match the double SHA-256 behavior used by hashFiles so benchmark reports include cache sizes and cleanup removes benchmark-created entries.

Validated against the initial smoke run: all eight cache entries were attributed and removed.

Match the double SHA-256 behavior used by hashFiles so reports include cache sizes and cleanup removes benchmark entries.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 29, 2026 14:54
@brunoborges
brunoborges merged commit cfe7d5b into main Jul 29, 2026
1 check passed
@brunoborges
brunoborges deleted the fix-cache-attribution branch July 29, 2026 14:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the benchmark reporting logic to generate cache keys using the same “double SHA-256” hashing behavior as GitHub Actions hashFiles, improving cache entry attribution so reports can include cache sizes and cleanup can reliably remove benchmark-created cache entries.

Changes:

  • Added hashFilesSingle() to reproduce hashFiles-style double hashing for a single marker value.
  • Switched expected cache key generation from sha256() to hashFilesSingle() for benchmark-created caches.
  • Adjusted cache size summarization to avoid treating missing sizes as valid totals.
Show a summary per file
File Description
scripts/report.mjs Introduces hashFilesSingle, updates expected cache key hashing, and tweaks cache size aggregation during summary generation.
scripts/report.test.mjs Adds test coverage for the new hashFilesSingle hashing behavior.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread scripts/report.mjs
Comment on lines +13 to +16
export function hashFilesSingle(value) {
const contentHash = createHash('sha256').update(value).digest();
return createHash('sha256').update(contentHash).digest('hex');
}
Comment thread scripts/report.mjs
Comment on lines 96 to 102
const versionCaches = caches.filter(cache => cache.version === version);
const caseTotals = new Map();
for (const cache of versionCaches) {
if (cache.sizeBytes === null) continue;
const key = `${cache.distribution}-${cache.iteration}`;
caseTotals.set(key, (caseTotals.get(key) ?? 0) + cache.sizeBytes);
}
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