Repository navigation
fix(cli): prisma deploy records a failed build of the Service on the run's build - #440
Draft
kristof-siket wants to merge 1 commit into
Draft
kristof-siket wants to merge 1 commit into
kristof-siket wants to merge 1 commit into
Conversation
…e run's build A Service deploy builds the Service first and starts Composer's deploy after it. Composer reports the deploy on the build that the deploy workflow opened, so a failed install or build reported nothing. The workflow then recorded only "prisma deploy exited with status 2". When the run has a build (--build-id, else PRISMA_BUILD_ID), the CLI now sends the failure's code and summary to it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Kristof Siket <siket@prisma.io>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
commit: |
This branch has not been deployed
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.
Why
A Service deploy (
prisma deployin a repository without acomposersection) builds the Service first: install, build, find the start. Composer's deploy runs after that, and Composer is what reports the deploy on the build that the deploy workflow opened (PRISMA_BUILD_ID).So a failed install or build reports nothing. prisma/cloud-deploy-action then writes its own text on the build: "
npx --yes prisma@latest deploy …exited with status 2". The platform cannot tell a failed install from a failed build, a missing start command, or a server that imports files from outside the Service folder.A production run on 2026-12-05 shows this. Between the action's "running" update and its "failed" update, 41 seconds later, the CLI sent no request to the Management API.
What changes
When the build of the Service fails and the run has a build on Prisma Cloud, the CLI sends one
PATCH /v1/builds/{buildId}:statefailedphasebuildfailingStepDEPLOY.SERVICE_INSTALL_FAILED,DEPLOY.SERVICE_BUILD_FAILED,DEPLOY.SERVICE_NO_STARTorDEPLOY.SERVICE_FILES_OUTSIDE_FOLDERerrorMessage--build-id, elsePRISMA_BUILD_ID. The flag wins and an empty value counts as unset, as in Composer.prisma/cloud-deploy-action needs no change. It already reads the build before its own failure update and keeps a failure that the CLI reported.
Not changed
connectstep on. A failure before that step (config, load, assemble) still reports nothing. That is a separate change in prisma/composer.Tests
packages/cli/tests/deploy.test.ts:PRISMA_BUILD_IDnames, with the four fields above--build-idwhen both are setLocal runs: all
@prisma/cliunit tests pass (76 files, 1534 tests),tsc --noEmitpasses, and Biome passes on the changed files.Not run locally:
pnpm --filter @prisma/cli test:e2e. It needs a service token that I do not have. No test here runs the change against the real Management API.Size
3 files, +176 −4. The test file is +122 −2 of that.
🤖 Generated with Claude Code