Skip to content

feat(cli): support compute app regions#101

Merged
AmanVarshney01 merged 1 commit into
mainfrom
aman/compute-config-region
Jun 26, 2026
Merged

feat(cli): support compute app regions#101
AmanVarshney01 merged 1 commit into
mainfrom
aman/compute-config-region

Conversation

@AmanVarshney01

Copy link
Copy Markdown
Member

Summary

  • adds prisma-cli app deploy --region <region> for new app creation
  • reads typed region defaults from prisma.compute.ts through @prisma/compute-sdk@0.31.0
  • keeps existing apps in their current region; explicit --region mismatches fail with a usage error
  • documents deploy-all behavior and rejects --region as a per-app flag for bare multi-app deploys

Examples

import { defineComputeConfig } from \"@prisma/compute-sdk/config\";

export default defineComputeConfig({
  region: \"us-west-1\",
  apps: {
    api: { root: \"apps/api\", framework: \"hono\" },
    web: { root: \"apps/web\", framework: \"nextjs\", region: \"eu-west-3\" },
  },
});
prisma-cli app deploy --app my-app --region us-west-1
prisma-cli app deploy api

region only applies when deploy creates a new app. Existing apps are not moved between regions.

Testing

  • pnpm --filter @prisma/cli test
  • pnpm --recursive exec tsc --noEmit
  • pnpm lint

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2e597983-8511-4485-a9bf-b6a5c74e1cf0

📥 Commits

Reviewing files that changed from the base of the PR and between 7833e62 and 377ce7f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • docs/product/command-spec.md
  • docs/product/resource-model.md
  • packages/cli/package.json
  • packages/cli/src/commands/app/index.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/lib/app/compute-config.ts
  • packages/cli/src/lib/app/deploy-plan.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/app-env-vars.test.ts
  • packages/cli/tests/app.test.ts
  • packages/cli/tests/compute-config.test.ts
  • packages/cli/tests/deploy-plan.test.ts

Summary by CodeRabbit

  • New Features
    • app deploy now supports a --region option for newly created apps.
    • Deployment examples and help text now include region usage.
  • Bug Fixes
    • Existing apps keep their current region during deploys.
    • Deploying with a region that conflicts with an existing app now returns a clear usage error.
    • Multi-target deploys now reject per-app region overrides.
  • Documentation
    • Updated product docs to clarify how app regions are selected and when defaults apply.

Walkthrough

Updated the public docs and CLI for app deploy to add --region. Compute deploy input merging now carries region, deploy-all argv generation includes region per app, and controller logic normalizes, validates, and propagates region for app creation while preserving existing app regions. Tests were added for help text, CLI parsing, input merging, deploy planning, and region conflict cases.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding compute app region support to the CLI.
Description check ✅ Passed The description matches the changeset and accurately explains the new region behavior and validation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aman/compute-config-region
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch aman/compute-config-region

Comment @coderabbitai help to get the list of available commands.

@AmanVarshney01
AmanVarshney01 merged commit 6c89b9c into main Jun 26, 2026
10 checks passed
@AmanVarshney01
AmanVarshney01 deleted the aman/compute-config-region branch June 26, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant