Repository navigation
projectsAffectedByDependencyUpdates "auto": removing a dependency marks every project affected #37529
Adi1231234
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
With
"projectsAffectedByDependencyUpdates": "auto", removing a dependency from one project marks every project in the workspace as affected. Changing the version of the same dependency only marks the project that uses it.I don't think this is a bug.
changedExternalNodesinlock-file-changes.tsfalls back to all projects when a changed package has no external node in the head graph, a removed package can never have one, andlock-file-changes.spec.tstests exactly that ("should return all projects when all changed packages are removed"). So I'm posting it here rather than as an issue.Small repro, nx 23.3.0 + pnpm 12.14.0, two projects:
Commit that, then on a branch:
is-numberfroma,pnpm install, commit:nx show projects --affected --base=maingives["a","b"]6.0.0instead,pnpm install, commit:["a"]bnever depended onis-number.Where it bites us: deploys run from
nx affected -t deploy. Swapping a dev tool for its renamed successor took the old package name out of the lockfile, and every service got redeployed, including ones whose resolved dependencies were identical before and after.Could the removed package be looked up in the base revision instead of the head graph?
getChangedPackageNamesalready parses the base lockfile, and the base importers (pnpm) or workspace entries (npm, bun) say which projects reached it. From what I can see the common cases are covered even without that: a project that depended on it directly has a changed package.json, and a transitive removal comes with its parent changing version, which the head graph does have.All reactions