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

[rush] ensureConsistentVersions is not working #5103

Open
elliot-nelson opened this issue Feb 11, 2025 · 0 comments
Open

[rush] ensureConsistentVersions is not working #5103

elliot-nelson opened this issue Feb 11, 2025 · 0 comments

Comments

@elliot-nelson
Copy link
Collaborator

elliot-nelson commented Feb 11, 2025

Summary

My expectation is that if ensureConsistentVersions is turned on, then rush check should never fail if rush install succeeds. Conversely, rush install should never fail if rush check does not fail. At some point, this expectation stopped being true.

Repro steps

In common-versions.json, add the following:

  "ensureConsistentVersions": true,
  "allowedAlternativeVersions": {
    "@firebolt-js/sdk": ["1.0.0"]
  }
}

Then in two packages (A and B), add the following dependencies: @firebolt-js/sdk@^0.8.1 (for Package A) and @firebolt-js/[email protected] (for Package B).

Now, run rush update. The command succeeds successfully, even though I expect it to fail, because the versions are not consistent, and neither of them are in the list of allowed alternative versions.

Then, run rush check. I expect this to succeed, because it should never fail if rush update succeeds, but it does fail, printing out the two versions of the dependency.

Details

I'm not sure when this changed, but as-is it's a big problem, because rush check is part of the rush publish pipeline, so the end result is you merge seemingly valid PRs to main, then your publishing job fails when you try to publish packages.

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version? 5.141.3
rushVersion from rush.json? 5.141.3
useWorkspaces from rush.json? true
Operating system? Mac
Would you consider contributing a PR? Maybe
Node.js version (node -v)? 20.18.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs triage
Development

No branches or pull requests

1 participant