fix(engine): substitute {bin} in next actions, diagnostics, and presentation prose - #313
Draft
wmadden-electric wants to merge 1 commit into
Draft
wmadden-electric wants to merge 1 commit into
wmadden-electric wants to merge 1 commit into
Conversation
…ntation prose
Command families write {bin} and expect the renderer to name the binary the user ran. The engine substituted it only in help examples and redirect replacements, so hints such as '{bin} db migrate' were printed as written.
The engine now substitutes when a run settles, in next actions (command, commands), diagnostic and error summary and why, config section warnings, and summary and list blocks. Table, fields, tree, and drawing blocks, the json result, stdout lines, and meta are left as written.
The engine moves to 0.6.2. pnpm check:conformance fails until the two engine-pin exceptions for the 0.6.2 transition are added to packages/cli/scripts/conformance.ts.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@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: trueComment |
commit: |
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.
Not ready to merge
pnpm check:conformancefails on this branch with 6tarball/engine-pin-mismatchfindings.@prisma/composer-cliand@prisma/orm-toolchainpeer@prisma/cli-engine0.6.1, and this change ships 0.6.2.The repository's process for an engine version transition is two entries in
exceptionsinpackages/cli/scripts/conformance.ts. #280 did that for 0.6.1, and #291 removed the entries when the transition ended.That edit is not in this pull request. The automation's permission system refuses it, so a maintainer must add it. These are the two entries:
The entries must be removed once both packages release against engine 0.6.2 and this repository pins those releases. The dev channel (
PUBLISH_CHANNEL=dev) was not checked and may need its own entries.Symptom
The CLI prints a literal
{bin}in hints and messages. For example,prisma migration planends with:The same text appears in the
--jsonenvelope and in--format markdownoutput.Cause
Command families write
{bin}on purpose and expect the renderer to substitute the name of the binary the user ran. That substitution lived in the ORM's standalone CLI. It was deleted in prisma/orm#30005 when the ORM moved to the unified CLI. The engine only ever substituted{bin}in help examples and redirect replacements (resolveExample).Fix
The engine now substitutes
{bin}with the CLI name when a run settles, so human, JSON, and markdown output carry the same text.resolveExampleand the new code share one function,substituteBinName.Substituted:
commandandcommands.summary,why, and their nested next actions. This includes the envelope's top-levelnextActions.summaryandlist.Left as written, because they can hold user data:
fields,table,tree, anddrawing.result, the outcomedata, and thestdoutlines.meta.The engine version moves from 0.6.1 to 0.6.2 through
pnpm bump-cli-engine-version patch.Checks
pnpm buildpnpm typecheckpnpm lintpnpm test --concurrency=1pnpm test:scriptspnpm check:grammarpnpm check:error-referencepnpm check:skill-packagingnode scripts/check-engine-version.mjs origin/mainpnpm check:conformancetarball/engine-pin-mismatchfindings (see above)The new test file
packages/cli-engine/tests/bin-placeholder.test.tsfailed on all 7 cases before the fix. It also asserts that a table cell, a field value, the JSON result, andmetacontaining{bin}stay unchanged.🤖 Generated with Claude Code