Skip to content

test(cli): correct the stale frozen-gate comment in lockfile_only - #13085

Merged
zkochan merged 1 commit into
mainfrom
fix-lockfile-only-stale-frozen-gate-comment
Jul 16, 2026
Merged

zkochan merged 1 commit into
mainfrom
fix-lockfile-only-stale-frozen-gate-comment

Conversation

@zkochan

@zkochan zkochan commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Corrects a test comment that #13081 left stale, and that was already leading readers to the wrong conclusion.

The comment justifying --no-prefer-frozen-lockfile in lockfile_only_updates_importers_when_a_project_is_added said pacquet's auto-frozen freshness gate "only validates the root importer today". #13081 made check_lockfile_freshness loop over every project manifest, so that stopped being true.

The flag itself still has to stay, for a reason that only became true in that same change: project-2 declares no dependencies, and the auto-frozen gate now deliberately tolerates a missing importer entry for a dependency-free project (allow_missing_dependency_free_importers in install.rs, matching the TypeScript CLI's allProjectsAreUpToDate). Verified by removing the flag and running the test — it fails, with the re-read lockfile containing only packages/project-1: and no packages/project-2:, because the run short-circuits to the frozen path and never records the new importer.

This matters because the stale comment is actively misleading: #13028 (now closed as superseded by #13081) read it as leftover scaffolding and dropped the flag on that basis. Restating the comment against the real reason keeps the next reader from repeating that.

Test-only comment change — no changeset, no TypeScript counterpart.

Squash Commit Body

The comment justifying `--no-prefer-frozen-lockfile` in
`lockfile_only_updates_importers_when_a_project_is_added` claimed the auto-frozen
freshness gate validates only the root importer. That stopped being true in
pnpm/pnpm#13081, which made `check_lockfile_freshness` loop over every project
manifest.

The flag is still required, for a reason that only became true in that same
change: project-2 declares no dependencies, and the auto-frozen gate deliberately
tolerates a missing importer entry for a dependency-free project
(`allow_missing_dependency_free_importers`, matching the TypeScript CLI's
`allProjectsAreUpToDate`). Without the flag the run short-circuits to the frozen
path and never records the new importer, so the `packages/project-2:` assertion
fails.

Restate the comment against the actual reason so the next reader doesn't drop the
flag on the assumption it is leftover scaffolding.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Written by an agent (Claude Code, claude-opus-4-8).


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Documentation
    • Clarified test documentation explaining when a newly added dependency-free project requires a fresh lockfile resolution.
    • Documented the relationship between lockfile resolution behavior and the relevant command-line option.

The comment justifying `--no-prefer-frozen-lockfile` in
`lockfile_only_updates_importers_when_a_project_is_added` claimed the
auto-frozen freshness gate validates only the root importer. That stopped
being true in #13081, which made `check_lockfile_freshness` loop
over every project manifest.

The flag is still required, for a reason that only became true in that
same change: project-2 declares no dependencies, and the auto-frozen gate
deliberately tolerates a missing importer entry for a dependency-free
project (`allow_missing_dependency_free_importers`, matching the
TypeScript CLI's `allProjectsAreUpToDate`). Without the flag the run
short-circuits to the frozen path and never records the new importer, so
the `packages/project-2:` assertion fails.

Restate the comment against the actual reason so the next reader doesn't
drop the flag on the assumption it is leftover scaffolding.
Copilot AI review requested due to automatic review settings July 16, 2026 20:24

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix stale comment explaining --no-prefer-frozen-lockfile in lockfile_only test

🧪 Tests 📝 Documentation 🕐 Less than 5 minutes

Grey Divider

AI Description

• Correct misleading test comment about pacquet’s auto-frozen lockfile freshness gate.
• Document why --no-prefer-frozen-lockfile is still required for dependency-free project
 importers.
High-Level Assessment

The PR’s approach is optimal: update the test comment to reflect the current behavior and preserve the correct rationale for keeping --no-prefer-frozen-lockfile.

Files changed (1) +6 / -5

Tests (1) +6 / -5
lockfile_only.rsUpdate comment explaining why '--no-prefer-frozen-lockfile' is needed +6/-5

Update comment explaining why '--no-prefer-frozen-lockfile' is needed

• Rewrites the explanatory comment in 'lockfile_only_updates_importers_when_a_project_is_added' to reflect that dependency-free projects can have missing importer entries tolerated by the auto-frozen gate, so the flag is still required to force the fresh-resolve path and record the new importer.

pnpm/crates/cli/tests/lockfile_only.rs

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5dcf9b3d-d1ed-4542-aeb4-dcba9014c1c5

📥 Commits

Reviewing files that changed from the base of the PR and between 94bc420 and 31eb00e.

📒 Files selected for processing (1)
  • pnpm/crates/cli/tests/lockfile_only.rs

📝 Walkthrough

Walkthrough

The pull request revises an inline test comment to explain why --no-prefer-frozen-lockfile triggers unconditional re-resolution for newly added dependency-free sibling projects. No test behavior or assertions changed.

Changes

Lockfile-only test documentation

Layer / File(s) Summary
Clarify importer freshness behavior
pnpm/crates/cli/tests/lockfile_only.rs
Updates the comment in lockfile_only_updates_importers_when_a_project_is_added with the freshness-gating rationale and related allowance references.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested labels: product: pacquet

Suggested reviewers: copilot, stanzilla

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-lockfile-only-stale-frozen-gate-comment

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

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

@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

This is a comment-only change to a single test file with no runtime, behavioral, or lockfile-format implications.

The replacement comment accurately describes the allow_missing_dependency_free_importers path that makes the flag necessary, cross-references the TypeScript counterpart (allProjectsAreUpToDate), and removes the previously misleading claim about root-importer-only validation. No logic was altered.

No files require special attention.

Reviews (1): Last reviewed commit: "test(cli): correct the stale frozen-gate..." | Re-trigger Greptile

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Auto-approved notes - no code review findings
- 'auto_approve_for_no_suggestions' flag enabled

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Auto-approved notes - no code suggestions found
- 'approve_pr_on_self_review' flag enabled

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.14     14.3±1.84ms    26.2 MB/sec    1.00     12.6±1.03ms    29.8 MB/sec
packument/parse                1.01     41.9±2.05µs  1584.3 MB/sec    1.00     41.3±0.60µs  1605.0 MB/sec
tarball/download_dependency    1.03      2.8±0.40ms  1556.8 KB/sec    1.00      2.7±0.21ms  1599.5 KB/sec

@zkochan
zkochan merged commit 7ad35bf into main Jul 16, 2026
34 checks passed
@zkochan
zkochan deleted the fix-lockfile-only-stale-frozen-gate-comment branch July 16, 2026 20:32
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.59%. Comparing base (e4d7a4a) to head (31eb00e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13085   +/-   ##
=======================================
  Coverage   85.59%   85.59%           
=======================================
  Files         499      499           
  Lines       79945    79945           
=======================================
+ Hits        68431    68432    +1     
+ Misses      11514    11513    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants