Skip to content

Commit d86adea

Browse files
committed
fix(ci): keep sufficient proof on label churn
1 parent 955edd9 commit d86adea

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

scripts/github/barnacle-auto-response.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,10 +801,13 @@ function shouldRemoveProofSufficientLabel(context, proofEvaluation, hasExactHead
801801
if (proofEvaluation.status === "override") {
802802
return false;
803803
}
804+
if (!["edited", "synchronize"].includes(context.payload.action)) {
805+
return false;
806+
}
804807
if (proofEvaluation.status !== "passed") {
805808
return true;
806809
}
807-
return ["edited", "synchronize"].includes(context.payload.action);
810+
return true;
808811
}
809812

810813
async function applyPullRequestCandidateLabels(github, context, core, pullRequest, labelSet) {

test/scripts/barnacle-auto-response.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,24 @@ describe("barnacle-auto-response", () => {
872872
expect(calls.removeLabel).toEqual([]);
873873
});
874874

875+
it("preserves sufficient proof on unrelated label events even without body proof", async () => {
876+
const { calls, github } = barnacleGithub([file("src/gateway/server.ts")]);
877+
878+
await runBarnacleAutoResponse({
879+
github,
880+
context: barnacleContext({}, [PROOF_SUFFICIENT_LABEL], {
881+
action: "labeled",
882+
label: { name: "status: ready for maintainer look" },
883+
sender: { login: "openclaw-clawsweeper[bot]", type: "Bot" },
884+
}),
885+
core: {
886+
info: () => undefined,
887+
},
888+
});
889+
890+
expect(calls.removeLabel).toEqual([]);
891+
});
892+
875893
it("does not let Barnacle veto ClawSweeper's sufficient proof label add", async () => {
876894
const { calls, github } = barnacleGithub([file("src/gateway/server.ts")]);
877895

0 commit comments

Comments
 (0)