Skip to content

feat(release)!: set updateDependents to always by default#33029

Merged
Coly010 merged 2 commits intomasterfrom
release/switch-update-dependents-default
Oct 10, 2025
Merged

feat(release)!: set updateDependents to always by default#33029
Coly010 merged 2 commits intomasterfrom
release/switch-update-dependents-default

Conversation

@Coly010
Copy link
Copy Markdown
Contributor

@Coly010 Coly010 commented Oct 9, 2025

Current Behavior

When versioning independent projects in Nx release, the updateDependents configuration
defaults to 'auto'. This means that dependents are updated (with a patch version bump)
when a dependency is versioned, as long as a group or projects filter is not applied
that does not include them.

With 'auto', if you apply a filter that excludes dependents, they won't be updated even
though their dependencies have been versioned.

Expected Behavior

The updateDependents configuration now defaults to 'always'. This means that dependents
will always be updated (with a patch version bump) when a dependency is versioned,
even if they are not included in the group or projects filter.

This provides more predictable behavior and ensures that versioned dependencies don't
cause version mismatches with their dependents, which could lead to broken builds or
runtime issues.

BREAKING CHANGE: Users who relied on the previous 'auto' behavior can explicitly set updateDependents: 'auto' in their nx.json:

  {
    "release": {
      "version": {
        "updateDependents": "auto"
      }
    }
  }

@Coly010 Coly010 requested a review from a team as a code owner October 9, 2025 11:12
@Coly010 Coly010 self-assigned this Oct 9, 2025
@Coly010 Coly010 requested a review from FrozenPandaz October 9, 2025 11:12
@vercel
Copy link
Copy Markdown

vercel bot commented Oct 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Oct 10, 2025 0:04am

@netlify
Copy link
Copy Markdown

netlify bot commented Oct 9, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit ca788fb
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/68e8f39916ad3000084fc55f
😎 Deploy Preview https://deploy-preview-33029--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 Oct 9, 2025

View your CI Pipeline Execution ↗ for commit ca788fb

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 36m 54s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 2m 8s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 6s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 4s View ↗
nx documentation ✅ Succeeded 3m 11s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-10 12:37:06 UTC

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.

Nx Cloud is proposing a fix for your failed CI:

We've updated the test snapshots in the e2e release tests to reflect the new default behavior where updateDependents: 'always' causes dependents to be updated even when they're in different release groups. The tests now correctly expect 2 projects to be published when filtering by group2, since pkg2 (in group1) depends on pkg3 (in group2).

We verified this fix by re-running e2e-release:e2e-ci--src/independent-projects.test.ts, e2e-release:e2e-ci--src/independent-projects.workspaces.test.ts.

Suggested Fix changes
diff --git a/e2e/release/src/independent-projects.test.ts b/e2e/release/src/independent-projects.test.ts
index 2a11e3fa3c..05025d1782 100644
--- a/e2e/release/src/independent-projects.test.ts
+++ b/e2e/release/src/independent-projects.test.ts
@@ -830,11 +830,13 @@ describe('nx release - independent projects', () => {
 
       `);
 
-      // Should only contain the 1 project from group2
+      // Should contain the 1 project from group2 and its dependent from group1 (pkg2 depends on pkg3)
+      // With the new default updateDependents: 'always', dependents are updated even across groups
       expect(runCLI(`release publish -g group2 -d`)).toMatchInlineSnapshot(`
 
-          NX   Running target nx-release-publish for project {project-name}:
+          NX   Running target nx-release-publish for 2 projects:
 
+          - {project-name}
           - {project-name}
 
           With additional flags:
@@ -845,6 +847,28 @@ describe('nx release - independent projects', () => {
           > nx run {project-name}:nx-release-publish
 
 
+          📦  @proj/{project-name}@X.X.X-dry-run
+          === Tarball Contents ===
+
+          XXXB CHANGELOG.md
+          XXB  index.js
+          XXXB package.json
+          XXB  project.json
+          === Tarball Details ===
+          name:          @proj/{project-name}
+          version:       X.X.X-dry-run
+          filename:      proj-{project-name}-X.X.X-dry-run.tgz
+          package size: XXXB
+          unpacked size: XXXB
+          shasum:        {SHASUM}
+          integrity: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+          total files:   4
+
+          Would publish to ${e2eRegistryUrl} with tag "latest", but [dry-run] was set
+
+          > nx run {project-name}:nx-release-publish
+
+
           📦  @proj/{project-name}@X.X.X-dry-run
           === Tarball Contents ===
 
@@ -866,7 +890,7 @@ describe('nx release - independent projects', () => {
 
 
 
-          NX   Successfully ran target nx-release-publish for project {project-name}
+          NX   Successfully ran target nx-release-publish for 2 projects
 
 
 
diff --git a/e2e/release/src/independent-projects.workspaces.test.ts b/e2e/release/src/independent-projects.workspaces.test.ts
index e46a610335..8137184e4d 100644
--- a/e2e/release/src/independent-projects.workspaces.test.ts
+++ b/e2e/release/src/independent-projects.workspaces.test.ts
@@ -843,11 +843,13 @@ describe('nx release - independent projects', () => {
 
               `);
 
-      // Should only contain the 1 project from group2
+      // Should contain the 1 project from group2 and its dependent from group1 (pkg2 depends on pkg3)
+      // With the new default updateDependents: 'always', dependents are updated even across groups
       expect(runCLI(`release publish -g group2 -d`)).toMatchInlineSnapshot(`
 
-                  NX   Running target nx-release-publish for project {project-name}:
+                  NX   Running target nx-release-publish for 2 projects:
 
+                  - {project-name}
                   - {project-name}
 
                   With additional flags:
@@ -877,9 +879,31 @@ describe('nx release - independent projects', () => {
 
                   Would publish to ${e2eRegistryUrl} with tag "latest", but [dry-run] was set
 
+                  > nx run {project-name}:nx-release-publish
 
 
-                  NX   Successfully ran target nx-release-publish for project {project-name}
+                  📦  @proj/{project-name}@X.X.X-dry-run
+                  === Tarball Contents ===
+
+                  XXXB CHANGELOG.md
+                  XXB  index.js
+                  XXXB package.json
+                  XXB  project.json
+                  === Tarball Details ===
+                  name:          @proj/{project-name}
+                  version:       X.X.X-dry-run
+                  filename:      proj-{project-name}-X.X.X-dry-run.tgz
+                  package size: XXXB
+                  unpacked size: XXXB
+                  shasum:        {SHASUM}
+                  integrity: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+                  total files:   4
+
+                  Would publish to ${e2eRegistryUrl} with tag "latest", but [dry-run] was set
+
+
+
+                  NX   Successfully ran target nx-release-publish for 2 projects
 
 
 

Apply fix via Nx Cloud  Reject fix via Nx Cloud

Or Apply changes locally with:

npx nx-cloud apply-locally xqL4-9dEK

Apply fix locally with your editor ↗  View interactive diff ↗


🎓 To learn more about Self Healing CI, please visit nx.dev

@Coly010 Coly010 merged commit 6c024a2 into master Oct 10, 2025
19 checks passed
@Coly010 Coly010 deleted the release/switch-update-dependents-default branch October 10, 2025 13:11
@github-actions
Copy link
Copy Markdown
Contributor

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 Oct 16, 2025
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