From 4860c8a1e5d48342a7436e58cf6954a407027802 Mon Sep 17 00:00:00 2001 From: Sam Morrow Date: Wed, 7 Oct 2026 01:18:37 +0200 Subject: [PATCH] ci(mcp-diff): prebuild HTTP server and fail when a side is unreachable The streamable-http job started the server with `go run` and relied on mcp-server-diff's fixed http_startup_wait_ms sleep. On the baseline worktree (.mcp-diff-base) nothing is cached, and since the typed tool refactors compile+link exceeds 5s, so every baseline probe hit ECONNREFUSED ("fetch failed"). The action treats a one-sided startup failure as a non-fatal "config-missing" and diffs against an empty baseline, so fail_on_error never triggered and the job stayed green. Build the binary in install_command (which completes on both sides before the server starts) and start it directly, and add a step that fails the job if any configuration did not start on either side. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/mcp-diff.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mcp-diff.yml b/.github/workflows/mcp-diff.yml index 3e635244f9..0e1ec42f10 100644 --- a/.github/workflows/mcp-diff.yml +++ b/.github/workflows/mcp-diff.yml @@ -119,7 +119,14 @@ jobs: } >> "$GITHUB_OUTPUT" - name: Run MCP Server Diff (streamable-http) + id: diff # Pinned to mcp-server-diff v3.0.0 — see rationale on the stdio job above. + # The action sleeps http_startup_wait_ms and then probes, with no + # readiness check. Build the binary in install_command (which runs to + # completion on both the current and baseline checkouts before the + # server is started) so the wait only covers process startup, not + # compilation. Using `go run` here let compile time on the uncached + # baseline checkout exceed the wait, so every baseline probe failed. uses: SamMorrowDrums/mcp-server-diff@40d992e0a220e5b63378758f9a40d6a8982898d2 # v3.0.0 with: setup_go: "false" @@ -127,10 +134,26 @@ jobs: go mod download mkdir -p pkg/github/ui_dist cp "${RUNNER_TEMP}"/ui_dist/*.html pkg/github/ui_dist/ - http_start_command: go run ./cmd/github-mcp-server http --port 8082 + go build -o bin/github-mcp-server ./cmd/github-mcp-server + http_start_command: ./bin/github-mcp-server http --port 8082 http_startup_wait_ms: "5000" configurations: ${{ steps.configs.outputs.configurations }} + - name: Verify both sides were probed + # mcp-server-diff treats a configuration that fails on only one side as + # "missing on that ref" (non-fatal) and diffs against an empty + # baseline, so fail_on_error does not catch an unreachable server. + # With a single shared HTTP server, a one-sided failure always means + # that side's server never came up, so fail the job explicitly. + env: + REPORT: ${{ steps.diff.outputs.json_report_path }} + run: | + jq -e 'all(.results[]; .configMissing == null)' "$REPORT" > /dev/null || { + jq -r '.results[] | select(.configMissing) | "::error::\(.configName): server unreachable on \(.configMissing.side) side: \(.configMissing.error)"' "$REPORT" + exit 1 + } + jq -r '.results[] | "\(.configName): base=\(.baseProtocolVersion) head=\(.branchProtocolVersion) tools base=\(.baseCounts.tools) head=\(.branchCounts.tools)"' "$REPORT" + - name: Add interpretation note if: always() run: |