Skip to content

Commit 84f4130

Browse files
author
meorphis
committed
do not compute diffs if either side fatal errors
1 parent 2d7c8cd commit 84f4130

6 files changed

Lines changed: 100 additions & 73 deletions

File tree

dist/build.js

Lines changed: 16 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/internalPreview.js

Lines changed: 28 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/merge.js

Lines changed: 16 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/preview.js

Lines changed: 16 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/internalPreview.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { tmpdir } from "os";
88
import { join } from "path";
99
import {
1010
type Outcomes,
11+
conclusions,
1112
FailRunOn,
1213
getDiffLanguages,
1314
shouldFailRun,
@@ -297,6 +298,16 @@ async function main() {
297298
for (const [lang, head] of Object.entries(state.outcomes)) {
298299
const base = state.baseOutcomes[lang];
299300

301+
if (
302+
(head.commit?.conclusion &&
303+
conclusions.fatal.includes(head.commit?.conclusion)) ||
304+
(base.commit?.conclusion &&
305+
conclusions.fatal.includes(base.commit?.conclusion))
306+
) {
307+
// diff is indeterminate if either build failed fatally
308+
continue;
309+
}
310+
300311
if (head.commit?.conclusion === "merge_conflict") {
301312
// Don't determine diff until base has also concluded so its
302313
// codegen branch is in its final state before we compare.

src/outcomes.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,19 @@ export function shouldFailRun({
9191
return true;
9292
}
9393

94+
export const conclusions = {
95+
fatal: [
96+
"fatal",
97+
"payment_required",
98+
"timed_out",
99+
"upstream_merge_conflict",
100+
"version_bump",
101+
],
102+
conflict: ["merge_conflict"],
103+
diagnostic: ["error", "warning", "note"],
104+
success: ["success", "noop", "cancelled"],
105+
};
106+
94107
export function categorizeOutcome({
95108
outcome,
96109
baseOutcome,
@@ -141,19 +154,6 @@ export function categorizeOutcome({
141154
: outcome.diagnostics,
142155
);
143156

144-
const conclusions = {
145-
fatal: [
146-
"fatal",
147-
"payment_required",
148-
"timed_out",
149-
"upstream_merge_conflict",
150-
"version_bump",
151-
],
152-
conflict: ["merge_conflict"],
153-
diagnostic: ["error", "warning", "note"],
154-
success: ["success", "noop", "cancelled"],
155-
};
156-
157157
const checks = getNewChecks(headChecks, baseChecks);
158158
const checkFailures = CheckType.filter(
159159
(checkType) =>

0 commit comments

Comments
 (0)