From ab6b8a6a0fdd503ea6d4a2c4f6b7f65e31e93854 Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 10 Oct 2026 05:58:57 +1100 Subject: [PATCH] fix: set the OCI title and description on the transform-vector deployment contract scalo leaves oci_labels.title and oci_labels.description empty unless the app sets them, so the published contract.json and the image metadata carried neither. Set the title to dfe-transform-vector and the description to the chart description, as dfe-loader does, and pin both with a unit test. --- src/deployment.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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();