fix: report the deployed URL so the Console can show the live preview - #5
Merged
Conversation
A successful Prisma Cloud deploy reported its build as succeeded but never
recorded the deployed preview URL, so the Console left its provisional
project card on a deploying spinner forever — the card links the live
preview from Build.deployedUrl, which stayed null.
The action reported create, phase updates, and { state: "succeeded" }, but
never captured the deployed address or PATCHed deployedUrl. On a successful
deploy it now reads the compute service's https://<hash>.<region>.prisma.build
address from Composer's deploy report and fills deployedUrl on the succeeded
report, guarded like every other report (warn-only, never fails the deploy).
Released Composer (0.6.0) prints the address only as human text, so the URL
is read from the captured deploy output, anchored to the .prisma.build suffix.
The deploy phase's stdout is now captured and re-emitted at phase end so the
report can be parsed. When Composer emits the deploy result as data, the
action should read the URL from there instead.
Signed-off-by: Kristof Siket <siket@prisma.io>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
kristof-siket
force-pushed
the
fix/report-deployed-url
branch
from
August 17, 2026 11:14
1c4907c to
1d901eb
Compare
kristof-siket
marked this pull request as ready for review
August 17, 2026 11:20
Signed-off-by: Kristof Siket <siket@prisma.io> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
The bug
When a repo is connected through Prisma Cloud's workspace-level flow, a GitHub Actions workflow runs this action, which deploys with
prisma-composer deployand reports a Build to the Management API. On prod, a real deploy fully succeeded (buildbld_cmsx3cfab27hb19ee15ncv0wm,state=succeeded) but the Build row'sdeployedUrlwas null.The Console's provisional-project card shows "preview live" with a clickable URL only when
Build.deployedUrlis set. With a succeeded build and a nulldeployedUrl, the card sits on a deploying spinner forever.Root cause is here in the action: it reports create → phase updates →
{ state: "succeeded" }and setsexternalLogUrl(the Actions run URL) at creation, but it never captures the deployed preview URL and PATCHesdeployedUrl.Where the deployed URL comes from
Composer's deploy prints the deployed compute service's public address —
https://<hash>.<region>.prisma.build— on its own line in the deployment report. From the real run:I checked whether the pinned Composer exposes this machine-readably:
@prisma/composer@0.6.0(what the action pins) does not. Its CLI bin has no--jsondeploy result and no deploy-result summary protocol — the address exists only in the human-rendered report above.summary.nodes[].entities[].urlcarries exactly this.prisma.buildaddress — does exist in Composermain(added 2026-08-07, after thev0.6.0tag of 2026-08-03), but it is unreleased. It is also currently an internal cross-process protocol: Composer generates its own result-file path, reads it, and deletes it, so the action can't consume that file even onmain.So today there is no machine-readable source the action can read against the released Composer.
The change
On a successful deploy, the action now reads the
.prisma.buildaddress from Composer's deploy output and fillsdeployedUrlon the succeeded report:runPhasegained an opt-in capture for the deploy phase — stdout is piped so the report can be read, then written back so the phase still shows in the log (as a block at phase end; stderr stays inherited and live). Other phases are unchanged.deployment.mjs) pulls the address with a regex anchored tightly to the.prisma.buildsuffix, so nothing else in the log (the Actions run URL, the API host, a connection string) can match. It strips SGR color escapes first and returns the first address (a single-service app — the setup-PR shape — prints exactly one).deployedUrlis folded into the existing{ state: "succeeded" }PATCH, guarded like every other report (guardReport): a missing address or a failed report call is a warning and never fails the deploy.deployedUrlis fill-only on the Builds API.Trade-off to weigh (why this is a draft)
The URL is parsed from Composer's human output, which Composer treats as presentation, not a contract. The parse is tightly anchored and tested, and it fixes the stuck card against the Composer we ship today. It is a bridge, not the end state.
Composer follow-up (recommended, unblocks retiring the parse)
Expose the deploy result in a machine-readable form the action can consume — the clean option is a
--jsondeploy result on stdout carrying each deployed service's public URL (summary.nodes[].entities[].url). Thejsonrenderer for this already exists in Composermain(PR #205); the work is releasing it and guaranteeing the--jsondeploy result is clean, parseable stdout. Once released (and the action's pinnedcomposer-versionis bumped), the action should read the URL from that result and drop the text parse. Tracked as a limitation in the README.Testing
deployment.mjsextractor: 8 unit tests — real deploy-report shape, multi-service (first wins), ignores the Actions run URL / API host, tolerates surrounding color escapes, keeps a path suffix, rejects a.buildlookalike, null/empty-safe.tests/suite (it previously ran only the credentials test), so the new tests are gated. All 34 tests pass;node --checkpasses for every script; theaction.ymlsanity check passes (no input/output surface change).Not done here
No Composer changes (out of scope for this PR). No new action inputs/outputs.