Skip to content

Commit fddfaf1

Browse files
committed
ci(mcp): name the MCP gate per SDK major — MCP SDK v1/v2 (Python X.Y)
Reshape tests-mcp-v2 into a tests-mcp matrix over {v1, v2} x {3.10, 3.14}, so the checks list shows an explicit per-major signal instead of the v1 side being buried inside the whole-repo tests matrix. The v1 leg uses the lockfile's mcp 1.x as-is; the v2 leg swaps in mcp>=2,<3 and drops jlowin fastmcp (pins mcp<2). The main tests matrix is unchanged. Generated-By: PostHog Code Task-Id: ebafcb71-b03b-443d-b40c-d527ed4a04f4
1 parent 021823f commit fddfaf1

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,18 @@ jobs:
151151
run: |
152152
pytest --verbose --timeout=30
153153
154-
tests-mcp-v2:
155-
# The MCP suite again, against MCP Python SDK v2 (spec 2026-07-28). The
156-
# `tests` matrix covers mcp 1.x on every Python version; this lane swaps
157-
# in mcp>=2 (and drops jlowin fastmcp, which pins mcp<2) and runs only
158-
# posthog/test/mcp — conftest.py there splits collection by major.
159-
name: MCP SDK v2 tests (Python ${{ matrix.python-version }})
154+
tests-mcp:
155+
# The MCP suite as a named gate per MCP Python SDK major. The v1 leg uses
156+
# the lockfile's mcp 1.x (also exercised incidentally by the `tests`
157+
# matrix — this leg exists as an explicit, named signal); the v2 leg
158+
# (spec 2026-07-28) swaps in mcp>=2 and drops jlowin fastmcp, which pins
159+
# mcp<2. posthog/test/mcp/conftest.py splits collection by major.
160+
name: MCP SDK ${{ matrix.mcp-major }} (Python ${{ matrix.python-version }})
160161
runs-on: ubuntu-latest
161162
strategy:
162163
matrix:
163164
python-version: ['3.10', '3.14']
165+
mcp-major: ['v1', 'v2']
164166

165167
steps:
166168
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -178,14 +180,19 @@ jobs:
178180
version: "0.11.32"
179181
enable-cache: true
180182

181-
- name: Install test dependencies with MCP SDK v2
183+
- name: Install test dependencies
182184
shell: bash
183185
run: |
184186
UV_PROJECT_ENVIRONMENT=$pythonLocation uv sync --extra test
187+
188+
- name: Swap in MCP SDK v2
189+
if: matrix.mcp-major == 'v2'
190+
shell: bash
191+
run: |
185192
uv pip uninstall --python $pythonLocation fastmcp
186193
uv pip install --python $pythonLocation 'mcp>=2,<3'
187194
188-
- name: Run MCP tests against SDK v2
195+
- name: Run MCP tests against SDK ${{ matrix.mcp-major }}
189196
run: |
190197
pytest posthog/test/mcp --verbose --timeout=30
191198

posthog/test/mcp/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""Split the MCP test suite by installed MCP SDK major.
22
3-
The suite runs twice in CI: once against ``mcp>=1.26,<2`` (the ``tests`` job)
4-
and once against ``mcp>=2,<3`` (the ``tests-mcp-v2`` job). Files coupled to one
3+
The suite runs against both majors in CI — the ``tests-mcp`` matrix has a
4+
``mcp>=1.26,<2`` leg and a ``mcp>=2,<3`` leg (the main ``tests`` matrix also
5+
exercises the v1 side incidentally). Files coupled to one
56
major's seams import symbols the other major doesn't ship, so they are excluded
67
from *collection* (a skip marker can't help — the failure is at import time).
78
Version-agnostic files (units, truncation, session tokens, PostHogMCP, ids)

0 commit comments

Comments
 (0)