Skip to content

Commit 8e7041b

Browse files
authored
HUD: respect Hide non-viable-strict in grouped view (#8116)
## Summary - When both **Use grouped view** and **Hide non-viable-strict jobs** were enabled, non-viable-strict failures still lit up grouped columns. The page-level filter kept any group containing at least one viable/strict-blocking job, but `HudGroupedCell` aggregated status across *every* job in the group, so a non-viable-strict failure would still color the cell red. - Fix: inside `HudGroupedCell`, when the preference is on, filter the group's jobs down to viable/strict-blocking ones before computing the conclusion, autorevert flag, and tooltip contents. ## Test plan - [x] In HUD with both "Use grouped view" and "Hide non-viable-strict jobs" enabled, verify groups whose only failing jobs are non-viable-strict no longer show as failures. - [x] Confirm tooltips on those grouped cells only list viable/strict-blocking jobs. - [x] Toggling off "Hide non-viable-strict jobs" restores prior behavior (all jobs feed the group status).
1 parent 966ee7a commit 8e7041b

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

torchci/components/job/GroupJobConclusion.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
isUnstableJob,
1515
} from "lib/jobUtils";
1616
import { IssueData, JobData, RowData } from "lib/types";
17+
import { useHideNonViableStrictPreference } from "lib/useGroupingPreference";
1718
import {
1819
MonsterFailuresContext,
1920
PinnedTooltipContext,
@@ -159,10 +160,20 @@ export default function HudGroupedCell({
159160
}) {
160161
const [pinnedId, setPinnedId] = useContext(PinnedTooltipContext);
161162
const [monsterFailures] = useContext(MonsterFailuresContext);
163+
const [hideNonViableStrict] = useHideNonViableStrictPreference();
164+
165+
// When hiding non-viable-strict, restrict the group's status calculation
166+
// (and tooltip contents) to viable/strict-blocking jobs only — otherwise a
167+
// 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;
162173

163174
// Check if this group contains autorevert signals
164175
const isAutorevertSignal = rowData
165-
? isGroupAutorevertSignal(jobs, rowData)
176+
? isGroupAutorevertSignal(effectiveJobs, rowData)
166177
: false;
167178

168179
// Build cell style classes
@@ -183,7 +194,7 @@ export default function HudGroupedCell({
183194
const failedPreviousRunJobs = [];
184195

185196
let viableStrictBlocking = false;
186-
for (const job of jobs) {
197+
for (const job of effectiveJobs) {
187198
if (isFailedJob(job)) {
188199
if (
189200
isRerunDisabledTestsJob(job) ||
@@ -219,7 +230,7 @@ export default function HudGroupedCell({
219230
conclusion = GroupedJobStatus.WarningOnly;
220231
} else if (!(queuedJobs.length === 0)) {
221232
conclusion = GroupedJobStatus.Queued;
222-
} else if (noStatusJobs.length === jobs.length) {
233+
} else if (noStatusJobs.length === effectiveJobs.length) {
223234
conclusion = GroupedJobStatus.AllNull;
224235
}
225236

0 commit comments

Comments
 (0)