feat(deploy): report each deploy step with its duration #338
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #338"
general
weight: 0.35
wmadden-electric
Linked issue
n/a. Follows the deploy output investigation for the pdp-control-plane production deploy.
Summary
The pdp-control-plane production deploy on 2026-10-05 (run 37316359545) printed nothing for 4 min 25 s. In that time Composer assembled each service one after another (about 223 s for the Console service, whose runtime dependencies are traced), then checked 53 env vars (about 38 s). The final line,
Done: 32 succeeded (66.0s), is the deploy engine's apply time only. The whole step took 9 min 35 s.This PR makes
prisma deployreport each step as it starts and finishes, with how long it took, and end with the real total.What changed
deployoperation takes anonEventsink, asdestroyanddevalready do. It reports astep-startedand astep-finishedevent for each step:- load config and app
- assemble services, with one child step per service
- connect to project and branch
- check environment variables
- plan and apply
- record result
outcome,durationMsand the counts it measured. When a step fails, it and the steps around it finish asfailed. The record step still runs. AnonEventthat throws does not fail the deploy.- An assemble gets an optional
reportcallback (AssembleInput.report), like preflight's. Core never reads what goes through it. The node build adapter reportsform,filesTraced,filesStagedandbytesStaged, from the trace and copy it already does. Other adapters report nothing, and a new one needs no core change. These fields belong to the adapter and are not a stable format.- An extension's
preflightgets an optionalreportcallback. The Prisma Cloud target reportschecked,filledandmissing.prisma deploymaps the events to the CLI engine'sstep-startedandstep-finishedevents (withidandparentId), so people see each step and json mode streams them as NDJSON. After a successful deploy it reports anendpointevent per service URL.deployoperation measures the whole deploy and returns it asdurationMson its result, so library callers get the total too. The CLI prints that value. The final line now names the stage and the real total:Deployed shop to production in 9m 35s.The json result has a newdurationMsfield next tosummary. Nothing was removed from the result.recordstep starts and finishes in one place, together with closing the reporting sessions and writing the run report. It runs after a success, a failure or a thrown error.No change is needed in
@prisma/cli-engine(prisma/prisma-cli). The engine's human renderer prints only the step text, so a finished step puts its duration in the text, for exampleassemble console (3m 42s). The number is also indata.durationMs.Example output
A person in a terminal sees this, with the engine's own output between
plan and applylines as today:In json mode, which is also what CI gets because stdout is not a terminal:
The timings above are from the 2026-10-05 run, replayed through the test CLI. No real deploy was run for this PR.
What is not included
failedwithout counts. The error message already lists each missing name.Related
A separate cloud-deploy-action PR streams the CLI's output line by line instead of buffering it. With both, these events appear in the CI log as they happen.
Testing performed
pnpm build && pnpm typecheck && pnpm lint && pnpm testpass (66 test tasks, 0 failures;@internal/cli226 pass,@internal/prisma-cloud392 pass,@internal/node35 pass).pnpm test:scripts,pnpm lint:deps,test:types,check:floor-imports,check:cli-engine-pin,check:skill-packagingandcheck:family-static-graphpass.- The deploy operation reports every step in order, each finished step has a duration, and the assemble and preflight data arrive.
- A failing assemble closes the service step and the assemble step as failed, then records the result.
- An
onEventthat throws does not fail the deploy.-
prisma deployrenders steps with durations, the endpoint line and the total in human mode, and streams ids,parentId, data, endpoints anddurationMsin json mode.- The node adapter reports through
reportfor both of its build shapes, and the assemble event carries what the adapter reported. A type test checks the tworeportcallbacks and thatBundlecarries no measurements.- The
recordstep closes after a success, a failure and a thrown error, and the operation returns the total.- The Prisma Cloud preflight reports checked, filled and missing, and a fill that lost a 409 race is not counted.
Checklist
git commit -s) per the DCO.🤖 Generated with Claude Code