ci(mcp): MCP-tests workflow (T2 #649)#676
Conversation
New `.github/workflows/mcp-tests.yml` runs `pytest tests/mcp/` against a real FalkorDB service container on port 6379. Triggers only on PRs that touch MCP-relevant paths so the unrelated parts of the repo don't pay the cost. - FalkorDB service with redis-cli ping healthcheck. - uv cache keyed on uv.lock for fast incremental runs. - Sets `FALKORDB_HOST` / `FALKORDB_PORT` env so api/graph.py picks up the service host. - Path filter covers api/mcp/, tests/mcp/, api/llm.py, api/graph.py, pyproject.toml, uv.lock, and the workflow file itself. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📝 WalkthroughWalkthroughNew GitHub Actions workflow runs MCP tests on pull requests to MCP-related code. The workflow provisions a FalkorDB service container, configures Python and the ChangesMCP Test CI Workflow
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/mcp-tests.yml (2)
52-53: ⚡ Quick winSet
persist-credentials: falsefor defense in depth.The checkout step doesn't explicitly disable credential persistence. Setting
persist-credentials: falsereduces the attack surface by preventing subsequent steps from accessing the persisted GITHUB_TOKEN if they are compromised.🔒 Proposed fix to disable credential persistence
- name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/mcp-tests.yml around lines 52 - 53, The Checkout step using actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd should explicitly disable credential persistence; update the "Checkout" step (the step with name "Checkout" and uses: actions/checkout@...) to include persist-credentials: false under its with: block so the GITHUB_TOKEN is not persisted to subsequent steps.
38-38: ⚡ Quick winConsider pinning the FalkorDB image to a specific version.
The service container uses
falkordb/falkordb:latest, which can lead to non-deterministic CI behavior if the upstream image changes. Pinning to a specific version or digest (e.g.,falkordb/falkordb:v4.2.5or@sha256:...) improves test reproducibility.If testing against the latest release is intentional to catch regressions early, document that intent with a comment and establish a process to periodically review breaking changes.
📌 Proposed fix to pin the image version
- image: falkordb/falkordb:latest + image: falkordb/falkordb:v4.2.5 # or use `@sha256`:... for stronger pinning🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/mcp-tests.yml at line 38, The CI service image is currently using an unstable tag `falkordb/falkordb:latest`; update the workflow to pin the image to a specific version or digest (e.g., replace `image: falkordb/falkordb:latest` with a concrete tag like `falkordb/falkordb:vX.Y.Z` or `falkordb/falkordb@sha256:...`) to ensure reproducible tests, or if you intentionally want to track latest, add an inline comment near the `image:` entry stating that intent and add a cadence/process note for reviewing upstream changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/mcp-tests.yml:
- Around line 52-53: The Checkout step using
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd should explicitly
disable credential persistence; update the "Checkout" step (the step with name
"Checkout" and uses: actions/checkout@...) to include persist-credentials: false
under its with: block so the GITHUB_TOKEN is not persisted to subsequent steps.
- Line 38: The CI service image is currently using an unstable tag
`falkordb/falkordb:latest`; update the workflow to pin the image to a specific
version or digest (e.g., replace `image: falkordb/falkordb:latest` with a
concrete tag like `falkordb/falkordb:vX.Y.Z` or `falkordb/falkordb@sha256:...`)
to ensure reproducible tests, or if you intentionally want to track latest, add
an inline comment near the `image:` entry stating that intent and add a
cadence/process note for reviewing upstream changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ba5e92f5-8335-49ca-96f1-2fef3e2d1ce7
📒 Files selected for processing (1)
.github/workflows/mcp-tests.yml
Closes #649.
Stacked on #675 (T17). Adds
.github/workflows/mcp-tests.ymlso every PR that touches MCP code runspytest tests/mcp/against a real FalkorDB service container.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com
Summary by CodeRabbit