-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(release): updateDependents generator option for versioning, support circular dependencies #23252
feat(release): updateDependents generator option for versioning, support circular dependencies #23252
Conversation
…endents when they are being updated
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 20ef78e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure this does not happen when the versioning is fixed
rather than independent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added e2e coverage for all the combinations of fixed
vs independent
:
3350b72
That additionally led me to discover that we did not previously allow cycles for publishing at all, so this PR now officially adds support for circular dependencies across versioning, changelog generation and publishing.
I have updated the PR title and description accordingly
@FrozenPandaz Please take another look when you get chance, I think this should be good to go |
@JamesHenry I've been following this bit of work and how much you've done for it, and wanted to say thank you and that I'm extremely grateful. This makes Nx feature complete for a few of our projects, without any other 3rd party plug-ins. |
@JamesHenry Also my thank you in advance for the effort. I am looking forward to this feature 🙏 Here's two quick questions for the MR, if I may:
|
Please open/use and existing discussion or issue to discuss any specific concerns around how groups relate to one another |
Also watching this MR as we need it to be able to release our repos which have cross release group dependencies graph TD
subgraph Todo Group
A[Todo App] --> B[Todo Lib]
end
subgraph Shared Group
B --> C[Shared Lib]
end
If I change a project in Shared Group then I would expect a bump in some or all of the Todo Group projects depending on if the projects are released independently or not. |
@jbadeau See my previous comment, this PR is not the place for a discussion around changing how groups relate to one another |
If any others have the same doubt that I had: it's the topological ordering of the projects that ensures that the first projects in the for loop don't have any dependencies, and then the |
This option doesn't seem to produce any change in behavior for me. This is a project where lerna previously was used and attempting to transition everything to nx. When I make a change to a library project, none of the other library projects are getting version bumped, just their dependency updated. I'm on 19.1.0-beta5, no global nx just project install. |
@rcolwell-cb I'm seeing the same result, and after stepping through the code, it looks like dependencies are only linked through the In our project, we're using @JamesHenry is my understanding correct? Is only the |
it's working for me now actually - still testing it with different scenarios of bumps. My nx wasn't updated after switching to beta so cleared some things and reinstalled... |
After testing it, there is definitely some weird logic I cannot understand. In some cases it's properly updating dependencies and package, but there are packages that get their dependencies updated but the package isn't getting updated. Example, I am updating a button. Package name "@org/button"... @org/date-picker gets the updated dependency version of @org/button, but its version IS NOT bumped/no changelog. Both these said packages also import these packages in code, in case the logic for the graph is formed from some intelligent process instead of package.json'. I want to be sure my config isn't missing anything before I create an issue for this |
Please kindly don’t comment on closed issues or PRs. Please open a fresh issue that is specific to your circumstances and provide steps to reproduce, feel free to tag me |
Current Behavior
When releasing projects independently, if a dependent project is untouched directly by the changes, it will not have its version updated and there is no way to opt into this behavior.
Additionally, circular dependencies between packages are not supported.
Expected Behavior
When releasing projects independently, if a dependent project is untouched directly by the changes, BY DEFAULT it will not have its version updated, BUT you can opt into it always being updated via a generator option (
release.version.generatorOptions.updateDependents = auto
and you can control what kind of semver bump should be applied to the otherwise unchanged dependent project. Transitive local dependents (A -> B -> C
) will also be updated in this scenario.Additionally, when opted into, such version only changes will appear in the changelog under a new
Updated Dependencies
section.Circular dependencies between packages are now supported for versioning, changelog generation and publishing.
Related Issue(s)
Fixes #22268