Skip to content

fix(repo): reset package.json files after local release#34648

Merged
FrozenPandaz merged 2 commits intomasterfrom
fix/nx-release-reset-package-jsons
Feb 27, 2026
Merged

fix(repo): reset package.json files after local release#34648
FrozenPandaz merged 2 commits intomasterfrom
fix/nx-release-reset-package-jsons

Conversation

@FrozenPandaz
Copy link
Copy Markdown
Collaborator

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

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.
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 27, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 9c31b04
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69a1d518ab4524000842d863
😎 Deploy Preview https://deploy-preview-34648--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud bot commented Feb 27, 2026

View your CI Pipeline Execution ↗ for commit 9c31b04

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 34m 15s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3m 25s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 8s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-27 18:10:54 UTC

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 27, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 9c31b04
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69a1d5186b2d2e0008cf739a
😎 Deploy Preview https://deploy-preview-34648--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@FrozenPandaz FrozenPandaz enabled auto-merge (squash) February 27, 2026 14:15
Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗

🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.


🎓 Learn more about Self-Healing CI on nx.dev

@FrozenPandaz FrozenPandaz merged commit eb49886 into master Feb 27, 2026
24 checks passed
@FrozenPandaz FrozenPandaz deleted the fix/nx-release-reset-package-jsons branch February 27, 2026 18:11
FrozenPandaz added a commit that referenced this pull request Mar 4, 2026
## 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)
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants