Skip to content

fix: skip saving the lockfile verification cache when save-cache is false - #81

Closed
EhabY wants to merge 1 commit into
pnpm:mainfrom
EhabY:fix/verification-cache-save-cache
Closed

EhabY wants to merge 1 commit into
pnpm:mainfrom
EhabY:fix/verification-cache-save-cache

Conversation

@EhabY

@EhabY EhabY commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #65.

save-cache: false only skipped the store cache. Every job still saved the lockfile verification cache, so pull requests kept writing to the cache. When the lockfile changes, every job also races to create the same key, and each one that loses warns Unable to reserve cache twice (example run).

Both saveVerificationCache calls now check save-cache. With false, a job restores both caches and saves neither. The default behavior is unchanged.

Validation: typecheck and build pass, and dist/ is rebuilt. pnpm test passes apart from the 2 lockfile-directory tests that also fail on main on Windows.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Setting save-cache to false now prevents saving both the pnpm store and lockfile-verification results, while still allowing existing caches to be restored.
  • Documentation
    • Clarified how save-cache controls saving each cache.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ef33e43f-ffef-4644-b5d0-010ac4399bf9
Commits

Reviewing files that changed from the base of the PR and between b382dc4 and 8cb1189.

Files ignored due to path filters: 1
  • dist/index.js is excluded by !**/dist/**
Files selected for processing: 3
  • README.md
  • action.yml
  • src/index.ts

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 30fb30f0-bf1e-4e26-8965-f98e0d0caef6
📥 Commits

Reviewing files that changed from the base of the PR and between a088197 and b382dc4.

⛔ Files ignored due to path filters: 1
  • dist/index.js is excluded by !**/dist/**
📒 Files selected for processing: 3
  • README.md
  • action.yml
  • src/index.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

⏰ Context from checks skipped due to timeout: 33
  • GitHub Check: runtime version falls back to devEngines
  • GitHub Check: Runtime from devEngines.runtime
  • GitHub Check: Installed runtime beats context-aware shims
  • GitHub Check: Runtime node@22 (macos-latest)
  • GitHub Check: Runtime node@22 (windows-latest)
  • GitHub Check: Deprecated package-json-file still works
  • GitHub Check: Node version file (tool-versions / ubuntu-latest)
  • GitHub Check: require-lockfile (standalone project / windows-latest)
  • GitHub Check: Workflow-set PNPM_CONFIG_GLOBAL_SHIMS is not overwritten
  • GitHub Check: Lockfile verification cache (macos-latest, cache=true)
  • GitHub Check: require-lockfile (standalone project / ubuntu-latest)
  • GitHub Check: require-lockfile
  • GitHub Check: Version from dist-tag (next-12)
  • GitHub Check: Version from semver range (^12.0.0-0)
  • GitHub Check: Lockfile verification cache (ubuntu-latest, cache=false)
  • GitHub Check: Smoke pnpm 11 (ubuntu-24.04-arm)
  • GitHub Check: Runtime node@22 (ubuntu-latest)
  • GitHub Check: Lockfile verification cache (windows-latest, cache=true)
  • GitHub Check: No runtime, no manifest
  • GitHub Check: Node version file (node-version / ubuntu-latest)
  • GitHub Check: install: false skips pnpm install
  • GitHub Check: Runtime deno
  • GitHub Check: Runtime bun
  • GitHub Check: pnpm command execution (ubuntu-latest / pnpm 11.22.0)
  • GitHub Check: Smoke (windows-latest / pnpm 12.0.0)
  • GitHub Check: Smoke (macos-latest / pnpm 12.0.0)
  • GitHub Check: pnpm command execution (windows-latest / pnpm 11.22.0)
  • GitHub Check: Cache Windows extended-length store path
  • GitHub Check: pnpm command execution (windows-latest / pnpm 12.5.1)
  • GitHub Check: Smoke pnpm 11 (windows-latest)
  • GitHub Check: Smoke pnpm 11 (macos-latest)
  • GitHub Check: Prime runtime cache
  • GitHub Check: check-dist
🔇 Additional comments: 3
action.yml: 1

82-85: LGTM!

README.md: 1

30-30: LGTM!

Also applies to: 214-215, 234-235

src/index.ts: 1

80-80: LGTM!

Also applies to: 90-90

Walkthrough

The save-cache input now controls saving the pnpm store and lockfile-verification results. When set to false, the action restores both caches without saving them. The main and post steps now gate verification-log saves on this input.

Changes: Cache Save Control

Layer / File(s) Summary
Cache save behavior
action.yml, README.md, src/index.ts
The input description and README state that save-cache: false prevents saving either cache. The main and post steps save verification logs only when inputs.saveCache is enabled.

Priority: Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Suggested reviewers: zkochan

Merge Risk: Minimal · up to b382d

With save-cache: false, the shipped action restores both caches without saving either; no material product risk is evident.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: preventing lockfile verification cache saves when save-cache is false.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

A rabbit checks the cache at dawn
The store is saved when save is on
Lockfile notes follow the same way
With save off, both rest for the day
Then hops along, content and calm

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

… false

`save-cache: false` stopped the store from being saved, but every job still
saved the lockfile verification log. When the lockfile changes, all jobs on
a platform race to create the same key, and each loser warns "Unable to
reserve cache" from both the main and post steps.

A job set to only restore now restores both caches and saves neither.
@zkochan
zkochan force-pushed the fix/verification-cache-save-cache branch from b382dc4 to 8cb1189 Compare October 24, 2026 23:18

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@zkochan

zkochan commented Oct 24, 2026

Copy link
Copy Markdown
Member

Thanks @EhabY. I'd rather keep saving the lockfile verification cache when save-cache: false. It's the more valuable of the two: it's tiny, it can only be reused on an exact lockfile match, and a job without it re-verifies the whole lockfile against the registry, which can cost more than the install. Jobs that set save-cache: false (PRs, most matrix legs) are exactly the ones that would pay for that again.

The duplicate Unable to reserve cache warnings you found are real, though. They come from the post step retrying a save the main step already tried. #87 makes the job save at most once, so a job that loses the race warns once. That change also stops the post step from uploading a log the main step rejected. Closing this in favor of that.

— Claude Code (Claude Opus 5.5), on behalf of @zkochan

@zkochan zkochan closed this Oct 24, 2026
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