Skip to content

Commit 10c307a

Browse files
authored
chore: accept backport PR with v3-backport branch prefix (#9284)
1 parent ca81237 commit 10c307a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tools/deployments/__tests__/check-v3-backport-status.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ describe("validateBackportPR", () => {
77
const consoleError = vi
88
.spyOn(console, "error")
99
.mockImplementation(() => {});
10-
const result = validateBackportPR("example/v3-maintenance-demo", () => {
10+
const result = validateBackportPR("example/v3-backport-demo", () => {
1111
throw new Error("Unexpected");
1212
});
1313

1414
expect(result).toBe(false);
1515
expect(consoleLog).not.toBeCalled();
1616
expect(consoleError).toBeCalledWith(
17-
`❌ Branch name "example/v3-maintenance-demo" does not match the expected pattern "v3-maintenance-<PR_NUMBER>"`
17+
`❌ Branch name "example/v3-backport-demo" does not match the expected pattern "v3-backport-<PR_NUMBER>"`
1818
);
1919
});
2020

@@ -24,7 +24,7 @@ describe("validateBackportPR", () => {
2424
.spyOn(console, "error")
2525
.mockImplementation(() => {});
2626
const isMergedMock = vi.fn(() => false);
27-
const result = validateBackportPR("v3-maintenance-13579", isMergedMock);
27+
const result = validateBackportPR("v3-backport-13579", isMergedMock);
2828

2929
expect(result).toBe(false);
3030
expect(isMergedMock).toBeCalledWith("13579");
@@ -35,7 +35,7 @@ describe("validateBackportPR", () => {
3535
it("should return true if the original PR is merged", () => {
3636
const consoleLog = vi.spyOn(console, "log").mockImplementation(() => {});
3737
const isMergedMock = vi.fn(() => true);
38-
const result = validateBackportPR("v3-maintenance-2468", isMergedMock);
38+
const result = validateBackportPR("v3-backport-2468", isMergedMock);
3939

4040
expect(result).toBe(true);
4141
expect(isMergedMock).toBeCalledWith("2468");

tools/deployments/check-v3-backport-status.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function validateBackportPR(
2222

2323
if (!prNumber) {
2424
console.error(
25-
`❌ Branch name "${branchName}" does not match the expected pattern "v3-maintenance-<PR_NUMBER>"`
25+
`❌ Branch name "${branchName}" does not match the expected pattern "v3-backport-<PR_NUMBER>"`
2626
);
2727
return false;
2828
}
@@ -44,7 +44,7 @@ export function validateBackportPR(
4444
}
4545

4646
export function extractPullRequestNumber(branchName: string): string | null {
47-
const match = branchName.match(/^v3-maintenance-(\d+)$/);
47+
const match = branchName.match(/^v3-(?:maintenance|backport)-(\d+)$/);
4848

4949
if (match && match[1]) {
5050
return match[1];

0 commit comments

Comments
 (0)