fix(repo): reset package.json files after local release#34648
fix(repo): reset package.json files after local release#34648FrozenPandaz merged 2 commits intomasterfrom
Conversation
The local release path (--local false, non-CI) was not resetting the package.json files for angular-rspack, dotnet, and maven after nx release version modified them. This left unstaged changes behind. Extracts a shared resetPackageJsons() function, wraps the release steps in try/finally, and adds a SIGINT handler so files are restored even on error or ctrl+C.
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 9c31b04
☁️ Nx Cloud last updated this comment at |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud has identified a possible root cause for your failed CI:
We've classified this e2e test timeout as an environmental state issue rather than a code regression. The PR modifies the release script (scripts/nx-release.ts) which has no execution path that would affect Vite builds or e2e test infrastructure, and the build hangs silently without error messages after successfully completing dependency builds—characteristic of resource exhaustion or environmental conflicts rather than code-level bugs.
No code changes were suggested for this issue.
Trigger a rerun:
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
🎓 Learn more about Self-Healing CI on nx.dev
## Current Behavior When running `pnpm nx-release --local false`, the `nx release version` step modifies `package.json` files for `angular-rspack`, `angular-rspack-compiler`, `dotnet`, and `maven` (bumping versions and resolving `workspace:*` protocols). The local release path (`--local false`, non-CI) exits early before reaching the reset logic that the CI path uses, leaving unstaged changes behind. ## Expected Behavior After the release script completes (or is interrupted), the source `package.json` files should be restored to their original state. The version bumps are only needed in `dist/` for publishing — the source files should stay at `0.0.1` with `workspace:*` protocols. This PR: - Extracts a shared `resetPackageJsons()` function used by both the local and CI code paths - Wraps the local release steps in `try/finally` so files are restored even on errors - Adds a `SIGINT` handler so files are restored on ctrl+C (cherry picked from commit eb49886)
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
When running
pnpm nx-release --local false, thenx release versionstep modifiespackage.jsonfiles forangular-rspack,angular-rspack-compiler,dotnet, andmaven(bumping versions and resolvingworkspace:*protocols). The local release path (--local false, non-CI) exits early before reaching the reset logic that the CI path uses, leaving unstaged changes behind.Expected Behavior
After the release script completes (or is interrupted), the source
package.jsonfiles should be restored to their original state. The version bumps are only needed indist/for publishing — the source files should stay at0.0.1withworkspace:*protocols.This PR:
resetPackageJsons()function used by both the local and CI code pathstry/finallyso files are restored even on errorsSIGINThandler so files are restored on ctrl+C