diff --git a/torchci/components/GroupJobConclusion.tsx b/torchci/components/GroupJobConclusion.tsx index fa58ece874..932f62a545 100644 --- a/torchci/components/GroupJobConclusion.tsx +++ b/torchci/components/GroupJobConclusion.tsx @@ -34,6 +34,37 @@ export enum GroupedJobStatus { Pending = "pending", } +type RepoViableStrictBlockingJobsMap = { + [key: string]: RegExp[]; +}; + +// TODO: Move this to a config file +const VIABLE_STRICT_BLOCKING_JOBS: RepoViableStrictBlockingJobsMap = { + // Source of truth for these jobs is in https://github.com/pytorch/pytorch/blob/main/.github/workflows/update-viablestrict.yml#L26 + "pytorch/pytorch": [/trunk/i, /pull/i, /linux-binary/i, /lint/i], +}; + +function isJobViableStrictBlocking( + jobName: string | undefined, + repoOwner: string, + repoName: string +): boolean { + if (!jobName) { + return false; + } + + const repo = `${repoOwner}/${repoName}`; + let viablestrict_blocking_jobs_patterns = + VIABLE_STRICT_BLOCKING_JOBS[repo] ?? []; + + for (const regex of viablestrict_blocking_jobs_patterns) { + if (jobName.match(regex)) { + return true; + } + } + return false; +} + export default function HudGroupedCell({ sha, groupName, @@ -42,6 +73,8 @@ export default function HudGroupedCell({ toggleExpanded, isClassified, unstableIssues, + repoOwner, + repoName, }: { sha: string; groupName: string; @@ -50,6 +83,8 @@ export default function HudGroupedCell({ toggleExpanded: () => void; isClassified: boolean; unstableIssues: IssueData[]; + repoOwner: string; + repoName: string; }) { const [pinnedId, setPinnedId] = useContext(PinnedTooltipContext); const style = pinnedId.name == groupName ? hudStyles.highlight : ""; @@ -60,12 +95,17 @@ export default function HudGroupedCell({ const pendingJobs = []; const noStatusJobs = []; const failedPreviousRunJobs = []; + + let viableStrictBlocking = false; for (const job of jobs) { if (isFailedJob(job)) { if (isRerunDisabledTestsJob(job) || isUnstableJob(job, unstableIssues)) { warningOnlyJobs.push(job); } else { erroredJobs.push(job); + if (isJobViableStrictBlocking(job.name, repoOwner, repoName)) { + viableStrictBlocking = true; + } } } else if (job.conclusion === JobStatus.Pending) { pendingJobs.push(job); @@ -113,7 +153,11 @@ export default function HudGroupedCell({ /> } > - + {getGroupConclusionChar(conclusion)} diff --git a/torchci/components/JobConclusion.module.css b/torchci/components/JobConclusion.module.css index 80bfe420ce..f021de54b0 100644 --- a/torchci/components/JobConclusion.module.css +++ b/torchci/components/JobConclusion.module.css @@ -62,3 +62,8 @@ .warning { color: #f8b88b; } + +.viablestrict_blocking { + border-left: 1px solid red; + border-right: 1px solid red; +} diff --git a/torchci/pages/hud/[repoOwner]/[repoName]/[branch]/[[...page]].tsx b/torchci/pages/hud/[repoOwner]/[repoName]/[branch]/[[...page]].tsx index ef77db0337..cb9571355d 100644 --- a/torchci/pages/hud/[repoOwner]/[repoName]/[branch]/[[...page]].tsx +++ b/torchci/pages/hud/[repoOwner]/[repoName]/[branch]/[[...page]].tsx @@ -176,6 +176,7 @@ function HudRow({ rowData={rowData} names={names} unstableIssues={unstableIssues} + params={params} /> ); @@ -185,10 +186,12 @@ function HudJobCells({ rowData, names, unstableIssues, + params, }: { rowData: RowData; names: string[]; unstableIssues: IssueData[]; + params: HudParams; }) { let groupNames = groups.map((group) => group.name).concat("other"); const { expandedGroups, setExpandedGroups, groupNameMapping } = @@ -214,6 +217,8 @@ function HudJobCells({ sha={rowData.sha} key={name} groupName={name} + repoOwner={params.repoOwner} + repoName={params.repoName} jobs={ groupNameMapping .get(name)