refactor(prisma-cloud): deploy identity has one reader in the extension#137
Closed
wmadden-electric wants to merge 3 commits into
Closed
refactor(prisma-cloud): deploy identity has one reader in the extension#137wmadden-electric wants to merge 3 commits into
wmadden-electric wants to merge 3 commits into
Conversation
…pplicationOf guard projectIdOf now delegates to cloudApplicationOf, and application.provision returns branchId alongside projectId — the first step toward every descriptor reading deploy identity through the application product instead of ResolvedCloudOptions directly. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…onOf, not ResolvedCloudOptions postgres.ts, compute.ts, and prisma-next.ts stop reading o.branchId directly; they read the narrowed application product instead, so exports/control.ts becomes the only remaining consumer of the env-fed id. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Every manually-constructed ctx.application stub now carries branchId alongside projectId, matching the real application product shape; the provision-hook assertions and isCloudApplication negative cases cover the new field. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
commit: |
wmadden
approved these changes
Jul 21, 2026
Contributor
Author
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.
Part 1 of Decouple CLI from Prisma Cloud (TML-3057). Behavior-invariant refactor inside
packages/1-prisma-cloud/1-extensions/target/— prep for part 2, which moves container resolution behind the extension descriptor and deletes thecli → loweringcross-domain exception.What changes
CloudApplication(the application hook's product) now carriesbranchIdbesideprojectId;isCloudApplicationchecks the new field.cloudApplicationOf(application)narrow-or-throw;projectIdOfdelegates to it.postgres,compute,prisma-next) readbranchIdfrom the narrowed application product instead of fromResolvedCloudOptions.Why
After this PR,
control.ts'sapplication.provisionis the only consumer of the env-fedprojectId/branchIdin the extension. Part 2 swaps that single site to the opaque container context the CLI will hand through the extension hooks — one edit instead of six.Verification
grep -rn "o\.projectId\|o\.branchId" packages/1-prisma-cloud/1-extensions/target/src/descriptors/→ empty.pnpm typecheck && pnpm test && pnpm lint && pnpm lint:casts && pnpm lint:depsall green; cast-ratchet delta 0.application.provisioncopieso.branchIdinto the product).🤖 Generated with Claude Code