fix: substitute known NextAction params in human output#41
Merged
Conversation
Human output's "Next steps" footer echoed a NextAction's command template verbatim, so any concrete value set via NextActionParam::value (e.g. a freshly issued quote token) never replaced its <placeholder>, leaving users to copy-paste a literal <token> that doesn't exist.
There was a problem hiding this comment.
Pull request overview
Improves cli-engine human output rendering for NextAction follow-ups by substituting any known NextActionParam::value(...) entries into <placeholder> command templates, while leaving required-only hints as literal placeholders for the user.
Changes:
- Human output “Next steps” now substitutes
<key>placeholders withparams[key].valuewhen present. - Added unit tests covering substitution vs. leaving placeholders untouched when no concrete value exists.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Update the append_next_actions doc comment, which still described the pre-substitution behavior of showing placeholders verbatim. - Return Cow<str> from substitute_known_params instead of always allocating a new String, skipping the allocation when no param has a known value.
The struct doc comment and two envelope tests still used a {{key}} mustache-
style example for NextAction::command, but the only real placeholder
convention in use — the human-output substitution added in this branch, and
every NextAction call site in the downstream CLI — is <key> (angle
brackets). Update the doc comment and test fixtures to match so they don't
mislead a future caller into using a syntax substitution never recognizes.
jbrooks2-godaddy
approved these changes
Jul 8, 2026
jpage-godaddy
pushed a commit
that referenced
this pull request
Jul 8, 2026
🤖 I have created a release *beep* *boop* --- ## [0.4.1](cli-engine-v0.4.0...cli-engine-v0.4.1) (2026-07-08) ### Bug Fixes * substitute known NextAction params in human output ([#41](#41)) ([86b4bd7](86b4bd7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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.
Summary
append_next_actionsechoed aNextAction's command template verbatim in human output, so a<placeholder>never got replaced even when the caller had already set a concrete value viaNextActionParam::value(...).substitute_known_params: fills<key>in the command string withparams[key].valuewhen present, leaving it as literal placeholder text when the param is only arequired()/enumhint with no known value. ReturnsCow<str>to avoid allocating when nothing has a known value.envelope.rs's doc comment and two test fixtures with the<key>angle-bracket placeholder convention actually used everywhere (they showed a stale{{key}}mustache-style example predating this feature).Test plan
cargo test— new caseshuman_output_substitutes_known_next_action_paramsandhuman_output_leaves_placeholder_without_a_known_value, plus existinghuman_output_appends_next_steps_footer(no params → no substitution) still passcargo clippy -- -D warnings,cargo fmt --checkgodaddy-clibinary (gddy domain quote) via a temporary[patch.crates-io]path override — the real quote token now substitutes into the printed "Next steps" line instead of a literal<token>