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

Add leading hyphen to canary identifier so that canaries always sort before any other release type #1851

Merged
merged 1 commit into from
Mar 3, 2021
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
2 changes: 1 addition & 1 deletion packages/core/src/__tests__/auto-canary-local.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test("shipit should publish canary in locally when not on baseBranch", async ()
expect(canary).toHaveBeenCalledWith(
expect.objectContaining({
bump: SEMVER.patch,
canaryIdentifier: "canary.abcdefg",
canaryIdentifier: "-canary.abcdefg",
})
);
});
6 changes: 3 additions & 3 deletions packages/core/src/__tests__/auto-in-pr-ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe("canary in ci", () => {
expect(canary).toHaveBeenCalledWith(
expect.objectContaining({
bump: SEMVER.patch,
canaryIdentifier: "canary.123.1",
canaryIdentifier: "-canary.123.1",
})
);
});
Expand Down Expand Up @@ -153,7 +153,7 @@ describe("canary in ci", () => {
);

const version = await auto.canary({ pr: 456, build: 5 });
expect(version!.newVersion).toBe("1.2.4-canary.456.5");
expect(version!.newVersion).toBe("1.2.4--canary.456.5");
});
});

Expand All @@ -177,7 +177,7 @@ describe("shipit in ci", () => {
expect(canary).toHaveBeenCalledWith(
expect.objectContaining({
bump: SEMVER.patch,
canaryIdentifier: "canary.123.1",
canaryIdentifier: "-canary.123.1",
})
);
});
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/__tests__/auto.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ describe("Auto", () => {
expect(canary).toHaveBeenCalledWith(
expect.objectContaining({
bump: SEMVER.patch,
canaryIdentifier: "canary.123.1",
canaryIdentifier: "-canary.123.1",
})
);
expect(auto.git!.addToPrBody).toHaveBeenCalled();
Expand All @@ -1197,7 +1197,7 @@ describe("Auto", () => {
expect(canary).toHaveBeenCalledWith(
expect.objectContaining({
bump: SEMVER.patch,
canaryIdentifier: "canary.abc",
canaryIdentifier: "-canary.abc",
})
);
});
Expand Down Expand Up @@ -1241,7 +1241,7 @@ describe("Auto", () => {
expect(canary).toHaveBeenCalledWith(
expect.objectContaining({
bump: SEMVER.patch,
canaryIdentifier: "canary.abcd",
canaryIdentifier: "-canary.abcd",
})
);
});
Expand Down Expand Up @@ -1290,7 +1290,7 @@ describe("Auto", () => {
expect(canary).toHaveBeenCalledWith(
expect.objectContaining({
bump: SEMVER.patch,
canaryIdentifier: "canary.abcd",
canaryIdentifier: "-canary.abcd",
})
);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/auto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ export default class Auto {
).slice(0, 7)}`;
}

canaryIdentifier = `canary${canaryIdentifier}`;
canaryIdentifier = `-canary${canaryIdentifier}`;

this.logger.verbose.info("Calling canary hook");
const result = await this.hooks.canary.promise({
Expand Down