-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Cross-release-group dependency leads to error: Version data key "project-name" already exists in version data
#26444
Comments
I can confirm, that I currently stumble into the same issue with the following versions of ❯ nx report
NX Report complete - copy this into the issue template
Node : 20.13.1
OS : darwin-arm64
pnpm : 9.4.0
nx (global) : 19.3.1
nx : 19.3.2
@nx/js : 19.3.2
@nx/eslint : 19.3.2
@nx/devkit : 19.3.2
@nx/node : 19.3.2
---------------------------------------
Community plugins:
@nx-tools/nx-container : 6.0.1 My group setup looks like this: Running |
Any news here? I'm still able to reproduce this with the latest version of NX Report complete - copy this into the issue template
Node : 20.18.1
OS : darwin-arm64
Native Target : aarch64-macos
pnpm : 8.15.1
nx : 20.1.4
@nx/js : 20.1.4
@nx/jest : 20.1.4
@nx/eslint : 20.1.4
@nx/workspace : 20.1.4
@nx/devkit : 20.1.4
@nx/node : 20.1.4
typescript : 5.5.2 |
We're also interested in a fix for this. |
I could address this question within a live session on YT a couple of weeks ago (https://www.youtube.com/live/tui0sTvfi64?si=2Ap2kXVyp0nYDqjc&t=8463) - basically @JamesHenry said that there is currently a bigger refactoring / rewriting going on which will solve this issue. TL;DR;
|
We're also unable to publish some of our packages due to this bug with Effected versions from |
I’ve finally been able to revisit this and will have an opt-in new implementation of versioning available ASAP |
I'm pleased to say that this is resolved in the rewritten implementation of versioning: #30418 |
Current Behavior
Hi folks!
Reporting as suggested in the error message:
I am exploring the new functionality that updates dependents: #23252, to see if it covers other cases apart from releasing projects independently. I have two groups: one (G1) with common libs, and another (G2) with other components that use the common libs. G1 now includes the option
updateDependents
set toauto
, so it bumps the versions of its dependencies (which live in G2).When running
nx release version
, G1 is first versioned, and then the versionResult object for G1 contains already versions for projects in G2. Therefore, when G2 is versioned,appendVersionData
crashes, as it does not expect projects in G2 to already have a version.This sketch in a comment in #23252 shows my setup. I will replicate it here for clarity:
Expected Behavior
When a project from release group
G2
depends on a project fromG1
, the version calculator should take it into consideration, and bump whatever is highest, among:a. The "indirect" bump due to the dependency to
G2
(by the way: it was mentioned in #23252 that "you can control what kind of semver bump should be applied" - how can this be configured? I could only find a comment that says that the bump is of type patch)b. The potential bump in
G2
if there have been changesSome examples to illustrate the expected behavior (assuming conventional commits):
G1
, I'd expect that projects inG2
are bumped. Moreover, I'd expect that ifG2
does not release independently, that even other projects inG2
that do not depend onG1
(such asapp2
) get the same bump.G1
andG2
, and where there is afeat!
commit forG2
, I'd expect that projects inG2
are bumped with a major increase.G2
are bumped with a minor increase (becauseminor = max(minor, patch)
), ifminor
andG1
andG2
, with afix
commit inG2
G2
releasing independently, then I'd expect that the logic above applies to the projects that depend oncommon-lib
(app1
,internal-lib
), but other projects such asapp2
should only be bumped according to the changes made to it and the commit messages (not considering "indirect" bumps, since there is no relationship toG1
).common-but-unused
and whereG1
is released independently, I'd expect a version bump to be made only tocommon-but-unused
common-but-unused
ORcommon-lib
, and whereG2
is released all together, I'd expect a version bump to be made toG1
, but also to the projects ofG2
that depend oncommon-lib
(and potentially allG2
, if it is also released together)GitHub Repo
No response
Steps to Reproduce
nx.json
looks like thisnpx nx release version --dry-run --verbose
Nx Report
Failure Logs
Package Manager Version
8.10.0
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: