Repository navigation
fix(dev): prisma dev stop reports only what it stopped, and dev and deploy flag help says what each flag does - #368
Conversation
…it stopped, and dev's flags say what they do `prisma dev stop` reported "Stopped <app>." and the same nodes every time it ran. Stopping now lists the emulator's instances and stops only those that are running, so the result names only what was running, and when nothing was the command says "Nothing of <app> was running." and still exits 0. `prisma dev url` for a stopped node said "is not running (stopped)" and blamed `prisma dev` ending, which is wrong after `prisma dev stop`. It now says the node was stopped, by `prisma dev stop` or by `prisma dev` ending, and still tells the user to run `prisma dev`. The `dev` card's --name and --fresh briefs say what the user gets instead of naming internals. deferred.md records that `prisma dev --detach` writes its URLs only to stderr, and that `prisma dev url` without a `prisma.config.ts` fails on the config section instead of DEV.NOT_STARTED_HERE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
|
✅ Gizmo reviewed 0401300 — posted 0 inline comment(s) this pass. Open findings: none Change walkthroughThis PR makes the local dev surface report what actually happened: Stop semantics (emulator-instances.ts). The service branch stops every recorded id except settled-held instances (held with no pid), and reports those with a pid or a Stopped-node message (execute-dev-current.ts). The dedicated stopped branch now reads "is stopped" with all three causes — Flag help (dev.ts, deploy.ts). Tests and docs. The three new tests in local-target-current.test.ts exercise the new stop paths against real emulators: an in-flight start is cancelled and nothing ends up listening, a backoff service is reported and stays stopped past its restart timer, and a held service is neither stopped nor reported. running-locally.md and SKILL.md mirror the new messages and stop behaviour. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Comment |
It said "Override the root node's name — the deploy's application name". It now says the app deploys under the given name instead of the one its entry module declares, as a separate app with its own services, databases and buckets, matching dev's --name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
commit: |
local-dev.md said --fresh destroys the dev stack and wipes the dev state directory, and deploy-cli.md said it tears down every local instance. It deletes the current app's local services, databases and buckets, their data and the app's entry in the directory's record, and leaves other apps run from the directory alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
The previous commit sent a stop only to instances the emulator listed as
running. An instance whose start is in flight is listed as `stopped` (a
service until its port accepts, a database until its server is up), so
Ctrl-C during a converge or rebuild, a failed converge's rollback, and
`prisma dev stop` during a rebuild left it running. Every recorded
instance is sent a stop again; only a held service with no process is
skipped, so it stays held. The listing now decides only what is reported:
a service with a process or `running` or `backoff`, a database listed
`running`.
Real-emulator tests: a stop during a slow start ends it ("stopped before
it accepted connections"), leaving it stopped with its port closed; a
service in backoff is reported and stays stopped past its restart delay;
a held service is not reported and stays held. The first fails on the
previous commit.
DEV.NOT_RUNNING for a stopped node no longer names a cause it cannot know:
it lists what stops an app's services and databases. dev's and deploy's
--name say "root module", the term the card uses, and deploy's --stage
says what a stage is. The skill says dev stop lists what it stopped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Linked issue
n/a. Rough edges found while testing the Composer 0.31.0 local-dev commands through the real
prismabinary (prisma/prisma-cli#355).Summary
Decision: the local-dev commands report what actually happened, and four flag descriptions say what the user gets instead of using internal terms.
Background
prisma devruns an app on local emulators, the processes that stand in for Prisma Cloud on your machine. Each of the app's services and databases runs there as an instance.prisma dev stopstops the app's instances, and so doesprisma devwhen it ends.prisma dev stopreports only what it stoppedBefore,
dev stoplisted every service and database the app had, whether or not it was running. A seconddev stopclaimed to stop everything again.Now it asks each emulator which of the app's instances are running and lists only those. When nothing was running, it says "Nothing of was running." and still exits 0.
It still sends a stop to every instance, running or not. An instance that is still starting reports itself as stopped until it accepts connections. If
dev stopskipped it, a Ctrl-C during startup would leave it running afterprisma devexits. The one instance it leaves alone is a service the emulator has given up on after repeated crashes: it has no process left to stop.Ctrl-C on
prisma dev, and running a different app from the same directory, use the same stop.A stopped service says what stops services
prisma dev urlfor a stopped service used to say "prisma devstops the app when it ends". That was wrong after an explicitprisma dev stop. The command can't know which cause applied, so it now lists them:prisma dev stop,prisma devending, and running another app in this directory. The fix is unchanged: runprisma dev.Flag help in plain terms
These follow the
prismaCLI's help standard. "Root module" is the term the help already uses for the<entry>argument.dev --namedev --freshdeploy --namedeploy --stagelocal-dev.mdanddeploy-cli.mdnow describe--freshthe same way: it deletes the current app's local services, databases and buckets and their data, and other apps run from the same directory keep theirs.Testing performed
local-target-current.test.ts, skipped on Windows):prisma.config.ts(control.dev-current.test.ts):devStopreports only the running service and database, then nothing on a second call.dev stoptable, the "Nothing … was running" message, and the stopped-service error.local-dev-detachandlocal-dev-store, each run on its own, since Ctrl-C uses the changed stop.pnpm typecheck,pnpm lint,pnpm lint:deps, the family import-graph check,check:skill-packaging,lint:retired-binary-name, and the website tests.Checklist
git commit -s) per the DCO. The DCO status check will block merge if any commit is missing aSigned-off-by:trailer.feat,fix,chore,docs,refactor,test,build) — PR titles drive the auto-generated release notes.n/aif the change is doc-only / refactor with no behavioural delta).Notes for the reviewer
database databaserow is correct. In the example it's a node whose address happens to bedatabase..drive/projects/emulator-commands/deferred.md:prisma dev --detachprints its URLs only as human text on stderr, while the deploy engine's log goes to stdout. That's the same cause asprisma deployhaving no plain pipe output, so the two should be fixed together.prisma dev urloutside a Composer project fails with two config errors instead of "prisma devhas not run here".Alternatives considered
dev stopand only change the wording. It would still claim to stop nodes that were already stopped.database databaserow clear, and the column names matchprisma emulator list.Agent: attila-51
🤖 Generated with Claude Code