diff --git a/src/deployment.rs b/src/deployment.rs index 52286c0..61f23f2 100644 --- a/src/deployment.rs +++ b/src/deployment.rs @@ -19,6 +19,10 @@ use scalo::deployment::{ base_image_from_cascade, }; +/// The chart description and the OCI image description, kept as one string so +/// the two cannot drift. +const DESCRIPTION: &str = "Vector subprocess wrapper for Kafka-to-Kafka transform pipelines"; + /// Build the deployment contract for dfe-transform-vector. /// /// This contract drives generation of: @@ -30,7 +34,7 @@ pub fn contract() -> DeploymentContract { DeploymentContract { app_name: "dfe-transform-vector".into(), binary_name: "dfe-transform-vector".into(), - description: "Vector subprocess wrapper for Kafka-to-Kafka transform pipelines".into(), + description: DESCRIPTION.into(), metrics_port: 9090, health: HealthContract { startup_budget_seconds: 120, @@ -148,11 +152,12 @@ pub fn contract() -> DeploymentContract { // scalo writes no vendor, licence or copyright of its own, so the labels // and the generated Dockerfile header carry exactly these. oci_labels: scalo::deployment::OciLabels { + title: "dfe-transform-vector".into(), + description: DESCRIPTION.into(), vendor: "HYPERI PTY LIMITED".into(), label_namespace: "io.hyperi".into(), licenses: "BUSL-1.1".into(), copyright: "(c) 2026 HYPERI PTY LIMITED".into(), - ..Default::default() }, // Reflectable config (scalo-rs#6): derived JSON Schema of the wrapper // Config + a minimal catalog. This wrapper is the Vector-owns-routing @@ -354,6 +359,16 @@ pub fn emit_dockerfile() -> String { mod tests { use super::*; + /// The OCI title and description feed the image labels and the registry + /// package page, and scalo leaves both empty unless the app sets them. + #[test] + fn test_oci_title_and_description_are_set() { + let c = contract(); + assert_eq!(c.oci_labels.title, c.app_name); + assert_eq!(c.oci_labels.description, c.description); + assert_ne!(c.oci_labels.description, ""); + } + #[test] fn test_contract_carries_reflectable_config() { let c = contract();