Skip to content

[rush] Fix ensureConsistentVersions in common-versions #5089

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Fix support for \"ensureConsistentVersions\" in common-versions.json when subspaces features is not enabled.",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
14 changes: 6 additions & 8 deletions libraries/rush-lib/src/api/Subspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,16 +326,14 @@ export class Subspace {
* @beta
*/
public shouldEnsureConsistentVersions(variant?: string): boolean {
// If the subspaces feature is enabled, or the ensureConsistentVersions field is defined, return the value of the field
if (this._rushConfiguration.subspacesFeatureEnabled) {
const commonVersions: CommonVersionsConfiguration = this.getCommonVersions(variant);
if (commonVersions.ensureConsistentVersions !== undefined) {
return commonVersions.ensureConsistentVersions;
}
// If the ensureConsistentVersions field is defined, return the value of the field
const commonVersions: CommonVersionsConfiguration = this.getCommonVersions(variant);
if (commonVersions.ensureConsistentVersions !== undefined) {
return commonVersions.ensureConsistentVersions;
}

// Fallback to ensureConsistentVersions in rush.json if subspaces is not enabled,
// or if the setting is not defined in the common-versions.json file
// Fallback to ensureConsistentVersions in rush.json if the setting is not defined in
// the common-versions.json file
return this._rushConfiguration.ensureConsistentVersions;
}

Expand Down
Loading