feat: update to template_metadata 0.5 with supersedes and commit_hash#122
Merged
Conversation
… support - Bump tari_ootle_template_metadata to 0.5 - Add --supersedes CLI arg to `tari template init` with interactive prompt - Display commit_hash and supersedes in `tari template inspect` and `tari template publish` - Add [patch.crates-io] for local Ootle path deps until next release
There was a problem hiding this comment.
Code Review
This pull request bumps the tari_ootle_template_metadata version to 0.5 and introduces a supersedes field to template metadata, allowing users to link a new template to a previous version. Changes include CLI updates for metadata initialization, inspection, and publishing, along with various dependency updates in Cargo.lock. Review feedback highlights a portability issue caused by relative path overrides in Cargo.toml and suggests implementing input validation and trimming for the new supersedes field.
The publish command wrote the key as `template-address` (kebab-case) but `ProjectConfig` deserialized using Rust's snake_case field names, so the saved address was silently dropped on load — causing `tari metadata publish` to fail with "No template address provided" even when the field was present. Apply `#[serde(rename_all = "kebab-case")]` at the struct level, matching `NetworkConfig`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
`args.supersedes` was passed through unmodified in non-interactive mode (leaving empty or whitespace-only strings intact) and was silently dropped in interactive mode. Normalize it via a shared helper that trims whitespace and treats empty input as `None`, and apply in both branches so the `--supersedes` flag works regardless of interactivity. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.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
tari_ootle_template_metadatato 0.5 andtari_ootle_template_buildto 0.5--supersedesCLI arg totari template init(interactive prompt + Cargo.toml writer)commit_hashandsupersedesfields intari template inspectandtari template publish[patch.crates-io]section for local Ootle path deps until next coordinated releaseTest plan
cargo test— all 7 tests passtari template init --supersedes <addr>writes to Cargo.tomltari template inspectdisplays new fields