Repository: candlecorp/wick (language: rust)

Issue:
Image push custom tag
**Is your feature request related to a problem? Please describe.**
Sometimes, the `version` and `latest` tag are not enough. It would be great to have an option to specify additional custom tags so it can be used with any existing CI/CD deployment strategy.

**Propose a solution**
```wick registry push app.wick --latest --tag=1234567 --tag=abc123 --tag=alpha```

This should push the same artifact with the following tags:
- `version` from `app.wick`
- latest
- 1234567
- abc123
- alpha

**Describe alternatives you've considered**
None

**Additional context**
None


Discussion / hints:
should we remove `--latest`? and if someone wants to use `latest` then they can specify it as `--tag=latest`

Fix patch:
diff --git a/crates/bins/wick/src/commands/registry/push.rs b/crates/bins/wick/src/commands/registry/push.rs
index 8362dbbd0..6774a85df 100644
--- a/crates/bins/wick/src/commands/registry/push.rs
+++ b/crates/bins/wick/src/commands/registry/push.rs
@@ -16,8 +16,8 @@ pub(crate) struct RegistryPushCommand {
   #[clap(flatten)]
   pub(crate) oci_opts: crate::oci::Options,
 
-  #[clap(long = "latest", action)]
-  pub(crate) latest: bool,
+  #[clap(long = "tag")]
+  pub(crate) tags: Vec<String>,
 }
 
 #[allow(clippy::unused_async)]
@@ -56,20 +56,18 @@ pub(crate) async fn handle(
   span.in_scope(|| info!(reference, "pushing artifact"));
   span.in_scope(|| debug!(options=?oci_opts, reference= &reference, "pushing reference"));
 
-  let url = if opts.latest {
-    // there must be a better way than cloning the package here, feel free to fix it.
-    let url = package.clone().push(&reference, &oci_opts).await?;
-
-    span.in_scope(|| info!(%url, "artifact pushed"));
-
-    let reference = package.tagged_reference("latest").unwrap();
-    span.in_scope(|| info!(reference, "pushing latest tag"));
-
-    package.push(&reference, &oci_opts).await?;
-    url
+  let url = if !opts.tags.is_empty() {
+    for tag in &opts.tags {
+      let mut pack = package.clone();
+      let tagged_reference = pack.tagged_reference(tag).unwrap();
+      span.in_scope(|| info!(reference = &tagged_reference, "pushing tag"));
+      pack.push(&tagged_reference, &oci_opts).await?;
+    }
+    package.push(&reference, &oci_opts).await?
   } else {
     package.push(&reference, &oci_opts).await?
   };
+
   span.in_scope(|| info!(%url, "artifact pushed"));
 
   Ok(())
diff --git a/crates/components/wick-http-client/src/component.rs b/crates/components/wick-http-client/src/component.rs
index 9fe64d83a..9ce604fee 100644
--- a/crates/components/wick-http-client/src/component.rs
+++ b/crates/components/wick-http-client/src/component.rs
@@ -128,6 +128,8 @@ async fn handle(
     }
     let inputs = Value::Object(inputs);
 
+    invocation.trace(|| trace!(inputs=?inputs, "request inputs"));
+
     let body = match opdef.body() {
       Some(body) => match body.render(&inputs) {
         Ok(p) => Some(p),


Test patch: