Skip to content

Commit

Permalink
Merge pull request #1851 from intuit/leading-hyphen
Browse files Browse the repository at this point in the history
Add leading hyphen to canary identifier so that canaries always sort before any other release type
  • Loading branch information
hipstersmoothie committed Mar 3, 2021
2 parents 9136b03 + ce9197f commit 7427c39
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/__tests__/auto-canary-local.test.ts
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
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
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
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

0 comments on commit 7427c39

Please sign in to comment.