Repository navigation
docs: shellTransform commands must print a JSON response from rift#1589 (Mountebank's contract) - #352
Merged
Conversation
…s under rift#1589 adopted Mountebank's contract: a command gets the request and response JSON as two shell arguments (and MB_REQUEST/MB_RESPONSE) and must print a JSON response object. A command that printed a plain body now breaks the response, and nothing in the SDK said so. The javadoc and the design doc now do, with the ' #' idiom, and a live check pins the documented example to the engine. Closes #339
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.
Closes #339
Why
From rift 0.24.0 (rift#1589),
shellTransformfollows Mountebank's contract:MB_REQUESTandMB_RESPONSE;A command that prints a plain body now produces an error instead of a body. The SDK passes commands through verbatim, so no code changes, but nothing documented this contract.
What
BehaviorChain.shellTransformjavadoc: the contract, the#idiom (printf '{"body":"hello"}' #), and what changed from earlier engines.docs/design/sdk-api.md: a short note in the behavior-chain block.ShellTransformReadBackIT: a new live case (SPAWN only, since injection is a spawn-CLI flag). The documented example serveshelloon engine v0.24.0.Audit: no other example or test in the repo runs a plain-body shellTransform.
Tests
verify(SPAWN, engine v0.24.0) passed;ShellTransformReadBackITran 2 tests, 0 failures.javadoc:javadoconrift-java-corepassed.🤖 Generated with Claude Code