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", () => {
|
||||
|
||||
@@ -36,9 +36,10 @@ When adding another PR verification workflow, add its name to `workflow_run`.
|
||||
|
||||
The notifier reads the current PR's status rollup and branch rules. Both
|
||||
`ci / verify` and `ci / e2e`, plus any additional required checks, must succeed.
|
||||
Other checks must succeed or be explicitly skipped. A neutral result is not a
|
||||
pass. Skipped optional routing lanes do not imply that their tests ran. The
|
||||
advisory routine evaluates actual coverage and reviews before recommending merge.
|
||||
Other checks must succeed or finish as skipped or neutral. Optional skipped or
|
||||
neutral checks permit an assessment; they do not prove successful verification.
|
||||
For example, a neutral scanner can mean coverage is unavailable. The advisory
|
||||
routine evaluates these evidence gaps and reviews before recommending merge.
|
||||
The notification workflow itself and the optional CI profile exporter are
|
||||
excluded from verification checks to avoid feedback loops.
|
||||
|
||||
|
||||
Reference in new issue
Block a user