fix(pi): docker image mcp env passthrough instead of literal expansion#67
Conversation
buildPiMcpEntry now emits pure ${VAR} env references as bare -e VAR
docker passthrough flags (with a resolved env block) instead of inline
-e KEY=${VAR}, which docker never expands and delivered the literal
string to the container. Literal values (e.g. LOG_LEVEL=info) stay inline.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Disabled knowledge base sources:
📝 WalkthroughWalkthroughAdds an internal ChangesDocker Env Passthrough
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant buildPiMcpEntry
participant buildDockerEnvArgs
participant DockerConfig
buildPiMcpEntry->>buildDockerEnvArgs: pass env map
buildDockerEnvArgs->>buildDockerEnvArgs: detect ${...} placeholder values
buildDockerEnvArgs-->>buildPiMcpEntry: return args and passthroughEnv
buildPiMcpEntry->>DockerConfig: attach args
buildPiMcpEntry->>DockerConfig: attach env when passthroughEnv present
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Summary
Fixes docker-image MCP generation in the pi extension (
buildPiMcpEntry, used bymcp-wiring.tsto write.pi/mcp.json).The
imagebranch always emitted every env var inline as-e KEY=value, so a reference like${SIGNOZ_URL}was baked into the docker args literally. Docker never shell-expands its own args, so the container received the literal string${SIGNOZ_URL}instead of the real value.Change
New helper
buildDockerEnvArgssplits env vars into two cases:${VAR}) → emitted as bare-e VAR(docker passthrough) and collected into anenvblock so pi resolves the value into the docker process, which docker then forwards to the container.LOG_LEVEL=info) → stay inline as-e KEY=value.Only
buildPiMcpEntrywas touched. The Cursor / Kiro / Claude Code / OpenCode builders were intentionally left unchanged.Before
{ "command": "docker", "args": ["run","-i","--rm","-e","SIGNOZ_URL=${SIGNOZ_URL}","-e","SIGNOZ_API_KEY=${SIGNOZ_API_KEY}","-e","LOG_LEVEL=info","signoz/signoz-mcp-server:latest"] }After
{ "command": "docker", "args": ["run","-i","--rm","-e","SIGNOZ_URL","-e","SIGNOZ_API_KEY","-e","LOG_LEVEL=info","signoz/signoz-mcp-server:latest"], "env": { "SIGNOZ_URL": "${SIGNOZ_URL}", "SIGNOZ_API_KEY": "${SIGNOZ_API_KEY}" } }Tested
pnpm buildandpnpm lintpass inpackages/core.Bumps
@arvoretech/hub-coreto0.26.1.Summary by CodeRabbit
Bug Fixes
Chores
0.26.1.