feat(engine): a child-status settlement carries the command's own error - #276
Draft
AmanVarshney01 wants to merge 2 commits into
Draft
AmanVarshney01 wants to merge 2 commits into
AmanVarshney01 wants to merge 2 commits into
Conversation
A command that delegates to a child process settles a failed child with exitWithChildStatus, and in json mode the engine named every such failure CLI.CHILD_PROCESS_FAILED. The command often knows a precise structured error for the failure (Composer builds DEPLOY.ENGINE_FAILED) but had no way to hand it over while still exiting with the child's status, so automation saw only the generic code. exitWithChildStatus now accepts `error`, a CliStructuredError. For a child that exited non-zero, the json envelope carries that error's code, summary, why, where and meta through the same conversion settleErrored uses; its next actions lead the settlement's, and its accompanying diagnostics are reported alongside it. The engine still writes the child's exitCode and signal into error.meta from its own record, over any keys of those names, and the process exit code is still the child's. Unchanged: a child that exited 0, a signal-killed child (still CLI.CHILD_PROCESS_FAILED with no next actions), human and markdown output (the child owned the terminal, so the error is not printed), and every settlement with no error attached. Engine 0.4.1 (`pnpm bump-cli-engine-version patch`): the public surface grew and 0.4.0 is already published. Known failing: `pnpm check:conformance` reports engine-pin-mismatch, because @prisma/composer-cli and @prisma/orm-toolchain peer the engine exactly and still peer 0.4.0. Earlier engine bumps (#222, #224, #260) carried this with transition entries in the conformance exception list; that list is left empty here for a maintainer to decide. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
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: trueComment |
commit: |
Shortens the added doc comments in spawn.ts and settlement.ts, restores the neighbouring comments this branch reworded, folds the docs into one bullet and one sentence, and cuts the new tests to three sharing one setup. No behaviour change. Co-Authored-By: Claude Fable 5.1 <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.
A command that delegates to a child (
prisma deploy→ Composer → alchemy) settles a failed child withexitWithChildStatus. In json mode the engine named every such failureCLI.CHILD_PROCESS_FAILED, even when the command had built a precise error (DEPLOY.ENGINE_FAILEDwith diagnostics). Automation sees only the generic code; in create-prisma 0.13.1 telemetry it is 14 of 65 deploy-path failures, none diagnosable.exitWithChildStatus({ error }): an optionalCliStructuredError. For a child that exited non-zero the json envelope carries it through the existing conversion (diagnosticOf,emitErrored). The engine still writes the child'sexitCode/signalintoerror.meta, and the process still exits with the child's code.CLI.CHILD_PROCESS_FAILED), human/markdown output, and the envelope when no error is attached.pnpm bump-cli-engine-version patch).Open, needs a maintainer decision: the bump makes
check:conformancereport 6engine-pin-mismatchfindings because composer-cli and orm-toolchain peer 0.4.0 exactly. Earlier bumps (#222, #224, #260) carried this with two transition entries inpackages/cli/scripts/conformance.ts. They are NOT added here, soTestis red.Follow-up in prisma/composer:
settleConvergeFailurepasseserror: toEngineError(failure)once composer-cli peers engine 0.4.1.Lint, typecheck, engine tests,
check:error-referenceandcheck-engine-versionpass.🤖 Generated with Claude Code