From 815fbea7329f73eee7ad62afd314c20b0ff6182d Mon Sep 17 00:00:00 2001 From: Saffron Worker Date: Tue, 16 Jun 2026 09:59:47 -0600 Subject: [PATCH 1/2] test(pr-followup): add PrFixType assertions to ingestion tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add type field assertions to verify that each ingest function populates the correct PrFixType: - ingestCommentEvent → REVIEW_FEEDBACK - ingestReviewEvent → REVIEW_FEEDBACK - ingestCheckRunEvent → CI_FAILURE - ingestMergeStateEvent(DIRTY) → MERGE_CONFLICT - ingestMergeStateEvent(BEHIND) → OTHER This closes the test gap identified in #365. --- src/lib/pr-followup-ingestion.test.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/lib/pr-followup-ingestion.test.ts b/src/lib/pr-followup-ingestion.test.ts index 7bb5974..29b29b1 100644 --- a/src/lib/pr-followup-ingestion.test.ts +++ b/src/lib/pr-followup-ingestion.test.ts @@ -167,6 +167,7 @@ describe("ingestCommentEvent", () => { expect(client.items).toHaveLength(1); expect(client.items[0].lane).toBe("NORMAL"); + expect(client.items[0].type).toBe("REVIEW_FEEDBACK"); expect(client.items[0].reason).toContain("actionable feedback"); }); @@ -187,6 +188,7 @@ describe("ingestCommentEvent", () => { expect(client.items).toHaveLength(1); expect(client.items[0].lane).toBe("NEEDS_HUMAN"); + expect(client.items[0].type).toBe("REVIEW_FEEDBACK"); expect(client.items[0].status).toBe("BLOCKED"); }); @@ -233,6 +235,7 @@ describe("ingestReviewEvent", () => { expect(client.items).toHaveLength(1); expect(client.items[0].lane).toBe("NORMAL"); + expect(client.items[0].type).toBe("REVIEW_FEEDBACK"); }); it("skips APPROVED reviews", async () => { @@ -342,6 +345,7 @@ describe("ingestCheckRunEvent", () => { expect(client.items).toHaveLength(1); expect(client.items[0].lane).toBe("NORMAL"); + expect(client.items[0].type).toBe("CI_FAILURE"); }); it("enqueues cancelled/timed_out checks", async () => { @@ -361,6 +365,7 @@ describe("ingestCheckRunEvent", () => { }); expect(client.items).toHaveLength(1); + expect(client.items[0].type).toBe("CI_FAILURE"); }); it("skips passing checks", async () => { @@ -405,6 +410,7 @@ describe("ingestMergeStateEvent", () => { expect(client.items).toHaveLength(1); expect(client.items[0].lane).toBe("NORMAL"); + expect(client.items[0].type).toBe("OTHER"); }); it("skips clean merge state", async () => { @@ -463,6 +469,25 @@ describe("ingestMergeStateEvent", () => { expect(client.items).toHaveLength(0); }); + it("populates MERGE_CONFLICT type for DIRTY merge state", async () => { + process.env.PR_FOLLOWUP_BOT_IDENTITIES = "itsmiso-ai"; + const client = makeClient(); + + await ingestMergeStateEvent(client, { + repoFullName: "misospace/dispatch", + prNumber: 42, + branch: "fix/test", + url: "https://github.com/misospace/dispatch/pull/42", + title: "Fix test issue", + author: "itsmiso-ai", + mergeStateStatus: "dirty", + }); + + expect(client.items).toHaveLength(1); + expect(client.items[0].type).toBe("MERGE_CONFLICT"); + }); + + afterEach(() => { delete process.env.PR_FOLLOWUP_BOT_IDENTITIES; }); From b3245c6cbd3071958da1fbc64ecc02dd0f21ec8b Mon Sep 17 00:00:00 2001 From: its-saffron Date: Tue, 16 Jun 2026 10:12:39 -0600 Subject: [PATCH 2/2] docs(pr-followup): clarify PrFixType implementation is on main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The implementation fix (passing correct type to enqueuePrFixItem) was already merged to main before this branch was cut. This PR adds test assertions verifying the existing correct behavior: - ingestCommentEvent → REVIEW_FEEDBACK - ingestReviewEvent → REVIEW_FEEDBACK - ingestCheckRunEvent → CI_FAILURE - ingestMergeStateEvent(DIRTY) → MERGE_CONFLICT - ingestMergeStateEvent(BEHIND) → OTHER Addresses reviewer concern about missing implementation changes.