Skip to content

Commit 919359a

Browse files
atalmanpytorchbot
andauthored
Fix HUD grouped view showing all-grey cells for domain repos (#8276)
## Summary The **grouped** view of the HUD renders every group cell **grey** (`AllNull`, the `~` symbol) for non-`pytorch/pytorch` repos — e.g. https://hud.pytorch.org/hud/pytorch/vision/main and `pytorch/executorch`. The ungrouped view and `pytorch/pytorch` grouped view are unaffected. ## Root cause `HudGroupedCell` computes a group's status from `effectiveJobs`. When the **"Hide non-viable/strict blocking"** preference is on (it **defaults to `true`**), `effectiveJobs = jobs.filter((job) => isJobViableStrictBlocking(...))`. `VIABLE_STRICT_BLOCKING_JOBS` is only defined for `pytorch/pytorch`, so `isJobViableStrictBlocking` returns `false` for **every** job in any other repo → `effectiveJobs` becomes empty. The status computation then hits: ```ts } else if (noStatusJobs.length === effectiveJobs.length) { // 0 === 0 → true conclusion = GroupedJobStatus.AllNull; // → grey "~" } ``` so every grouped cell is grey regardless of the real job conclusions. The **column-visibility** use of this preference is already guarded with `isPyTorchPyTorchRepo` (`pages/hud/.../[[...page]].tsx`), but the **cell-status** use in `GroupJobConclusion.tsx` was not — that asymmetry is the bug. (The preference checkbox is also disabled off `pytorch/pytorch`, so users can't work around it.) ## Fix Guard the cell-level filter the same way as the column-level filter, so it's a no-op off `pytorch/pytorch`: ```ts const isPyTorchPyTorchRepo = repoOwner === "pytorch" && repoName === "pytorch"; const effectiveJobs = hideNonViableStrict && isPyTorchPyTorchRepo ? jobs.filter((job) => isJobViableStrictBlocking(job.name, repoOwner, repoName)) : jobs; ``` This restores green/red grouped cells for `vision`, `executorch`, `audio`, etc., and leaves `pytorch/pytorch` behavior unchanged. ## Test plan - Added `isJobViableStrictBlocking` unit tests: `pytorch/pytorch` job-name matches (pull/trunk/lint/…, plus mem_leak exclusion) and domain-repo always-`false` behavior that this fix relies on. Expected values verified against the matching logic. - Manual: on `hud/pytorch/vision/main` in grouped view, cells now show green/red instead of all-grey; `pytorch/pytorch` grouped view unchanged. AI assistance (Claude) was used for this change. Co-authored-by: pytorchbot <soumith+bot@pytorch.org>
1 parent 2447c8b commit 919359a

2 files changed

Lines changed: 48 additions & 6 deletions

File tree

torchci/components/job/GroupJobConclusion.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,22 @@ export default function HudGroupedCell({
165165
// When hiding non-viable-strict, restrict the group's status calculation
166166
// (and tooltip contents) to viable/strict-blocking jobs only — otherwise a
167167
// non-viable-strict failure would still light up a kept group column.
168-
const effectiveJobs = hideNonViableStrict
169-
? jobs.filter((job) =>
170-
isJobViableStrictBlocking(job.name, repoOwner, repoName)
171-
)
172-
: jobs;
168+
//
169+
// The viable/strict-blocking concept only exists for pytorch/pytorch, so this
170+
// filter must be ignored for every other repo. Without this guard, on a
171+
// domain repo (e.g. pytorch/vision, pytorch/executorch) the filter removes
172+
// *every* job from the group, `effectiveJobs` becomes empty, and the status
173+
// computation below falls into `noStatusJobs.length === effectiveJobs.length`
174+
// (0 === 0) => AllNull => every grouped cell renders grey. This mirrors the
175+
// column-visibility guard in the HUD page (`isPyTorchPyTorchRepo`).
176+
const isPyTorchPyTorchRepo =
177+
repoOwner === "pytorch" && repoName === "pytorch";
178+
const effectiveJobs =
179+
hideNonViableStrict && isPyTorchPyTorchRepo
180+
? jobs.filter((job) =>
181+
isJobViableStrictBlocking(job.name, repoOwner, repoName)
182+
)
183+
: jobs;
173184

174185
// Check if this group contains autorevert signals
175186
const isAutorevertSignal = rowData

torchci/test/jobClassifierUtil.test.ts

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { getNameWithoutOSDC } from "../lib/JobClassifierUtil";
1+
import {
2+
getNameWithoutOSDC,
3+
isJobViableStrictBlocking,
4+
} from "../lib/JobClassifierUtil";
25

36
describe("getNameWithoutOSDC", () => {
47
test.each([
@@ -47,3 +50,31 @@ describe("getNameWithoutOSDC", () => {
4750
expect(getNameWithoutOSDC(input)).toBe(expected);
4851
});
4952
});
53+
54+
describe("isJobViableStrictBlocking", () => {
55+
// pytorch/pytorch defines viable/strict-blocking job patterns.
56+
test.each([
57+
["pull / linux-jammy-py3.9-gcc11 / test", true],
58+
["trunk / macos-py3-arm64 / build", true],
59+
["Lint / lintrunner", true],
60+
["some-random-job", false],
61+
[", mem_leak check", false],
62+
])("pytorch/pytorch %j -> %s", (jobName, expected) => {
63+
expect(isJobViableStrictBlocking(jobName, "pytorch", "pytorch")).toBe(
64+
expected
65+
);
66+
});
67+
68+
// Domain repos have no viable/strict-blocking definitions, so every job must
69+
// be reported as non-blocking. Regression guard for the HUD grouped-view bug
70+
// where applying this filter on a domain repo emptied every group and turned
71+
// all grouped cells grey (AllNull).
72+
test.each([
73+
["pytorch", "vision", "pull / linux / test"],
74+
["pytorch", "vision", "Build Linux Wheels"],
75+
["pytorch", "executorch", "trunk / lint"],
76+
["pytorch", "audio", "unit-test / linux"],
77+
])("%s/%s job %j -> false", (repoOwner, repoName, jobName) => {
78+
expect(isJobViableStrictBlocking(jobName, repoOwner, repoName)).toBe(false);
79+
});
80+
});

0 commit comments

Comments
 (0)