fix: validate cached binary version matches requested version (#146) - #169
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Disabled knowledge base sources:
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
WalkthroughAdds a new utility to extract Bun version strings from download URLs and integrates it into cache validation: expected version is derived from the URL and compared to the cached revision, logging warnings and forcing re-download on parse failure or mismatch. Changes
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/action.ts`:
- Around line 98-108: The code currently accepts a cached binary when
extractVersionFromUrl(url) returns undefined; change the logic in the revision
validation block (using extractVersionFromUrl, expectedVersion, actualVersion,
revision, cacheHit, warning, info) to "fail closed": if expectedVersion is
falsy, treat it as a mismatch by setting revision = undefined, do not set
cacheHit true, and emit a warning/error explaining that the expected version
could not be parsed from the URL so the cache will be ignored; keep the existing
path that accepts the cache only when expectedVersion is defined and
actualVersion === expectedVersion.
ℹ️ Review info
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
dist/setup/index.jsis excluded by!**/dist/**
📒 Files selected for processing (3)
src/action.tssrc/utils.tstests/utils.spec.ts
|
ty! |
I pull the expected version from the download URL, compare it with the binary that was restored, and if they don’t match, I just download it again.
No more silently using an outdated cached version.
for #146