From 5663c81247adb40d5842dbe55da0ea9fa9d1702f Mon Sep 17 00:00:00 2001 From: Esteban Borai Date: Mon, 22 Apr 2024 15:39:58 -0400 Subject: [PATCH 1/3] feat(hub): enable `repository_url` and `repository_commit_sha` --- Cargo.lock | 1 + crates/fluvio-hub-protocol/Cargo.toml | 3 ++- crates/fluvio-hub-protocol/src/package_meta.rs | 13 ++++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ce6d1af9f..04a876ab11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2673,6 +2673,7 @@ dependencies = [ "thiserror", "toml 0.8.8", "tracing", + "url", ] [[package]] diff --git a/crates/fluvio-hub-protocol/Cargo.toml b/crates/fluvio-hub-protocol/Cargo.toml index f78bb8d18c..ef021f1248 100644 --- a/crates/fluvio-hub-protocol/Cargo.toml +++ b/crates/fluvio-hub-protocol/Cargo.toml @@ -12,12 +12,13 @@ publish = false cargo_toml = { workspace = true } const_format = { workspace = true } dirs = { workspace = true } -serde = { workspace = true, features=["derive"] } +serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } serde_yaml = { workspace = true } toml = { workspace = true } tracing = { workspace = true } thiserror = { workspace = true } +url = { workspace = true, features = ["serde"] } fluvio-controlplane-metadata = { workspace = true, features = [ "smartmodule" ] } fluvio-types = { workspace = true } diff --git a/crates/fluvio-hub-protocol/src/package_meta.rs b/crates/fluvio-hub-protocol/src/package_meta.rs index bae52c4be7..969bccb9e3 100644 --- a/crates/fluvio-hub-protocol/src/package_meta.rs +++ b/crates/fluvio-hub-protocol/src/package_meta.rs @@ -2,6 +2,7 @@ use std::default::Default; use serde::{Deserialize, Serialize}; use tracing::{info, error}; +use url::Url; use fluvio_controlplane_metadata::smartmodule::FluvioSemVersion; use fluvio_controlplane_metadata::smartmodule::SmartModulePackageKey; @@ -18,16 +19,16 @@ pub struct PackageMeta { pub name: String, pub version: String, // SemVer?, package version pub group: String, - // author: Option, pub description: String, pub license: String, + pub manifest: Vec, // Files in package, package-meta is implied, signature is omitted + pub repository_url: Option, + pub repository_commit_sha: Option, + pub tags: Option>, #[serde(default = "PackageMeta::visibility_if_missing")] pub visibility: PkgVisibility, // private is default if missing - pub manifest: Vec, // Files in package, package-meta is implied, signature is omitted - // repository: optional url - // repository-commit: optional hash - pub tags: Option>, + } #[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Default, Clone)] @@ -56,6 +57,8 @@ impl Default for PackageMeta { visibility: PkgVisibility::Private, manifest: Vec::new(), tags: None, + repository_url: None, + repository_commit_sha: None, } } } From 58e3ac7f91dbe2073b67863f8e026f36e32c6ab6 Mon Sep 17 00:00:00 2001 From: Esteban Borai Date: Mon, 22 Apr 2024 16:48:46 -0400 Subject: [PATCH 2/3] fix: fmt issues --- crates/fluvio-hub-protocol/src/package_meta.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/fluvio-hub-protocol/src/package_meta.rs b/crates/fluvio-hub-protocol/src/package_meta.rs index 969bccb9e3..30a817e2bc 100644 --- a/crates/fluvio-hub-protocol/src/package_meta.rs +++ b/crates/fluvio-hub-protocol/src/package_meta.rs @@ -28,7 +28,6 @@ pub struct PackageMeta { #[serde(default = "PackageMeta::visibility_if_missing")] pub visibility: PkgVisibility, // private is default if missing - } #[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Default, Clone)] From 9babcd76defc24cef2ed30db061acce04d984b8d Mon Sep 17 00:00:00 2001 From: Esteban Borai Date: Mon, 22 Apr 2024 19:19:02 -0400 Subject: [PATCH 3/3] fix: rm commit sha --- crates/fluvio-hub-protocol/src/package_meta.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/fluvio-hub-protocol/src/package_meta.rs b/crates/fluvio-hub-protocol/src/package_meta.rs index 30a817e2bc..3bafe846d8 100644 --- a/crates/fluvio-hub-protocol/src/package_meta.rs +++ b/crates/fluvio-hub-protocol/src/package_meta.rs @@ -23,7 +23,6 @@ pub struct PackageMeta { pub license: String, pub manifest: Vec, // Files in package, package-meta is implied, signature is omitted pub repository_url: Option, - pub repository_commit_sha: Option, pub tags: Option>, #[serde(default = "PackageMeta::visibility_if_missing")] @@ -57,7 +56,6 @@ impl Default for PackageMeta { manifest: Vec::new(), tags: None, repository_url: None, - repository_commit_sha: None, } } }