Nx Release - Affected Logic #33463
Replies: 4 comments
-
|
Hi @marc-wilson I experienced the same issue with releasing independent applications via @nx/docker plugin. Recent changes to the plugin seems introduced some regression issues.
I opened #33288 with a few fixes that should resolve this issue. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @AndriiTsok. Looking forward to testing out your fix. But, I don't think this is specific to docker. I may not be 100% clear on how release groups work but what if I had other releasable (non-docker) things like libs? Wouldn't it be the same issue? Is the intent with release groups to build things together and release them group-by-group? ie: (probably the wrong syntax) or, should I am expecting that |
Beta Was this translation helpful? Give feedback.
-
|
Nx Release behaves somewhat differently to Nx as a task runner. Release Groups are used to configure which projects should be released together. Meaning that running You have options available to finetune your release process acutely to your needs. Finally, Release Groups offer a "groupPreVersionCommand": "nx run-many -t build -p project-a,project-b"Alternatively, something that we do on one of our repos is to have the CI workflow set an ENV var that we use in the |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @Coly010 for the detailed explanation — this helps clarify the intent behind That said, I think this still highlights a fundamental DX and conceptual gap between Nx’s “affected” model (which is central to its value) and how On
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Current Behavior
In a multi-app monorepo,
nx release(version/publish) appears to assume all releaseable projects were built, which conflicts with Nx’s “affected” workflow. This effectively forces a choice between usingaffectedor usingrelease.Example CI (simplified)
On every PR, we only build affected apps/targets (great!).
But
nx release publishthen tries to publish everything in the release group, implicitly assuming every project has its artifact ready (e.g., container images), which breaks the affected pattern.Expected behavior
nx releaseto respect the affected graph, orversion/publishcan target only affected projects (or a provided subset) without custom scripting.Examples:
Or even a native
--affectedflag fornx release version/publish.Actual behavior
nx release publishconsiders all projects in the release group (or repo), which assumes non-affected projects were also built and are ready to publish.Why this matters
Nx positions “affected” as a core productivity/value driver. When release requires publishing everything, pipelines either:
nx releaseto filter projects (more complexity).This breaks one of Nx’s biggest selling points—incremental builds and deploys.
Minimal reproduction (conceptual)
docker:buildand a release group).publishattempts to release all projects, not just the affected/built ones.The docker example uses
run-manywhich isn't a good idea because my repo is quite large.There's this one which doesn't build anything at all. so not really a realistic example
Expected Behavior
nx releaseshould not try and publish things that aren't affected or provide some--affectedflag.GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions