fix(ci): unbreak the MCP server deploy — exclude tests from the prod build - #580
Merged
Merged
Conversation
…rod build
The last three pushes to master failed `deploy-mcp.yml` at the Docker build:
src/branding.test.ts(1,38): error TS2307: Cannot find module 'vitest'
src/tools/flashcards.test.ts(104,91): error TS7006: Parameter 'rating'
implicitly has an 'any' type.
`mcp-server` declares a vitest config but not the dependency — locally the
import resolves upward into the repo root's node_modules. The image copies
only `mcp-server/`, so there is no root to walk up to and the type check
fails. Test files also have no business in `dist`, so exclude them from the
build rather than shipping vitest into the production image.
Verified with a local `docker build` of mcp-server/Dockerfile: type check
passes, 18 widgets built. `npx vitest run` in mcp-server still passes 66/66.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The last three pushes to
master(#578, #576, #575) all faileddeploy-mcp.yml. The production MCP image has not been rebuilt since — prod is running a stale MCP server.Root cause
The Docker build runs
mcp-use build, which type-checks everything in the tsconfiginclude, test files included:mcp-serverhas its ownvitest.config.tsbut does not declarevitestas a dependency — locally the import resolves by walking up into the repo root'snode_modules.mcp-server/Dockerfilecopies onlymcp-server/, so inside the image there is no root to walk up to.It first broke in f93a762 (#572), which added the three test files.
Fix
Exclude
**/*.test.ts(x)frommcp-server/tsconfig.json. Test files should not be compiled intodistregardless, and this is preferable to shipping vitest into the production image.QA
docker buildofmcp-server/Dockerfilelocally: ✅Type check passed!, 18 widgets built, image exported (fails onmasterwith the errors above)npx vitest runinmcp-server: ✅ 5 files, 66 tests passing — the tests still run, they are only excluded from the buildFollow-up (not in this PR)
vitestis an undeclared dependency ofmcp-server;npm testthere only works because of root hoisting. Worth declaring, but that means touchingmcp-server/package-lock.json, which is out of scope for a deploy hotfix.🤖 Generated with Claude Code
https://claude.ai/code/session_01FJ4dqwXuyKUPtg11ni5BSb