From a080f7a6945edbe48b33cb3521d70840b8788ea8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Feb 2026 21:58:42 +0000 Subject: [PATCH 1/3] Initial plan From 74c71a320b340ab4ba940f351cbc4b1704897c64 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Feb 2026 22:06:08 +0000 Subject: [PATCH 2/3] Fix Windows integration test: use bash shell for CodeQL CLI check Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> --- client/src/ql-mcp-client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/ql-mcp-client.js b/client/src/ql-mcp-client.js index 19cb0c24..0faada09 100755 --- a/client/src/ql-mcp-client.js +++ b/client/src/ql-mcp-client.js @@ -87,10 +87,12 @@ class CodeQLMCPClient { this.logger.log("Checking for CodeQL CLI availability..."); // Try to run 'codeql version' to check if it's available + // On Windows, explicitly use bash since the CodeQL stub is a bash script const version = execSync("codeql version", { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"], - timeout: 5000 + timeout: 5000, + shell: process.platform === "win32" ? "bash" : undefined }).trim(); this.logger.log(`Found CodeQL CLI: ${version.split("\n")[0]}`); From f5fd393cdfbfcea379a27c919b3d74d358670223 Mon Sep 17 00:00:00 2001 From: Nathan Randall Date: Fri, 6 Feb 2026 17:51:19 -0700 Subject: [PATCH 3/3] fix: create Windows-compatible codeql.cmd wrapper On Windows, gh codeql install-stub creates a bash script (codeql) which is not discoverable by Node.js child_process.spawn(). This causes 'spawn codeql ENOENT' errors in integration tests. Add a step that creates a codeql.cmd wrapper delegating to 'gh codeql' so that spawn('codeql', ...) resolves correctly on Windows. Aligns with github/gh-codeql#21 which adds native Windows support to install-stub. This workaround can be removed once that PR is merged. --- .../actions/setup-codeql-environment/action.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/actions/setup-codeql-environment/action.yml b/.github/actions/setup-codeql-environment/action.yml index 7918eb0b..4a15128d 100644 --- a/.github/actions/setup-codeql-environment/action.yml +++ b/.github/actions/setup-codeql-environment/action.yml @@ -149,6 +149,23 @@ runs: echo "✅ GitHub CLI CodeQL extension installed successfully" + # On Windows, gh codeql install-stub creates a bash script which is not + # discoverable by Node.js child_process.spawn(). Create a .cmd wrapper + # so that tools using spawn('codeql', ...) can find the CodeQL CLI. + - name: Create Windows-compatible CodeQL CLI wrapper + if: runner.os == 'Windows' + shell: bash + run: | + CODEQL_STUB_DIR="$HOME/.local/bin" + + cat > "$CODEQL_STUB_DIR/codeql.cmd" << 'WRAPPER' + @echo off + gh codeql %* + exit /b %errorlevel% + WRAPPER + + echo "✅ Created Windows-compatible CodeQL CLI wrapper at $CODEQL_STUB_DIR/codeql.cmd" + - name: Setup CodeQL environment variables id: setup-codeql-env shell: bash