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

fix(bump): Fix detection of version scheme for test builds #12758

Merged
merged 14 commits into from
Nov 2, 2022
Merged
4 changes: 4 additions & 0 deletions build-tools/packages/build-cli/src/commands/bump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,13 @@ export default class BumpCommand extends BaseCommand<typeof BumpCommand.flags> {
bumpArg = bumpType;
}

// Update the scheme based on the new version, unless it was passed in explicitly
scheme = flags.scheme ?? detectVersionScheme(newVersion);

this.logHr();
this.log(`Release group: ${chalk.blueBright(args.package_or_release_group)}`);
this.log(`Bump type: ${chalk.blue(bumpType ?? "exact")}`);
this.log(`Scheme: ${chalk.cyan(scheme)}`);
this.log(`Versions: ${newVersion} <== ${repoVersion}`);
this.log(`Install: ${shouldInstall ? chalk.green("yes") : "no"}`);
this.log(`Commit: ${shouldCommit ? chalk.green("yes") : "no"}`);
Expand Down
6 changes: 6 additions & 0 deletions build-tools/packages/version-tools/src/test/schemes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ describe("detectVersionScheme", () => {
assert.strictEqual(detectVersionScheme(input), expected);
});

it("detects 0.0.0-105091-test is semver", () => {
const input = `0.0.0-105091-test`;
const expected = "semver";
assert.strictEqual(detectVersionScheme(input), expected);
});

Comment on lines +93 to +98
Copy link
Member Author

Choose a reason for hiding this comment

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

This test passes as expected with no code change. The bug was in the command logic.

it("detects 2.4.3 is semver", () => {
const input = `2.4.3`;
const expected = "semver";
Expand Down