From 7b02a36ab842d72591af5ca2439cdb23e47f7d7d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 00:49:41 +0000 Subject: [PATCH 1/3] Initial plan From 2a5b1e3dfc46a584ff63842bfe0835e0622ad0e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 01:15:41 +0000 Subject: [PATCH 2/3] Fix add_labels.test.cjs test structure issues Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/add_labels.test.cjs | 38 +++++++++++++++------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/actions/setup/js/add_labels.test.cjs b/actions/setup/js/add_labels.test.cjs index 60a649629f..8a1b02eff0 100644 --- a/actions/setup/js/add_labels.test.cjs +++ b/actions/setup/js/add_labels.test.cjs @@ -251,67 +251,69 @@ const mockCore = { expect(summaryCall).toBeDefined(); }), it("should handle GitHub API errors", async () => { - (setAgentOutput({ items: [{ type: "add_labels", labels: ["bug"] }] }), (process.env.GH_AW_LABELS_ALLOWED = "bug,enhancement")); + setAgentOutput({ items: [{ type: "add_labels", labels: ["bug"] }] }); + process.env.GH_AW_LABELS_ALLOWED = "bug,enhancement"; const apiError = new Error("Label does not exist"); - mockGithub.rest.issues.addLabels.mockRejectedValue(apiError); const consoleSpy = vi.spyOn(console, "error").mockImplementation(() => {}); - (await eval(`(async () => { ${addLabelsScript}; await main(); })()`), + (mockGithub.rest.issues.addLabels.mockRejectedValue(apiError), + await eval(`(async () => { ${addLabelsScript}; await main(); })()`), expect(mockCore.error).toHaveBeenCalledWith("Failed to add labels: Label does not exist"), expect(mockCore.setFailed).toHaveBeenCalledWith("Failed to add labels: Label does not exist")); }), it("should handle non-Error objects in catch block", async () => { - (setAgentOutput({ items: [{ type: "add_labels", labels: ["bug"] }] }), (process.env.GH_AW_LABELS_ALLOWED = "bug,enhancement")); + setAgentOutput({ items: [{ type: "add_labels", labels: ["bug"] }] }); + process.env.GH_AW_LABELS_ALLOWED = "bug,enhancement"; const stringError = "Something went wrong"; - mockGithub.rest.issues.addLabels.mockRejectedValue(stringError); const consoleSpy = vi.spyOn(console, "error").mockImplementation(() => {}); - (await eval(`(async () => { ${addLabelsScript}; await main(); })()`), + (mockGithub.rest.issues.addLabels.mockRejectedValue(stringError), + await eval(`(async () => { ${addLabelsScript}; await main(); })()`), expect(mockCore.error).toHaveBeenCalledWith("Failed to add labels: Something went wrong"), expect(mockCore.setFailed).toHaveBeenCalledWith("Failed to add labels: Something went wrong")); })); }), describe("Output and logging", () => { (it("should log agent output content length", async () => { - (setAgentOutput({ items: [{ type: "add_labels", labels: ["bug", "enhancement"] }] }), + ((setAgentOutput({ items: [{ type: "add_labels", labels: ["bug", "enhancement"] }] }), (process.env.GH_AW_LABELS_ALLOWED = "bug,enhancement"), await eval(`(async () => { ${addLabelsScript}; await main(); })()`), - expect(mockCore.info).toHaveBeenCalledWith("Agent output content length: 64")); + expect(mockCore.info).toHaveBeenCalledWith("Agent output content length: 64"))); }), it("should log allowed labels and max count", async () => { - (setAgentOutput({ items: [{ type: "add_labels", labels: ["bug"] }] }), + ((setAgentOutput({ items: [{ type: "add_labels", labels: ["bug"] }] }), (process.env.GH_AW_LABELS_ALLOWED = "bug,enhancement,feature"), (process.env.GH_AW_LABELS_MAX_COUNT = "5"), await eval(`(async () => { ${addLabelsScript}; await main(); })()`), expect(mockCore.info).toHaveBeenCalledWith(`Allowed label additions: ${JSON.stringify(["bug", "enhancement", "feature"])}`), - expect(mockCore.info).toHaveBeenCalledWith("Max count: 5")); + expect(mockCore.info).toHaveBeenCalledWith("Max count: 5"))); }), it("should log requested labels", async () => { - (setAgentOutput({ items: [{ type: "add_labels", labels: ["bug", "enhancement", "invalid"] }] }), + ((setAgentOutput({ items: [{ type: "add_labels", labels: ["bug", "enhancement", "invalid"] }] }), (process.env.GH_AW_LABELS_ALLOWED = "bug,enhancement"), await eval(`(async () => { ${addLabelsScript}; await main(); })()`), - expect(mockCore.info).toHaveBeenCalledWith(`Requested labels: ${JSON.stringify(["bug", "enhancement", "invalid"])}`)); + expect(mockCore.info).toHaveBeenCalledWith(`Requested labels: ${JSON.stringify(["bug", "enhancement", "invalid"])}`))); }), it("should log final labels being added", async () => { - (setAgentOutput({ items: [{ type: "add_labels", labels: ["bug", "enhancement"] }] }), + ((setAgentOutput({ items: [{ type: "add_labels", labels: ["bug", "enhancement"] }] }), (process.env.GH_AW_LABELS_ALLOWED = "bug,enhancement"), (process.env.GH_AW_LABELS_MAX_COUNT = "10"), await eval(`(async () => { ${addLabelsScript}; await main(); })()`), - expect(mockCore.info).toHaveBeenCalledWith(`Adding 2 labels to issue #123: ${JSON.stringify(["bug", "enhancement"])}`)); + expect(mockCore.info).toHaveBeenCalledWith(`Adding 2 labels to issue #123: ${JSON.stringify(["bug", "enhancement"])}`))); })); }), describe("Edge cases", () => { (it("should handle whitespace in allowed labels", async () => { - (setAgentOutput({ items: [{ type: "add_labels", labels: ["bug", "enhancement"] }] }), + ((setAgentOutput({ items: [{ type: "add_labels", labels: ["bug", "enhancement"] }] }), (process.env.GH_AW_LABELS_ALLOWED = " bug , enhancement , feature "), (process.env.GH_AW_LABELS_MAX_COUNT = "10"), await eval(`(async () => { ${addLabelsScript}; await main(); })()`), expect(mockCore.info).toHaveBeenCalledWith(`Allowed label additions: ${JSON.stringify(["bug", "enhancement", "feature"])}`), - expect(mockGithub.rest.issues.addLabels).toHaveBeenCalledWith({ owner: "testowner", repo: "testrepo", issue_number: 123, labels: ["bug", "enhancement"] })); + expect(mockGithub.rest.issues.addLabels).toHaveBeenCalledWith({ owner: "testowner", repo: "testrepo", issue_number: 123, labels: ["bug", "enhancement"] }))); }), it("should handle empty entries in allowed labels", async () => { - (setAgentOutput({ items: [{ type: "add_labels", labels: ["bug"] }] }), + ((setAgentOutput({ items: [{ type: "add_labels", labels: ["bug"] }] }), (process.env.GH_AW_LABELS_ALLOWED = "bug,,enhancement,"), await eval(`(async () => { ${addLabelsScript}; await main(); })()`), - expect(mockCore.info).toHaveBeenCalledWith(`Allowed label additions: ${JSON.stringify(["bug", "enhancement"])}`)); + expect(mockCore.info).toHaveBeenCalledWith(`Allowed label additions: ${JSON.stringify(["bug", "enhancement"])}`))); }), it("should handle single label output", async () => { (setAgentOutput({ items: [{ type: "add_labels", labels: ["bug"] }] }), From 36234ec3839225753d3bc31860cd79b6aa2ae4c1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 01:23:50 +0000 Subject: [PATCH 3/3] Complete CI cleanup: tests pass, workflows recompiled Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .devcontainer/devcontainer.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index da5e377b59..c8ff4249f4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,14 @@ "image": "mcr.microsoft.com/devcontainers/go:1-bookworm", "customizations": { "vscode": { - "extensions": ["golang.go", "GitHub.copilot-chat", "GitHub.copilot", "github.vscode-github-actions", "astro-build.astro-vscode", "DavidAnson.vscode-markdownlint"] + "extensions": [ + "golang.go", + "GitHub.copilot-chat", + "GitHub.copilot", + "github.vscode-github-actions", + "astro-build.astro-vscode", + "DavidAnson.vscode-markdownlint" + ] }, "codespaces": { "repositories": {