Skip to content

test: fix change/version integration tests broken by registry-storage changelog default - #12977

Merged
zkochan merged 1 commit into
mainfrom
fix/change-tests-registry-default
Jul 13, 2026
Merged

zkochan merged 1 commit into
mainfrom
fix/change-tests-registry-default

Conversation

@zkochan

@zkochan zkochan commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Problem

Rust CI / Test / ubuntu is red on main — two tests in pnpm/crates/cli/tests/change.rs panic:

change_records_an_intent_and_version_applies_the_release_plan ... FAILED
lanes_are_entered_released_and_graduated ... FAILED
  panicked at change.rs:89 / :156: read changelog: No such file or directory

Both fail at fs::read_to_string(packages/<pkg>/CHANGELOG.md).expect("read changelog") — the file no longer exists after pnpm version -r.

Cause

#12971 (compose changelogs at publish time (registry storage)) made changelog.storage: registry the default: pnpm version -r no longer commits a CHANGELOG.md, it parks each release's section under .changeset/changelogs/ for publish-time composition. These integration tests (added in #12953) still assert committed CHANGELOG.md files, so they broke when #12971 landed. #12971 updated the versioning unit tests (adding a repository() settings helper with the note "the existing changelog assertions predate the registry-storage default, so they opt back into committed CHANGELOG.md files") but the CLI integration tests were missed.

Fix

Give the integration tests the same treatment: their workspace opts into versioning.changelog.storage: repository, so pnpm version -r writes the changelogs inline the way the assertions expect. This also matches the TypeScript reference test (releasing/commands/test/change/index.test.ts), which asserts committed CHANGELOG.md with default opts.

Test-only change; no changeset. Verified locally — all 7 tests in change.rs pass (the run also confirms pnpm lane's workspace-yaml edits preserve the sibling changelog.storage key).

🤖 Generated with Claude Code


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

Summary by CodeRabbit

  • Tests
    • Updated integration test workspace configuration to align changelog storage behavior with recursive versioning.
    • Ensured tests correctly validate committed CHANGELOG.md contents.

…storage

`compose changelogs at publish time (registry storage)` (#12971) made
`changelog.storage: registry` the default, so `pnpm version -r` no longer writes
a committed CHANGELOG.md — it parks each release's section under
`.changeset/changelogs/` for publish-time composition. The `change` command
integration tests (added in #12953) still assert committed CHANGELOG.md files,
so they broke on `main`. #12971 gave the versioning unit tests the same
treatment (a `repository()` settings helper); this does the equivalent for the
CLI integration tests by opting their workspace into `repository` storage.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 13, 2026 16:31

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.

@greptile-apps greptile-apps Bot 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.

zkochan has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 70f898c0-16bf-4759-a011-069d8172445f

📥 Commits

Reviewing files that changed from the base of the PR and between c03b2d4 and 653bf8c.

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

📝 Walkthrough

Walkthrough

The workspace test helper now configures changelog storage as repository so pnpm version -r integration tests assert against committed CHANGELOG.md content.

Changes

Workspace changelog configuration

Layer / File(s) Summary
Configure workspace fixture
pnpm/crates/cli/tests/change.rs
write_workspace now writes versioning.changelog.storage: repository to pnpm-workspace.yaml.

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

Possibly related PRs

  • pnpm/pnpm#12949: Refactors workspace versioning configuration for unified release flows.

Suggested labels: product: pacquet

Suggested reviewers: copilot

✨ 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/change-tests-registry-default

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix change/version CLI integration tests for registry changelog default

🧪 Tests 🕐 Less than 10 minutes

Grey Divider

AI Description

• Opt the change/version CLI integration test workspace into repository changelog storage.
• Restore expected committed CHANGELOG.md output when running pnpm version -r.
• Prevent regressions from the new default publish-time (registry) changelog composition.
Diagram

graph TD
  T["change.rs tests"] --> W["pnpm-workspace.yaml"] --> V["pnpm version -r"] --> S{"changelog storage"}
  S --> C["CHANGELOG.md"]
  S --> R[".changeset/changelogs/"]
  T --> C
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Update assertions to follow registry-storage default
  • ➕ Tests would validate the new default behavior directly
  • ➕ Avoids forcing a non-default configuration in test fixtures
  • ➖ Requires changing assertions to read/combine entries under .changeset/changelogs/
  • ➖ More moving parts and more brittle to internal composition format changes
2. Compose publish-time changelog in the test harness
  • ➕ Keeps default config while still asserting the final composed changelog output
  • ➕ Closer to end-to-end publish behavior
  • ➖ Adds non-trivial test harness logic and potentially slows tests
  • ➖ Couples tests to composition implementation details

Recommendation: Opting the integration test workspace into repository storage is the best pragmatic fix: it restores the original intent of these tests (asserting committed CHANGELOG.md output) with minimal surface area and aligns with the precedent used in the versioning unit tests. The alternatives provide broader coverage of registry-storage behavior but would materially increase test complexity for limited benefit in this suite.

Files changed (1) +10 / -2

Tests (1) +10 / -2
change.rsWrite workspace config to force repository changelog storage +10/-2

Write workspace config to force repository changelog storage

• Updates the test helper that writes pnpm-workspace.yaml to include versioning.changelog.storage: repository. This makes pnpm version -r generate committed CHANGELOG.md files so the existing integration test assertions no longer fail under the new registry-storage default.

pnpm/crates/cli/tests/change.rs

@zkochan
zkochan merged commit 4124f48 into main Jul 13, 2026
25 of 27 checks passed
@zkochan
zkochan deleted the fix/change-tests-registry-default branch July 13, 2026 16:31
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 18 rules

Grey Divider


Remediation recommended

1. Historical comment in write_workspace 📘 Rule violation ⚙ Maintainability
Description
The new comment explains prior behavior using historical phrasing (e.g., “predate the
registry-storage default”), which violates the rule to document only current behavior in source
comments. This can quickly become stale and misleading as defaults evolve again.
Code

pnpm/crates/cli/tests/change.rs[R14-18]

+    // These tests assert committed CHANGELOG.md files, which predate the
+    // `registry`-storage default (where a release's section is parked under
+    // `.changeset/changelogs/` and composed at publish time instead). Opt back
+    // into `repository` storage so `pnpm version -r` writes the changelogs
+    // inline, the way the assertions below expect.
Evidence
Rule 772199 disallows comments that reference historical behavior (e.g., “used to”, “previously”,
“predate”). The added comment explicitly says the tests “predate the registry-storage default”,
which is a historical reference rather than a description of the current contract/intent.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/cli/tests/change.rs[14-18]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A newly added comment uses historical/temporal phrasing (e.g., “predate the `registry`-storage default”) instead of describing current behavior and intent.

## Issue Context
Per the checklist, comments must describe current behavior and rationale without referencing historical implementations.

## Fix Focus Areas
- pnpm/crates/cli/tests/change.rs[14-18]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

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).

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Use raw string for YAML

Use a raw string literal instead of manual \n escapes for the YAML string.

pnpm/crates/cli/tests/change.rs [19-23]

     fs::write(
         workspace.join("pnpm-workspace.yaml"),
-        "packages:\n  - packages/*\nversioning:\n  changelog:\n    storage: repository\n",
+        r#"packages:
+  - packages/*
+versioning:
+  changelog:
+    storage: repository
+"#,
     )
     .expect("write pnpm-workspace.yaml");
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: Using a raw string literal for multi-line content improves code readability by avoiding explicit newline escapes.

Low
  • More

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.47%. Comparing base (d3e1383) to head (653bf8c).
⚠️ Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12977      +/-   ##
==========================================
+ Coverage   85.26%   85.47%   +0.20%     
==========================================
  Files         486      496      +10     
  Lines       77280    79166    +1886     
==========================================
+ Hits        65890    67664    +1774     
- Misses      11390    11502     +112     

☔ 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.

@github-actions

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.00     24.5±0.56ms    15.3 MB/sec    1.05     25.7±0.41ms    14.6 MB/sec
packument/parse                1.00     79.9±1.40µs   830.2 MB/sec    1.00     80.1±0.74µs   828.5 MB/sec
tarball/download_dependency    1.03      7.0±0.39ms   622.1 KB/sec    1.00      6.8±0.13ms   641.4 KB/sec

kairosci added a commit to kairosci/pnpm that referenced this pull request Jul 13, 2026
- fix(graph-hasher): normalize GVS slot paths to prevent mixed
  separators on Windows (os error 267)
- fix(test): opt change/version integration tests into repository
  changelog storage (matching pnpm#12977 for Rust tests)
- fix(test): stabilize verifyLockfileResolutionsCache stat shortcut
  test by touching mtime after file replacement
kairosci added a commit to kairosci/pnpm that referenced this pull request Jul 25, 2026
- fix(graph-hasher): normalize GVS slot paths to prevent mixed
  separators on Windows (os error 267)
- fix(test): opt change/version integration tests into repository
  changelog storage (matching pnpm#12977 for Rust tests)
- fix(test): stabilize verifyLockfileResolutionsCache stat shortcut
  test by touching mtime after file replacement
kairosci added a commit to kairosci/pnpm that referenced this pull request Jul 26, 2026
- fix(graph-hasher): normalize GVS slot paths to prevent mixed
  separators on Windows (os error 267)
- fix(test): opt change/version integration tests into repository
  changelog storage (matching pnpm#12977 for Rust tests)
- fix(test): stabilize verifyLockfileResolutionsCache stat shortcut
  test by touching mtime after file replacement
kairosci added a commit to kairosci/pnpm that referenced this pull request Aug 4, 2026
- fix(graph-hasher): normalize GVS slot paths to prevent mixed
  separators on Windows (os error 267)
- fix(test): opt change/version integration tests into repository
  changelog storage (matching pnpm#12977 for Rust tests)
- fix(test): stabilize verifyLockfileResolutionsCache stat shortcut
  test by touching mtime after file replacement
kairosci added a commit to kairosci/pnpm that referenced this pull request Aug 5, 2026
- fix(graph-hasher): normalize GVS slot paths to prevent mixed
  separators on Windows (os error 267)
- fix(test): opt change/version integration tests into repository
  changelog storage (matching pnpm#12977 for Rust tests)
- fix(test): stabilize verifyLockfileResolutionsCache stat shortcut
  test by touching mtime after file replacement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants