Skip to content

feat(recipe): inject _.cli.version and hard-error on reserved _ key#581

Closed
marc0olo wants to merge 2 commits into
mainfrom
feat/recipe-cli-version-injection
Closed

feat(recipe): inject _.cli.version and hard-error on reserved _ key#581
marc0olo wants to merge 2 commits into
mainfrom
feat/recipe-cli-version-injection

Conversation

@marc0olo

@marc0olo marc0olo commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

  • {{_.cli.version}} — recipe templates can now read the running icp-cli version string (sourced from CARGO_PKG_VERSION at compile time), allowing recipe authors to adapt behaviour across CLI versions
  • Reserved _ key is now a hard error — setting _ in a recipe's configuration: block previously silently discarded the user value; it now errors immediately, before any network I/O
  • Panic → proper error — pre-existing panic! on invalid rendered YAML is replaced with a ParseRenderedYaml error variant that includes the full rendered output

Test plan

  • cargo test -p icp --lib canister::recipe — all 5 recipe tests pass
  • cargo clippy -p icp — no warnings
  • cargo fmt --check — clean
  • Verify {{_.cli.version}} renders the correct version in a local recipe template
  • Verify setting _ in configuration: produces a clear error message before any fetch

🤖 Generated with Claude Code

marc0olo added 2 commits June 3, 2026 17:37
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.
@raymondk raymondk closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants