Skip to content

Commit 6bb3c0f

Browse files
authored
[hud] Match viable/strict-blocking jobs on workflow name, not substring (#8439)
Stack from [ghstack](https://github.com/ezyang/ghstack/tree/0.15.0) (oldest at bottom): * __->__ #8439 isJobViableStrictBlocking used unanchored substring regexes, so "trunk" matched "trunk-tagging" / "trunk-rocm-sandbox" and mislabeled them as viable/strict blocking (shown even with "Hide non-viable-strict jobs"). Anchor patterns to the workflow-name segment to mirror the gate. Test: yarn jest test/jobClassifierUtil.test.ts
1 parent e3ac67a commit 6bb3c0f

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

torchci/lib/JobClassifierUtil.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ type RepoViableStrictBlockingJobsMap = {
99

1010
// Source of truth for these jobs is in https://github.com/pytorch/pytorch/blob/main/.github/workflows/update-viablestrict.yml#L26
1111
export const VIABLE_STRICT_BLOCKING_JOBS: RepoViableStrictBlockingJobsMap = {
12+
// Patterns match the workflow-name segment (before the first " / "), so
13+
// "trunk" does not match "trunk-tagging" / "trunk-rocm-sandbox". "(L4)" is a
14+
// config-token match, not a workflow name.
1215
"pytorch/pytorch": [
13-
/pull/i,
14-
/trunk/i,
15-
/lint/i,
16-
/linux-aarch64/i,
17-
/docs-build/i,
16+
/^pull($| \/)/i,
17+
/^trunk($| \/)/i,
18+
/^lint($| \/)/i,
19+
/^linux-aarch64($| \/)/i,
20+
/^docs-build($| \/)/i,
1821
/\(L4\)/,
1922
],
2023
};

torchci/test/jobClassifierUtil.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ describe("isJobViableStrictBlocking", () => {
5959
["Lint / lintrunner", true],
6060
["some-random-job", false],
6161
[", mem_leak check", false],
62+
// "trunk" must not match differently-named workflows that share the prefix.
63+
[
64+
"trunk-rocm-sandbox / linux-noble-rocm-py3.12-mi300 / test (default)",
65+
false,
66+
],
67+
["trunk-tagging / tag", false],
6268
])("pytorch/pytorch %j -> %s", (jobName, expected) => {
6369
expect(isJobViableStrictBlocking(jobName, "pytorch", "pytorch")).toBe(
6470
expected

0 commit comments

Comments
 (0)