Skip to content
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

Nx release in "projectRelationship": "independent" mode is not tagging and releasing projects that depend on projects that are getting published #22268

Open
1 of 4 tasks
brugi82 opened this issue Mar 11, 2024 · 4 comments · May be fixed by #23252

Comments

@brugi82
Copy link

brugi82 commented Mar 11, 2024

Current Behavior

nx release in "projectRelationship": "independent" mode is only tagging and releasing projects with changes. If there are projects that depend on these projects, they are not getting tagged and released.
For example, if we have 2 libraries, is-even and is-odd. is-odd has a dependency on package is-even that is correctly identified by dependency-checks eslint rule, and stated in it's package.json file. When changes are committed to package is-even and nx release is triggered, only that package is tagged for release. is-odd's package.json is getting updated, but the package is not getting released.

Our release configuration from nx.json:

  "release": {
    "version": {
      "conventionalCommits": true
    },
    "changelog": {
      "projectChangelogs": true
    },
    "projectsRelationship": "independent",
    "releaseTagPattern": "{projectName}-{version}"
  },
image image

Expected Behavior

We are expecting that with the changes made to the "root" package, release bubbles up to all packages that depend on that package too. In this concrete example, we are expecting that with the changes made to is-even package, nx release not only triggers and tags is-even package, but is-odd package too, as that one directly depends on is-even.

GitHub Repo

https://github.com/brugi82/nx-independent-monorepo

Steps to Reproduce

  1. Clone a repository
  2. Package is-odd depends on package is-even. is-even has one committed change that is not released.
  3. Execute nx release --skip-publish --dry-run --verbose
  4. Only package is-even is getting tagged & released.

Nx Report

nx                 : 18.0.7
@nx/js             : 18.0.7
@nx/linter         : 18.0.7
@nx/eslint         : 18.0.7
@nx/workspace      : 18.0.7
@nx/devkit         : 18.0.7
@nx/eslint-plugin  : 18.0.7
@nx/react          : 18.0.7
@nx/rollup         : 18.0.7
@nrwl/tao          : 18.0.7
@nx/vite           : 18.0.7
@nx/web            : 18.0.7
typescript         : 5.3.3

Failure Logs

No response

Package Manager Version

yarn 4.1.0

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

I am willing to submit a PR that solves this problem.

@ryan-mcginty-alation
Copy link

This is also something I just ran into, as an example jscutlery has a --trackDeps flag which enables one to opt in to this behavior. Is there some setting somewhere that we can opt in for nx release that we are missing?

brugi82 pushed a commit to brugi82/nx that referenced this issue Mar 25, 2024
Propagate release for all dependant packages that need updating when projectRelationship is "independent" .
Fixes nrwl#22268
@edbzn
Copy link
Contributor

edbzn commented Mar 30, 2024

Hey, we're facing the same issue in our repository where the package @jscutlery/swc-angular-preset has implicit dependency + peer dependency on @jscutlery/swc-plugin-angular, yet when we release the swc-angular-preset project it doesn't bump the swc-plugin-angular including the peer dependency update.

@fahslaj
Copy link
Contributor

fahslaj commented Apr 3, 2024

Hey @edbzn and @brugi82, Nx Release doesn't update the version of is-odd in this case because it is unclear what the version bump for is-odd should be. Yes, its dependency on is-even was updated, but since they are independently versioned, there is no context for if is-even should be a patch, minor, or major version bump. There could be a major version of is-even released that does not change the core functionality of is-odd, so is-odd wouldn't need a major version bump.

@JamesHenry
Copy link
Collaborator

The PR to address this is ready for review here: #22836

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment