feat(recipe): inject _.cli.version and hard-error on reserved _ key#581
Closed
marc0olo wants to merge 2 commits into
Closed
feat(recipe): inject _.cli.version and hard-error on reserved _ key#581marc0olo wants to merge 2 commits into
_.cli.version and hard-error on reserved _ key#581marc0olo wants to merge 2 commits into
Conversation
Recipe templates can now reference the running icp-cli version via
`{{_.cli.version}}` (sourced from CARGO_PKG_VERSION at compile time),
allowing recipe authors to adapt behaviour across CLI versions.
Setting `_` in a recipe's `configuration:` block is now an explicit
error that fires before any network I/O, replacing silent override.
Also converts a pre-existing panic on invalid rendered YAML into a
proper ParseRenderedYaml error variant with full rendered output included.
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
{{_.cli.version}}— recipe templates can now read the running icp-cli version string (sourced fromCARGO_PKG_VERSIONat compile time), allowing recipe authors to adapt behaviour across CLI versions_key is now a hard error — setting_in a recipe'sconfiguration:block previously silently discarded the user value; it now errors immediately, before any network I/Opanic!on invalid rendered YAML is replaced with aParseRenderedYamlerror variant that includes the full rendered outputTest plan
cargo test -p icp --lib canister::recipe— all 5 recipe tests passcargo clippy -p icp— no warningscargo fmt --check— clean{{_.cli.version}}renders the correct version in a local recipe template_inconfiguration:produces a clear error message before any fetch🤖 Generated with Claude Code