Add Cloud Run deployment infrastructure - #20
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
✅ Gitleaks Findings: No secrets detected. Safe to proceed! |
PR Review: Add Cloud Run Deployment InfrastructureOverall this is a clean, well-structured PR. The use of Workload Identity Federation avoids storing long-lived credentials, the multi-stage Dockerfile is correct, and tests gate the deploy. A few issues worth addressing before merging: Bugs
setTimeout(() => {
console.error("Forced shutdown after timeout");
process.exit(1); // ← should be 0
}, 8000).unref();A forced shutdown after the grace period is expected behavior, not an error. Potential Issues
RUN pnpm build:ui && pnpm build:ui-imports
COPY public/ ./public/
Security
The service is deployed publicly, which is likely intentional since the MCP server handles its own credential validation. That said, it means anyone can probe the Minor SuggestionsPin the Node.js base image version ( FROM node:20-slim AS builder # ← unpinned minor/patch
With zero minimum instances, cold starts will occur. Node.js with TypeScript compilation artifacts should start quickly (~1–2s), but the startup probe allows only 15 seconds total (5 retries × 3s). If any initialization (e.g., module loading) is slower than expected, the probe will fail. Consider
The What's Done Well
|
|
✅ Gitleaks Findings: No secrets detected. Safe to proceed! |
Code Review — Cloud Run deployment infrastructureSolid, well-scoped migration PR. The build pipeline is correctly preserved in the multi-stage Dockerfile, the health endpoint is placed sensibly (before the rate limiter, so probes aren't throttled), and graceful shutdown wiring looks right. A few things worth addressing before/after merge. Likely bug — deploy.yml mounts secrets that don't exist anymore
Reproducibility — pin pnpm to match the pinned NodeYou pinned the base image to Security — allow-unauthenticated is internet-exposedThe service is public and relies entirely on app-level bearer/API-key auth, with anonymous mode serving unauthenticated callers (rate-limited by IP). That is a defensible design for an MCP server, but on Cloud Run the IP seen by the limiter is typically the load-balancer/proxy IP unless you enable Express Minor notes
Things done well
Nice work overall — the secret-mount issue is the one I would treat as blocking. |
Prepare for migration from Vercel to Google Cloud Run: - Add GET /health endpoint for Cloud Run startup/liveness probes - Add graceful SIGTERM/SIGINT shutdown handling (8s timeout) - Add multi-stage Dockerfile (node:20-slim, pnpm, prod-only deps) - Add .dockerignore to minimize build context - Add GitHub Actions deploy workflow with Workload Identity Federation - Add workflow_call trigger to test.yml for reuse by deploy workflow https://claude.ai/code/session_01Gr1yHcWyzydrvgsiHFFqv4
- Change forced shutdown timeout from process.exit(1) to process.exit(0) since forced exit after grace period is expected, not an error - Pin Dockerfile base image from node:20-slim to node:20.19.0-slim for reproducible builds https://claude.ai/code/session_01Gr1yHcWyzydrvgsiHFFqv4
- Remove WORKSPACE_ID and ACCOUNT_ID from deploy.yml --set-secrets (removed from codebase in PR #22) - Pin pnpm to 10.11.0 in Dockerfile for reproducible builds - Rebase onto latest main (picks up de-identify_file removal, entities param, and env cleanup from PRs #19 and #22) https://claude.ai/code/session_01Gr1yHcWyzydrvgsiHFFqv4
51688b9 to
d5f5710
Compare
|
✅ Gitleaks Findings: No secrets detected. Safe to proceed! |
|
PR Review: Add Cloud Run deployment infrastructure Overall this is a clean, well-scoped migration setup. Good use of Workload Identity Federation (no long-lived keys), least-privilege workflow permissions, sha-pinned images, Secret Manager for secrets, non-root container user, and a A few things worth addressing, ordered by importance. 🔴 Verify: Cloud Run probe flags in deploy.yml 🟠 Duplicate test runs on merge to main 🟡 tsx is not a declared dependency but the Docker build depends on it 🟡 pnpm version drift Minor / optional
Test coverage Confirmed correct
🤖 Generated with Claude Code |
Prepare for migration from Vercel to Google Cloud Run:
https://claude.ai/code/session_01Gr1yHcWyzydrvgsiHFFqv4