feat(release)!: set updateDependents to always by default#33029
feat(release)!: set updateDependents to always by default#33029
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ 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 ca788fb
☁️ Nx Cloud last updated this comment at |
586bfb9 to
397a122
Compare
There was a problem hiding this comment.
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
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
397a122 to
ca788fb
Compare
|
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 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" } } }