-
Notifications
You must be signed in to change notification settings - Fork 607
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
[rush] rush version
bumps unchanged projects
#2385
Comments
This behavior was probably by design, but I'm thinking I agree with you and @octogonz that this may not make sense for devDependencies. However, I could see some projects wanting to be released if their The code that marks dependent projects as "changed" is here. Just removing the "bump my version if one of my devDependencies changed" functionality will be slightly complicated because we still need to make sure the version update is reflected when something other than @D4N14L has familiarity with this code. |
Yes, looking at this more closely, it is safest for But in many (most?) cases it is clearly wasteful.
The envisioned behavior would be to bump the package.json |
In order to improve this, we need to decide on the best design.
@iclanton you are right that whether to ignore
So we could propose a new Rush setting like Idea 1: Maybe we could introduce a project-specific setting that says "When you publish a new version of me, you do not need to publish bumps for other projects that list me as a dev-dependency." So you would configure Idea 2: Another idea would be for
|
Might another option be to build if a dev dependency has changed, and store a hash of all the package files that aren't npmignored in changelog.json? Then if the hash is identical to last time, no version bump.
|
🤔 My first thought was "that's too complicated." But the more I think about it... it's a damn good idea. |
@octogonz I wonder if it would also solve #2263 and #2279 - assuming it's ok to make |
@octogonz @iclanton curious if this idea was discussed any further. Another thought occurred to me, which was that the |
Seems like the discussion has progressed enough that someone could create a PR to test out this idea. We currently have 38 open PRs, so right now the maintainers should focus on getting them reviewed+merged. :-) |
hey, im running into this issue with a multi-version-policy project. |
in my case, running |
found the cause: I never ran a proper bump+publish against master in that repo and it was detecting changes as it was the "first" one. |
Hi, @isc30 Can you help me with the rush version bump. |
I don't think this situation only applies to Consider the following scenario: I have three packages, No version polices. When I add a new feature to |
I am still disturbing by this issue. My plugins are managed with the core package in a single rush workspace and they have a lot waste versions just because the |
Hey @ziofat , are you using a nextBump in the version policies or not? When no |
@isc30 No, I'm not using |
That's the reason, you need to use a |
But I'm using |
I think I've found 2 pieces of codes that related to this issue. The first one is: rushstack/libraries/rush-lib/src/logic/PublishUtilities.ts Lines 796 to 804 in 8250ce6
This is doubtable when updating The second one is: rushstack/libraries/rush-lib/src/logic/PublishUtilities.ts Lines 446 to 455 in 8250ce6
Do we really need to update the This is actually my situation. I have a We are not using git-flow so Back to the code, I'm not sure how to resolve this based on the code I've found. Maybe a new field in |
I agree that publishing all the downstream dependencies when the existing semver is still satisfied doesn't sound like the best solution for your use case, but when the version-policy doesn't have a Example, in a simplified situation using direct dependencies:
Now, when the When By definition, when no If you want to disable the unification of package versions, please add a dummy Why did we introduce a unified version for a package group? It's a very handy way of keeping lots of packages under control. Imagine you have a library that is split in hundreds of packages like TLDRIf you want to disable the unification of package versions, please add a dummy |
I've tried that. Actually the only difference is it does not update downstream dependencies' I'm aware how unified version works. In fact, |
Also, |
Ah sorry, I misunderstood your issue then, I thought you were using a The behavior you are experiencing is the "safe" approach for I can't speak for the owners of the repo but IMO it sounds good. We can try to optimize this case and prevent bumping patches if the updated dependencies still match the version selector, the change shouldn't be too big tbh. |
The original issue is about a My focus is mainly on |
Here again, another year. |
Summary
rush version
bumps unchanged packages, when one of theredevDependencies
changes. This happens even with"useWorkspaces": true
and the dependency is declared asworkspace:*
.Repro steps
This repo has a script which reliably reproduces the bug: https://github.com/mmkal/rush-learning
git clone https://github.com/mmkal/rush-learning
rush install
./change-and-version.sh
The repo is set up such that:
pkg-a
,pkg-b
andpkg-c
pkg-b
depends onpkg-a
as a devDependency.pkg-c
has no dependencies of any kind, just to make sure there isn't some bump-everything situation going onWhat
change-and-version.sh
does:rush change ...
rush version
commandIf you run the printed command after that you should see the bug
Expected result:
Only
pkg-a
has its version bumped.Actual result:
Both
pkg-a
andpkg-b
have their versions bumped.pkg-b
has a "Version update only" entry in its changelogDetails
Originally came from this zulip thread which was about
rush publish
. But it repros withrush version
without the added complication of setting up a verdaccio registry. Turned into an issue on @octogonz 's suggestion.Not sure, maybe when versioning,
workspace:*
is swapped for the "real" version?Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/rush
globally installed version?rushVersion
from rush.json?useWorkspaces
from rush.json?node -v
)?The text was updated successfully, but these errors were encountered: