feat(KB-093): add PR-first merge mode with configurable merge strategies

- Add mergeStrategy setting (fast-forward, squash, merge-commit) to config
- Implement PR-first auto-completion flow that monitors PR merge status
- Wire PR monitoring service to detect merge completion and trigger auto-close
- Add PR status UI to dashboard with merge progress indicator
- Update settings modal with merge strategy selector
- Add changeset for PR-first merge mode feature
This commit is contained in:
gsxdsm
2026-03-29 23:13:24 -07:00
parent 94f599a3df
commit fd9a1b186a
27 changed files with 1715 additions and 109 deletions

View File

@@ -4,7 +4,7 @@ import type { TaskStore } from "@kb/core";
const mockStore = {
addSteeringComment: vi.fn(),
createTask: vi.fn(),
createTask: vi.fn().mockResolvedValue({ id: "KB-123" }),
} as unknown as TaskStore;
describe("PrCommentHandler", () => {
@@ -176,6 +176,23 @@ describe("PrCommentHandler", () => {
"agent"
);
});
it("calls out follow-up context when feedback arrives after PR is merged", async () => {
await handler.handleNewComments("KB-001", { ...mockPrInfo, status: "merged" }, [
{
id: 1,
body: "Please add one more regression test",
user: { login: "reviewer" },
created_at: new Date().toISOString(),
updated_at: new Date().toISOString(),
html_url: "https://github.com/owner/repo/pull/42#issuecomment-1",
},
]);
const text = mockStore.addSteeringComment.mock.calls[0][1] as string;
expect(text).toContain("This PR is already merged");
expect(text).toContain("follow-up work");
});
});
describe("createFollowUpTask", () => {