mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-09 16:02:36 +01:00
fix(ci): assess optional neutral checks without treating them as passes
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
8746f58ab3
commit
ec2c2dc2a6
3 files changed
+9
-5
No files matched your search
@@ -68,9 +68,10 @@ export function green(pr, requiredNames = minimumChecks) {
|
||||
const passed = (check) => check.__typename === "StatusContext"
|
||||
? check.state === "SUCCESS"
|
||||
: check.__typename === "CheckRun" && check.status === "COMPLETED" && check.conclusion === "SUCCESS";
|
||||
// A skipped routing lane is normal. A skipped required aggregate is not a pass.
|
||||
// Optional skipped/neutral checks can mean no work or unavailable coverage.
|
||||
// They permit assessment, not approval. Required checks must really succeed.
|
||||
return relevant.every((check) => passed(check) || (check.__typename === "CheckRun" &&
|
||||
check.status === "COMPLETED" && check.conclusion === "SKIPPED")) &&
|
||||
check.status === "COMPLETED" && ["SKIPPED", "NEUTRAL"].includes(check.conclusion))) &&
|
||||
[...new Set([...minimumChecks, ...requiredNames])].every((name) =>
|
||||
relevant.some((check) => (check.name ?? check.context) === name && passed(check)));
|
||||
}
|
||||
|
||||
@@ -66,6 +66,8 @@ test("waits for pending checks and statuses, permits skipped optional routing la
|
||||
}
|
||||
assert.equal(green(candidate({ statusCheckRollup: [...candidate().statusCheckRollup,
|
||||
check("not selected", "SKIPPED"), { __typename: "StatusContext", context: "security", state: "SUCCESS" }] })), true);
|
||||
assert.equal(green(candidate({ statusCheckRollup: [...candidate().statusCheckRollup,
|
||||
check("optional scanner coverage", "NEUTRAL")] })), true);
|
||||
});
|
||||
|
||||
test("excludes its own notification and profiling exporter, but not other workflows", () => {
|
||||
|
||||
Reference in new issue
Block a user