Add Cloud Agent development environment - #685
Conversation
The apps/web importer pinned @prisma/adapter-pg@7.9.0 while the prisma catalog and the package snapshot are 7.9.1, leaving the lockfile without an entry for 7.9.0. This breaks `pnpm install --frozen-lockfile` (and main CI). Align the importer to the catalog version already used by packages/db and present in the lockfile. Co-authored-by: Kar Rui Lau <karrui@users.noreply.github.com>
Adds .cursor/environment.json plus install/start scripts so Cloud Agents can run the Starter Kit end to end without Docker for the app itself: - install.sh: pin Node 24 (nvm), create .env with a generated SESSION_SECRET, pnpm install --frozen-lockfile, prisma generate. - services.sh: start native PostgreSQL (54321) and Redis (63791) on the ports .env.example expects, and best-effort start Docker (fuse-overlayfs) for the testcontainers-based Vitest suite. - start.sh: bring up services and sync the Prisma schema (prisma db push). - dev.sh: run the Next.js dev server as a terminal (stream logs). Co-authored-by: Kar Rui Lau <karrui@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🎯 Code Coverage (details) 🔗 Commit SHA: 0764377 | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
Pull request overview
Adds a repository-managed Cloud Agent development environment under .cursor/ so automated agents can install dependencies, start required services (PostgreSQL/Redis), sync Prisma schema, and run the web dev server end-to-end. Also aligns the lockfile’s resolved Prisma adapter version with the workspace catalog to restore --frozen-lockfile installs.
Changes:
- Add
.cursor/environment.jsonplus install/start/dev scripts to provision a Cloud Agent dev environment. - Start native PostgreSQL + Redis on the existing docker-compose/.env.example ports and best-effort bring up a Docker daemon for testcontainers.
- Fix
pnpm-lock.yamlto resolve@prisma/adapter-pgto7.9.1(catalog value), eliminating a frozen-lockfile mismatch.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Aligns resolved Prisma adapter version with the workspace catalog to fix frozen installs. |
| .cursor/environment.json | Declares Cloud Agent install/start commands, a web-dev terminal, and port 3000 exposure. |
| .cursor/install.sh | Installs workspace deps and generates Prisma client; bootstraps .env on first run. |
| .cursor/start.sh | Starts local services and runs Prisma db push for per-boot schema reconciliation. |
| .cursor/services.sh | Brings up native PostgreSQL/Redis and best-effort Docker daemon for testcontainers. |
| .cursor/dev.sh | Runs the long-lived pnpm dev terminal with Turbo UI disabled for cleaner logs. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Suppressed comments (1)
.cursor/services.sh:38
- The Docker daemon section is intended to be best-effort, but with
set -eany failingsudo ...(missing sudo, password prompt, permission denied) can terminate the whole services startup. Also,chmod 666makes the Docker socket world-writable. Consider using non-interactive sudo (-n), making the setup truly non-fatal, and tightening socket permissions while still allowing the current user to access it.
if command -v dockerd >/dev/null 2>&1; then
if ! sudo docker info >/dev/null 2>&1; then
echo "[services] Starting Docker daemon (for testcontainers)"
sudo mkdir -p /etc/docker
echo '{"storage-driver":"fuse-overlayfs"}' | sudo tee /etc/docker/daemon.json >/dev/null
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| PG_BIN="/usr/lib/postgresql/16/bin" | ||
| STATE_DIR="${HOME}/.local/share/starter-kit" | ||
| PGDATA="${STATE_DIR}/pgdata" | ||
| PGLOG="${STATE_DIR}/postgres.log" | ||
| REDIS_DIR="${STATE_DIR}/redis" | ||
| REDIS_LOG="${STATE_DIR}/redis.log" |
| export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" | ||
| # shellcheck disable=SC1091 | ||
| [ -s "${NVM_DIR}/nvm.sh" ] && . "${NVM_DIR}/nvm.sh" | ||
| nvm use >/dev/null 2>&1 || nvm use 24.13.0 >/dev/null 2>&1 || true |
| export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" | ||
| # shellcheck disable=SC1091 | ||
| [ -s "${NVM_DIR}/nvm.sh" ] && . "${NVM_DIR}/nvm.sh" | ||
| nvm use >/dev/null 2>&1 || nvm use 24.13.0 >/dev/null 2>&1 || true |
| export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" | ||
| # shellcheck disable=SC1091 | ||
| [ -s "${NVM_DIR}/nvm.sh" ] && . "${NVM_DIR}/nvm.sh" | ||
| nvm use >/dev/null 2>&1 || nvm use 24.13.0 >/dev/null 2>&1 || true |
What
Sets up a repository-managed Cloud Agent development environment for the Starter Kit monorepo so agents can install, run, and test the app end to end. Because
.cursor/environment.jsonis committed, it is the highest-precedence environment source and takes effect for agents once this branch is checked out / merged.Environment config (
.cursor/)environment.json— declaresinstall,start, aweb-devterminal, and exposes port3000.install.sh— pins Node 24 (nvm) + pnpm 11.20.0, creates.envfrom.env.examplewith a generatedSESSION_SECRET, runspnpm install --frozen-lockfile, and generates the Prisma client.services.sh— starts native PostgreSQL (54321) and Redis (63791) on the ports.env.exampleexpects (Docker isn't required for the app itself), and best-effort starts a Docker daemon (fuse-overlayfs) so theapps/webtestcontainers Vitest suite runs.start.sh— brings up services and syncs the Prisma schema (prisma db push).dev.sh— runs the Next.js dev server (Turborepo watch) as a terminal.Lockfile fix
pnpm-lock.yaml: theapps/webimporter pinned@prisma/adapter-pg@7.9.0while the prisma catalog and package snapshot are7.9.1, so the lockfile had no entry for7.9.0. This breakspnpm install --frozen-lockfileand is currently failingmainCI. Aligned the importer to the catalog value already used bypackages/db.Why
Docker isn't available by default in the Cloud Agent VM, so PostgreSQL and Redis run natively on the docker-compose ports, keeping
.env.exampleworking unchanged. Docker is still installed and started best-effort so the testcontainers integration tests run.Validation
All commands run with Node 24.13.0 / pnpm 11.20.0.
pnpm lint+pnpm lint:wspnpm typecheckpnpm test:cipnpm buildGET /api/health{"database":"up"}bld-20260813-dd5c5251-5376-48fb-86e3-e6a70d9b1578)A screen recording of the end-to-end OTP sign-in (email → OTP from server log → authenticated
/adminpage, persisting aUserrow) is attached to the Cloud Agent run artifacts.