Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
Loading