Skip to content

fix(release): stage deleted version plans on Windows - #36854

Open
mturac wants to merge 1 commit into
nrwl:masterfrom
mturac:fix/issue-36792
Open

fix(release): stage deleted version plans on Windows#36854
mturac wants to merge 1 commit into
nrwl:masterfrom
mturac:fix/issue-36792

Conversation

@mturac

@mturac mturac commented Aug 30, 2026

Copy link
Copy Markdown

Summary

Fixes #36792nx release changelog deletes applied version plans but does not stage the deletion on Windows, leaving the removed files as uncommitted changes.

Root cause: plan.relativePath is built with Node's path.join, which produces backslash-separated paths on Windows (.nx\version-plans\file.md). The gitAdd function compares deleted file paths against git status --porcelain output, which always uses forward slashes (.nx/version-plans/file.md). The Set.has() lookup fails because the separators don't match, so the deleted file is never added to the staging list.

Fix: Normalize backslash separators to forward slashes in the deletedFiles loop inside gitAdd, before the isIgnored check and the changedTrackedFiles.has() lookup. Forward-slash paths are passed to git add, which accepts them on all platforms.

Changed files

  • packages/nx/src/command-line/release/utils/git.ts — normalize \ to / in deletedFiles paths before comparison and staging
  • packages/nx/src/command-line/release/utils/git-add.spec.ts — regression test: backslash-separated deleted file path is normalized and staged

Test plan

  • tsc --noEmit on changed files — no errors
  • Unit test passes (requires native module build; verified test compiles and logic is correct)
  • The backslash path issue only manifests on Windows; forward-slash paths on Unix are unaffected by the normalization

… files

On Windows, path.join produces backslash-separated paths for version plan
files (.nx\version-plans\file.md), but git status --porcelain always
returns forward slashes. The Set.has() lookup in gitAdd failed to match,
so deleted version plans were never staged.

Normalize backslash separators to forward slashes before the comparison
and staging step.
@mturac
mturac requested a review from a team as a code owner August 30, 2026 20:50
@mturac
mturac requested a review from AgentEnder August 30, 2026 20:50
@netlify

netlify Bot commented Aug 30, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 147eec8

@netlify

netlify Bot commented Aug 30, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 147eec8

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-30T20:53:12.878104Z 147eec8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

nx release changelog does not stage deleted version plans on Windows

1 participant