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:
@@ -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",
|
||||
}),
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user