fix(check): isolate updates by check suite

Same-named checks from different suites must not edit one message.
Include the suite or app identity and retain the former key for
controlled adoption of existing tracked messages.
This commit is contained in:
翅膀 committed 2026-10-23 23:22:04 +08:00
1 parent a95feefaf8
commit 76380ff1c0
3 files changed
+37 -2

No files matched your search

+20 -1
View File
@@ -317,6 +317,7 @@ describe("message title spec", () => {
head_sha: "abc123def456",
status: "in_progress",
conclusion: null,
check_suite: { id: 7 },
},
repository: repo,
sender,
@@ -331,13 +332,31 @@ describe("message title spec", () => {
head_sha: "abc123def456",
status: "completed",
conclusion: "failure",
check_suite: { id: 7 },
},
repository: repo,
sender,
}),
);
expect(running.updateKey).toBe("check_run:acme/widget:Cloudflare Pages:abc123def456");
expect(running.updateKey).toBe("check_run:acme/widget:7:Cloudflare Pages:abc123def456");
expect(failed.updateKey).toBe(running.updateKey);
// A same-named check of another suite (workflow / app) has its own message.
const other = formatEvent(
route,
event("check_run", {
check_run: {
id: 44,
name: "Cloudflare Pages",
head_sha: "abc123def456",
status: "completed",
conclusion: "success",
check_suite: { id: 8 },
},
repository: repo,
sender,
}),
);
expect(other.updateKey).not.toBe(running.updateKey);
});
it("check_suite shows conclusion, service, branch and commit", () => {