Skip to content

Commit 4860c8a

Browse files
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>
1 parent 2d5ad6e commit 4860c8a

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

‎.github/workflows/mcp-diff.yml‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,41 @@ jobs:
119119
} >> "$GITHUB_OUTPUT"
120120
121121
- name: Run MCP Server Diff (streamable-http)
122+
id: diff
122123
# Pinned to mcp-server-diff v3.0.0 — see rationale on the stdio job above.
124+
# The action sleeps http_startup_wait_ms and then probes, with no
125+
# readiness check. Build the binary in install_command (which runs to
126+
# completion on both the current and baseline checkouts before the
127+
# server is started) so the wait only covers process startup, not
128+
# compilation. Using `go run` here let compile time on the uncached
129+
# baseline checkout exceed the wait, so every baseline probe failed.
123130
uses: SamMorrowDrums/mcp-server-diff@40d992e0a220e5b63378758f9a40d6a8982898d2 # v3.0.0
124131
with:
125132
setup_go: "false"
126133
install_command: |
127134
go mod download
128135
mkdir -p pkg/github/ui_dist
129136
cp "${RUNNER_TEMP}"/ui_dist/*.html pkg/github/ui_dist/
130-
http_start_command: go run ./cmd/github-mcp-server http --port 8082
137+
go build -o bin/github-mcp-server ./cmd/github-mcp-server
138+
http_start_command: ./bin/github-mcp-server http --port 8082
131139
http_startup_wait_ms: "5000"
132140
configurations: ${{ steps.configs.outputs.configurations }}
133141

142+
- name: Verify both sides were probed
143+
# mcp-server-diff treats a configuration that fails on only one side as
144+
# "missing on that ref" (non-fatal) and diffs against an empty
145+
# baseline, so fail_on_error does not catch an unreachable server.
146+
# With a single shared HTTP server, a one-sided failure always means
147+
# that side's server never came up, so fail the job explicitly.
148+
env:
149+
REPORT: ${{ steps.diff.outputs.json_report_path }}
150+
run: |
151+
jq -e 'all(.results[]; .configMissing == null)' "$REPORT" > /dev/null || {
152+
jq -r '.results[] | select(.configMissing) | "::error::\(.configName): server unreachable on \(.configMissing.side) side: \(.configMissing.error)"' "$REPORT"
153+
exit 1
154+
}
155+
jq -r '.results[] | "\(.configName): base=\(.baseProtocolVersion) head=\(.branchProtocolVersion) tools base=\(.baseCounts.tools) head=\(.branchCounts.tools)"' "$REPORT"
156+
134157
- name: Add interpretation note
135158
if: always()
136159
run: |

0 commit comments

Comments
 (0)