feat(deploy): add --dry-run flag for instant deployability feedback#1255
feat(deploy): add --dry-run flag for instant deployability feedback#1255gu-stav wants to merge 1 commit into
Conversation
📦 Bundle Stats —
|
| Metric | Value | vs refactor/deploy-target-resolution (2a4579f) |
|---|---|---|
| Internal (raw) | 2.7 KB | - |
| Internal (gzip) | 1.0 KB | - |
| Bundled (raw) | 11.16 MB | - |
| Bundled (gzip) | 2.10 MB | - |
| Import time | 867ms | +7ms, +0.8% |
bin:sanity
| Metric | Value | vs refactor/deploy-target-resolution (2a4579f) |
|---|---|---|
| Internal (raw) | 782 B | - |
| Internal (gzip) | 423 B | - |
| Bundled (raw) | 9.87 MB | - |
| Bundled (gzip) | 1.78 MB | - |
| Import time | 2.26s | +17ms, +0.8% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against refactor/deploy-target-resolution (2a4579f9)
| Metric | Value | vs refactor/deploy-target-resolution (2a4579f) |
|---|---|---|
| Internal (raw) | 106.7 KB | - |
| Internal (gzip) | 26.7 KB | - |
| Bundled (raw) | 21.72 MB | - |
| Bundled (gzip) | 3.46 MB | - |
| Import time | 771ms | +8ms, +1.0% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — create-sanity
Compared against refactor/deploy-target-resolution (2a4579f9)
| Metric | Value | vs refactor/deploy-target-resolution (2a4579f) |
|---|---|---|
| Internal (raw) | 908 B | - |
| Internal (gzip) | 483 B | - |
| Bundled (raw) | 931 B | - |
| Bundled (gzip) | 491 B | - |
| Import time | ❌ ChildProcess denied: node | - |
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fa77286. Configure here.
|
|
||
| static override description = 'Builds and deploys Sanity Studio or application to Sanity hosting' | ||
|
|
||
| static override enableJsonFlag = true |
There was a problem hiding this comment.
Non-dry-run deploy exposes json flag
Medium Severity
enableJsonFlag applies to every sanity deploy invocation, but only the dry-run path returns a DryRunReport. A real deploy finishes with undefined, so --json advertises machine-readable output that is not defined for actual deployments.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit fa77286. Configure here.
| } | ||
|
|
||
| return report | ||
| } |
There was a problem hiding this comment.
Custom output dir prompt skipped
Medium Severity
--dry-run returns before the logic that warns when a non-default sourceDir exists and is non-empty and would prompt to proceed. Dry-run can report deployable while a normal deploy would block or cancel on that confirmation.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit fa77286. Configure here.
Coverage Delta
Comparing 7 changed files against main @ Overall Coverage
|
faad45d to
6e348e6
Compare
219e23f to
ebf7c4a
Compare
6e348e6 to
074e2b7
Compare
ebf7c4a to
dd385aa
Compare
074e2b7 to
17d7b54
Compare
dd385aa to
e95da02
Compare
`sanity deploy --dry-run` answers "can this deploy" without deploying — a
fast feedback loop for agents and CI. It runs the same createStudioDeployment /
createAppDeployment sequence read-only: target resolution returns a verdict
instead of prompting or creating, the schema worker validates and extracts
without uploading, and the output directory is listed instead of packed.
Failures aggregate so one run reports every problem, never prompts, and exits 2
when not deployable. `--json` emits the {deployable, checks, target, files}
report via oclif's enableJsonFlag, with the exit code set without throwing so
the full report still reaches stdout on failure.
17d7b54 to
2a4579f
Compare
e95da02 to
9663058
Compare


Description
sanity deploy --dry-runanswers "can this deploy" without deploying — a fast feedback loop for agents and CI. Stacked on #1254; it runs the samecreateStudioDeployment/createAppDeploymentsequence read-only:Failures aggregate instead of bailing on the first, so one run reports every problem. It never prompts — would-prompt situations become failed checks with the fix in the message — and exits 2 when not deployable.
--jsonemits the{deployable, checks, target, files}report via oclif'senableJsonFlag. The exit code is set without throwing, so the full report still reaches stdout on failure.The only new seam implementation is the aggregating checks collector; real deploys keep failing fast through the same steps, so a real deploy fails with the same message its dry run reports.
What to review
dryRunbranches increateStudioDeployment/createAppDeployment— target verdict, schema validate-only, output listing, title as a check.deployChecks.--jsonconsumers.Testing
deploy.dry-run.test.tscovers both deploy types: all-checks-pass with file listing, would-create hostname, aggregated failures with exit 2,--jsonoutput, and the would-prompt failure when no appId is configured.