nx icon indicating copy to clipboard operation
nx copied to clipboard

`nx release` command not working properly on windows

Open ErickRodrCodes opened this issue 1 year ago • 2 comments

Current Behavior

Following this tutorial on the documentation of nx release, I noted that the commit for the release totally stop to work:

Image

As a result, a botched release happens without any release, causing the git command to fail:

Image

digging more into the cause, it seems that message is not parsing properly the message into "quotes" here:

https://github.com/nrwl/nx/blob/db10812da789cd48d3a722628a00feda9d0e3810/packages/nx/src/command-line/release/utils/git.ts#L263

One solution is to parse the string properly for --message:

Image

by using JSON.stringify, we can parse properly the string being passed to --message... and pretty much it fixes the issue

Image

Expected Behavior

it would be advisable to review how --message contents are being parsed . Using JSON.parse ensures that the script being passed, has double quotes as --messages needs it.

GitHub Repo

No response

Steps to Reproduce

run in a windows machine nx release --skip-publish --first-release --verbose. It will potentially fail in Nx 20

Nx Report

NX Report complete - copy this into the issue template

Node : 20.17.0 OS : win32-x64 Native Target : x86_64-windows npm : 10.8.2

nx (global) : 20.0.0 nx : 20.0.0 @nx/js : 20.0.0 @nx/jest : 20.0.0 @nx/eslint : 20.0.0 @nx/workspace : 20.0.0 @nx/devkit : 20.0.0 @nx/esbuild : 20.0.0 @nx/eslint-plugin : 20.0.0 @nx/node : 20.0.0 typescript : 5.5.4

Registered Plugins: @nx/eslint/plugin @nx/jest/plugin

Failure Logs

No response

Package Manager Version

npm

Operating System

  • [ ] macOS
  • [ ] Linux
  • [x] Windows
  • [ ] Other (Please specify)

Additional Information

No response

ErickRodrCodes avatar Oct 10 '24 04:10 ErickRodrCodes

Hi @jaysoo let me know if we can connect and check this issue. Please feel free to DM me on Nx discord

ErickRodrCodes avatar Oct 17 '24 04:10 ErickRodrCodes

I'm not saying you are wrong @ErickRodrCodes but the screenshots provided don't appear to be clear evidence of what you are saying.

I don't see any screenshot which shows an issue with the message.

You are showing that the message value is a string, and when we trace it through it is ultimately given as part of an array of strings to spawn from node:child_process.

Using the terminal output as evidence doesn't apply, because when you print a string it doesn't print surrounding quotes, so it's not actually related to how the value is consumed by the code.

Additionally, in your error screenshot, what I see is err = 'Debugger attached not clear evidence of a particular error in the Nx code.

Please can you update your screenshots to demonstrate the actual error you are experiencing? And can you confirm if this historically worked for you and recently stopped working, or if it has never worked for you?

JamesHenry avatar Oct 17 '24 12:10 JamesHenry

Sure thing @JamesHenry , allow me to record a video instead.

ErickRodrCodes avatar Oct 22 '24 02:10 ErickRodrCodes

This issue has been automatically marked as stale because no reproduction was provided within 7 days. Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue. Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues. This issue will be closed in 21 days if a reproduction is not provided. If a reproduction has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] avatar Dec 17 '24 00:12 github-actions[bot]

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

github-actions[bot] avatar Feb 08 '25 00:02 github-actions[bot]