Skip to content

feat: update to template_metadata 0.5 with supersedes and commit_hash#122

Merged
sdbondi merged 5 commits into
mainfrom
feat/template-metadata-0.5
Apr 20, 2026
Merged

feat: update to template_metadata 0.5 with supersedes and commit_hash#122
sdbondi merged 5 commits into
mainfrom
feat/template-metadata-0.5

Conversation

@sdbondi
Copy link
Copy Markdown
Member

@sdbondi sdbondi commented Apr 15, 2026

Summary

  • Bump tari_ootle_template_metadata to 0.5 and tari_ootle_template_build to 0.5
  • Add --supersedes CLI arg to tari template init (interactive prompt + Cargo.toml writer)
  • Display commit_hash and supersedes fields in tari template inspect and tari template publish
  • Temporary [patch.crates-io] section for local Ootle path deps until next coordinated release

Test plan

  • cargo test — all 7 tests pass
  • Manual: tari template init --supersedes <addr> writes to Cargo.toml
  • Manual: tari template inspect displays new fields

… 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
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Cargo.toml Outdated
Comment thread crates/cli/src/cli/commands/template/init_metadata.rs Outdated
Comment thread crates/cli/src/cli/commands/template/init_metadata.rs Outdated
sdbondi and others added 4 commits April 20, 2026 11:26
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>
@sdbondi sdbondi merged commit 7cdfa8b into main Apr 20, 2026
4 checks passed
@sdbondi sdbondi deleted the feat/template-metadata-0.5 branch April 20, 2026 07:51
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.

1 participant