Skip to content

[rush] Fix the issue of accessing shouldEnsureConsistentVersions method incorrectly. #5063

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 1 commit into from
Jan 6, 2025

Conversation

fzxen
Copy link
Contributor

@fzxen fzxen commented Jan 3, 2025

Summary

Rush version command throws the following error where I had set ensureConsistentVersions to false in my rush repo.

ERROR: Unable to finish version bump because inconsistencies were encountered. Run "rush check" to find more details.

Details

shouldEnsureConsistentVersions is a function not a variable.

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;
}
}

Therefore, the condition expression here is always true.

if (!subspace.shouldEnsureConsistentVersions) {
return;
}

This issue is introduced by #4927

How it was tested

no-unnecessary-condition may help us permanently avoid this problem.

Impacted documentation

@fzxen fzxen changed the title 修复错误访问xx方法的问题 Fix the issue of accessing xx method incorrectly. Jan 3, 2025
@fzxen fzxen closed this Jan 3, 2025
@fzxen fzxen reopened this Jan 3, 2025
@fzxen fzxen changed the title Fix the issue of accessing xx method incorrectly. Fix the issue of accessing shouldEnsureConsistentVersions method incorrectly. Jan 3, 2025
@fzxen fzxen force-pushed the bugfix/no-unnecessary-condition branch from 702a0fe to b91676b Compare January 3, 2025 10:05
@fzxen fzxen marked this pull request as ready for review January 3, 2025 10:06
Copy link
Contributor

@dmichon-msft dmichon-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there.

@fzxen fzxen force-pushed the bugfix/no-unnecessary-condition branch from b91676b to 2136c6d Compare January 6, 2025 02:16
@dmichon-msft dmichon-msft merged commit 69b98be into microsoft:main Jan 6, 2025
5 checks passed
@octogonz
Copy link
Collaborator

@fzxen Thanks for fixing this!

@octogonz octogonz changed the title Fix the issue of accessing shouldEnsureConsistentVersions method incorrectly. [rush] Fix the issue of accessing shouldEnsureConsistentVersions method incorrectly. Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants