feat(FN-4116): fix github tracking issue creation

Fixes GitHub CLI issue creation by repairing the `gh issue create` call in the dashboard and adds logging for tracking failures, with tests covering both the core GitHub module and the tracking layer.

Fusion-Task-Id: FN-4116
This commit is contained in:
Fusion
2026-05-12 08:17:56 -07:00
committed by gsxdsm
parent 34da8cffc2
commit 8f2b370b9d
5 changed files with 143 additions and 11 deletions

View File

@@ -223,4 +223,29 @@ describe("maybeCreateTrackingIssue", () => {
expect(resolveAuthMock).toHaveBeenCalledWith(expect.objectContaining({ globalSettings }));
});
it("records activity when GitHub issue creation fails", async () => {
const recordActivity = vi.fn();
createIssueMock.mockRejectedValue(new Error("gh create failed"));
const result = await maybeCreateTrackingIssue(buildTask({ title: "Test", githubTracking: { enabled: true } }), {
taskStore: { recordActivity, linkGithubIssue: vi.fn() } as any,
projectSettings: {},
globalSettings: { githubTrackingDefaultRepo: "o/r" } as any,
logger: { warn: vi.fn(), info: vi.fn() },
});
expect(result).toEqual({ created: false, reason: "github_error" });
expect(recordActivity).toHaveBeenCalledWith(expect.objectContaining({
type: "task:updated",
taskId: "FN-1",
taskTitle: "Test",
details: "GitHub tracking issue not created: gh create failed",
metadata: expect.objectContaining({
type: "github-issue-failed",
reason: "github_error",
message: "gh create failed",
}),
}));
});
});