-
Notifications
You must be signed in to change notification settings - Fork 9
feat(oci): add annotations as optional parameters to OCI push #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(oci): add annotations as optional parameters to OCI push #53
Conversation
Signed-off-by: Brooks Townsend <[email protected]>
Add support for OCI manifest annotations when pushing WebAssembly components to registries. This addresses GitHub issue wasmCloud#42 by implementing: - `--annotation key=value` parameter for custom OCI annotations (repeatable) - Convenience parameters for common OpenContainer annotations: - `--description` → org.opencontainers.image.description - `--source` → org.opencontainers.image.source - `--url` → org.opencontainers.image.url - `--version` → org.opencontainers.image.version - `--licenses` → org.opencontainers.image.licenses - `--author` → org.opencontainers.image.authors - Modified push_component function to accept annotations parameter - Custom OCI manifest creation with annotations when provided - Enhanced CLI output to display component digest - Comprehensive unit tests for annotation parsing and manifest generation - Full validation of key=value format parsing with proper error handling Examples: wash oci push registry.io/my/component:v1.0.0 component.wasm \ --annotation "custom.key=value" \ --description "My WebAssembly component" \ --version "1.0.0" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for OCI annotations to the push
command, enabling users to attach metadata to pushed WebAssembly components through both custom annotations and convenience parameters for common OpenContainer standards.
- Adds
--annotation key=value
parameter for custom OCI annotations and convenience flags for standard metadata - Updates the
push_component
function to accept optional annotations and create custom OCI manifests - Enhances push command output to display the component digest after successful operations
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
crates/wash/src/oci.rs | Adds annotation support to push_component function with manifest creation logic and comprehensive test coverage |
crates/wash/src/cli/oci.rs | Implements CLI annotation parsing, convenience parameters, and updated push command with enhanced output |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks largely good, but would be best to remove the many flags and just use annotations
. Additionally, let's add in a section in the .wash/config.json
for oci
which supports listing annotations there and picking them up during the push
process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks largely good, but would be best to remove the many flags and just use annotations
. Additionally, let's add in a section in the .wash/config.json
for oci
which supports listing annotations there and picking them up during the push
process.
- Remove convenience parameters (--description, --source, etc.) to keep only --annotation flag - Add annotation_count to tracing instrument for better observability - Simplify nested if conditions in manifest creation using filter/map pattern - Only pass annotations when non-empty to avoid unnecessary processing - Update tests to remove convenience parameter testing Addresses feedback from wasmCloud#53 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add OciConfig struct to wash configuration with annotations HashMap - Integrate OciConfig into main Config struct with proper serialization - Modify PushCommand to load annotations from config file - CLI annotations override config annotations for same keys - Add comprehensive tests for config serialization and loading - Add documentation and examples for OCI configuration Example config.json: { "oci": { "annotations": { "org.opencontainers.image.source": "https://github.com/user/repo", "org.opencontainers.image.description": "My component" } } } Addresses feedback requesting config file support for OCI annotations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Summary
--annotation key=value
parameter (repeatable) for custom OCI annotations--description
,--source
,--url
,--version
,--licenses
,--author
)Test plan
cargo +nightly fmt
Closes #42
🤖 Generated with Claude Code