refactor(deploy): restructure studio deploy on the shared deploy checks#1407
Open
gu-stav wants to merge 5 commits into
Open
refactor(deploy): restructure studio deploy on the shared deploy checks#1407gu-stav wants to merge 5 commits into
gu-stav wants to merge 5 commits into
Conversation
Contributor
📦 Bundle Stats —
|
| Metric | Value | vs refactor/deploy-coreapp (cb42bf2) |
|---|---|---|
| Internal (raw) | 2.7 KB | - |
| Internal (gzip) | 1.0 KB | - |
| Bundled (raw) | 11.16 MB | - |
| Bundled (gzip) | 2.10 MB | - |
| Import time | 925ms | +48ms, +5.5% |
bin:sanity
| Metric | Value | vs refactor/deploy-coreapp (cb42bf2) |
|---|---|---|
| Internal (raw) | 782 B | - |
| Internal (gzip) | 423 B | - |
| Bundled (raw) | 9.87 MB | - |
| Bundled (gzip) | 1.78 MB | - |
| Import time | 970ms | +43ms, +4.6% |
🗺️ 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-coreapp (cb42bf23)
| Metric | Value | vs refactor/deploy-coreapp (cb42bf2) |
|---|---|---|
| Internal (raw) | 106.7 KB | - |
| Internal (gzip) | 26.7 KB | - |
| Bundled (raw) | 21.72 MB | - |
| Bundled (gzip) | 3.46 MB | - |
| Import time | 811ms | +27ms, +3.4% |
🗺️ 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-coreapp (cb42bf23)
| Metric | Value | vs refactor/deploy-coreapp (cb42bf2) |
|---|---|---|
| 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.
Contributor
Coverage Delta
Comparing 8 changed files against main @ Overall Coverage
|
40e56d8 to
baf39fd
Compare
03ca34d to
5ba5e26
Compare
baf39fd to
9260e52
Compare
5ba5e26 to
6dddb52
Compare
9260e52 to
2ba1b26
Compare
6dddb52 to
847bdf1
Compare
2ba1b26 to
9e824bc
Compare
847bdf1 to
63a81c2
Compare
9e824bc to
26139a7
Compare
63a81c2 to
819d4d1
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
819d4d1 to
224aef2
Compare
224aef2 to
fab52aa
Compare
bf39e53 to
e7375aa
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e7375aa. Configure here.
1a67719 to
cb42bf2
Compare
Builds on the core app refactor: deployStudio now runs through a single createStudioDeployment using the shared checks seam, with studio target resolution (resolveStudioDeployTarget) and the studio target check added to the shared modules. With both deploy paths refactored, the two interactive adapters merge into one findUserApplication module and the two creators into createUserApplication, and cannotPromptForStudioHost gets one home. deployStudio carries the tightened seams through: it asks getWorkbench for an isWorkbenchApp boolean, and the studio target models isExternal as its own field. No behavior change — the integration deploy tests pass unchanged.
…cation
The switch's own output.error({exit}) calls were thrown inside the broad
try/catch, which re-wrapped them via output.error(error) with oclif's default
exit 2 — masking the intended exit codes. Scope the try to just the deploy
target fetch (mirroring findUserApplicationForStudio) so intentional exits
surface as thrown.
Both flows now drive a single runDeploy skeleton (fail-fast reporter + one normalized error handler) and read as the same top-to-bottom sequence of reported steps, with the ship/title/schema work pulled into named helpers. Removes the drift between the two deploy paths and their error handling.
Populates `solution` for the remaining blockers: missing organization/project id, external-host misuse, an unresolved studio/app target, and a non-deployable federated app. The dry-run report lists each under its problem.
e7375aa to
ab3c200
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Second of two PRs splitting the deploy refactor; builds on the core app PR (#1406). This one restructures the studio deploy onto the shared scaffolding introduced there.
deployStudionow runs through a singlecreateStudioDeploymentusing the same checks seam, with studio target resolution added alongside the app rules (it subsumes the inline host/URL validation). With both deploy paths refactored, the two interactive "find application" adapters collapse into one module and the two "create application" helpers into another.No behavior change — this is a restructure.
What to review
createStudioDeploymentagainst the olddeployStudio: prompts, spinners, error messages and exit codes should be unchanged.findUserApplication/createUserApplicationmodules and the studio target resolution inresolveDeployTarget.Testing
The integration deploy tests pass unchanged.
Note
Medium Risk
Large refactor of user-facing
sanity deployflows for studios and apps; risk is mitigated by claimed behavior parity and added unit tests, but regressions in prompts, exit codes, or host resolution are still possible.Overview
Restructures studio deploy (and aligns app deploy) on the shared scaffolding from the prior refactor: both entry points now go through
runDeploywith a fail-fastCheckReporter, shared package-version / auto-updates / build / output verification checks, and centralized error handling indeployRunner.Studio target resolution moves into
resolveStudioDeployTarget(including--url/studioHostvalidation andappIdprecedence), with a matching read-onlycheckStudioTargetfor dry runs. The old per-type helpers are collapsed intofindUserApplication(app + studio interactive resolution) andcreateUserApplication(core app + studio creation).Unit tests cover studio target resolution guards and
checkStudioTargetverdict mapping; integration deploy tests are unchanged per the PR description.Reviewed by Cursor Bugbot for commit ab3c200. Bugbot is set up for automated code reviews on this repo. Configure here.