Skip to content

Commit

Permalink
[BE] Add flaky failure highlighting to hud
Browse files Browse the repository at this point in the history
Summary: As part of #5229
  • Loading branch information
PaliC committed Jun 12, 2024
1 parent 99ae427 commit fd86e71
Show file tree
Hide file tree
Showing 6 changed files with 6,876 additions and 6,956 deletions.
4 changes: 4 additions & 0 deletions torchci/components/hud.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@
background-color: #ffe0b3;
}

.forcedMergeWithInfraFailures {
background-color: #B9E4BF;
}

.selectedRow {
background-color: lightblue;
font-weight: bold;
Expand Down
15 changes: 15 additions & 0 deletions torchci/lib/fetchHud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { isFailure } from "./JobClassifierUtil";
import { isRerunDisabledTestsJob, isUnstableJob } from "./jobUtils";
import fetchIssuesByLabel from "lib/fetchIssuesByLabel";

const FLAKY_TEST_THRESHOLD = 10;

export default async function fetchHud(params: HudParams): Promise<{
shaGrid: RowData[];
jobNames: string[];
Expand Down Expand Up @@ -87,6 +89,17 @@ export default async function fetchHud(params: HudParams): Promise<{
)
);

const forcedMergedWithInfraFailuresShas = new Set(
_.map(
_.filter(filterForcedMergePr.results, (r) => {
return r.force_merge_with_infra_failures !== 0 && r.flaky_checks_count > FLAKY_TEST_THRESHOLD;
}),
(r) => {
return r.merge_commit_sha;
}
)
);

const commitsBySha = _.keyBy(commits, "sha");
let results = hudQuery.results;

Expand All @@ -100,6 +113,7 @@ export default async function fetchHud(params: HudParams): Promise<{
);
}


const namesSet: Set<string> = new Set();
// Built a list of all the distinct job names.
results?.forEach((job: JobData) => {
Expand Down Expand Up @@ -160,6 +174,7 @@ export default async function fetchHud(params: HudParams): Promise<{
jobs: jobs,
isForcedMerge: forcedMergeShas.has(commit.sha),
isForcedMergeWithFailures: forcedMergeWithFailuresShas.has(commit.sha),
isForceMergeWithInfraFailures: forcedMergedWithInfraFailuresShas.has(commit.sha),
};
shaGrid.push(row);
});
Expand Down
1 change: 1 addition & 0 deletions torchci/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export interface RowData extends CommitData {
groupedJobs?: Map<string, GroupData>;
isForcedMerge: boolean | false;
isForcedMergeWithFailures: boolean | false;
isForceMergeWithInfraFailures: boolean | false;
nameToJobs?: Map<string, JobData>;
}

Expand Down
16 changes: 10 additions & 6 deletions torchci/pages/hud/[repoOwner]/[repoName]/[branch]/[[...page]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ function HudRow({
<td className={styles.jobMetadata}>
{rowData.prNum !== null && (
<a
href={`https://github.com/${params.repoOwner}/${params.repoName}/pull/${rowData.prNum}`}
title={
href={`https://github.com/${params.repoOwner}/${params.repoName}/pull/${rowData.prNum}`}
title={
rowData.isForcedMerge
? rowData.isForcedMergeWithFailures
? rowData.isForceMergeWithInfraFailures
? "Forced merge with infrastructure failures"
: rowData.isForcedMergeWithFailures
? "Forced merge with failures that were merge-blocking"
: "Forced merge. Had no merge-blocking failures"
: undefined
Expand All @@ -140,9 +142,11 @@ function HudRow({
{rowData.isForcedMerge ? (
<mark
className={
rowData.isForcedMergeWithFailures
? styles.forcedMergeWithFailure
: styles.forcedMerge
rowData.isForceMergeWithInfraFailures
? styles.forcedMergeWithInfraFailures
: rowData.isForcedMergeWithFailures
? styles.forcedMergeWithFailure
: styles.forcedMerge
}
>
#{rowData.prNum}
Expand Down
2 changes: 1 addition & 1 deletion torchci/rockset/prodVersions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"commit_jobs_query": "10d4a302d49906bb",
"disabled_non_flaky_tests": "f909abf9eec15b56",
"commit_failed_jobs": "f64429abcebf36b8",
"filter_forced_merge_pr": "a28350c863e36239",
"filter_forced_merge_pr": "8ff1c1f56f1ad029",
"flaky_tests": "eb7ed21e7f1a6d09",
"flaky_tests_across_jobs": "474e5454bda0c5bb",
"get_relevant_alerts": "727014a49bef2c20",
Expand Down
Loading

0 comments on commit fd86e71

Please sign in to comment.