Skip to content

fix(sbom): patch tag:cacheKey on cache hits#842

Merged
castrojo merged 1 commit into
projectbluefin:mainfrom
castrojo:fix/dakota-sbom-cachehit
May 14, 2026
Merged

fix(sbom): patch tag:cacheKey on cache hits#842
castrojo merged 1 commit into
projectbluefin:mainfrom
castrojo:fix/dakota-sbom-cachehit

Conversation

@castrojo
Copy link
Copy Markdown
Contributor

@castrojo castrojo commented May 14, 2026

Cache hits in processLatestTagStream preserved entries unchanged, keeping the old tag: imageRef value from before PR #840. Patch tag to cacheKey on every cache hit — idempotent, no SBOM re-downloads. Fixes nvidia=null on all historical Dakota entries after the next SBOM cache run.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed cache synchronization issue where tag values were not updated with current date information, which could cause downstream lookup failures.

Review Change Stack

Cache hits were preserving existing entries unchanged, keeping
old tag:imageRef values. Patch tag to cacheKey on every cache
hit — idempotent, no SBOM re-downloads. Fixes nvidia=null on
all historical Dakota entries after the next SBOM cache run.

Assisted-by: Claude Sonnet 4.6 via pi
@castrojo castrojo merged commit 586d367 into projectbluefin:main May 14, 2026
2 of 3 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bafe2ed5-e4ca-4e76-b366-6d7411077288

📥 Commits

Reviewing files that changed from the base of the PR and between 032aa50 and f0f1a2b.

📒 Files selected for processing (1)
  • scripts/fetch-github-sbom.js

📝 Walkthrough

Walkthrough

The PR fixes a cache-hit bug in the SBOM fetch script's processLatestTagStream() function. On a cache hit, the script now rewrites the cached entry's tag field to match the computed latest-YYYYMMDD cache key, ensuring downstream lookups keyed by tag reference the correct entry instead of a potentially stale or mismatched value.

Changes

Cache-hit tag consistency fix

Layer / File(s) Summary
Rewrite cached entry tag on hit
scripts/fetch-github-sbom.js
On cache hit in processLatestTagStream(), the script copies the cached entry and overwrites its tag with the computed cacheKey (latest-YYYYMMDD), replacing the prior direct reuse that left mismatched tag values.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • projectbluefin/documentation#839: Restores routing so Dakota specs use processLatestTagStream, complementing the cache-hit tag-rewriting fix in this PR.
  • projectbluefin/documentation#815: Adds fallback logic for missing latest-YYYYMMDD cache keys, addressing the downstream lookup correctness that this PR's tag rewriting also ensures.
  • projectbluefin/documentation#795: Introduces the derived latest-YYYYMMDD cacheKey logic that this PR depends on to rewrite cached entry tags correctly.

Poem

🐰 A cache was haunted by tags of old,
Where mismatched entries were bought and sold.
Now on each hit, the tag is reborn,
latest-YYYYMMDD wears the morn!
Lookups rejoice, the bug is gone.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

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