d1ad08ef3a
Implement a priority-based merge system for pipeline configuration. Parameters carry their source (Base, Courier, Bakerd) and only higher-priority writers override. Migrate notification, prebake, bake, and finalize config to use ParamVal wrappers. Remove hardcoded constants and the InteractiveServer component. BREAKING CHANGE: Remove NotAvailable variant from MethodStatus enum
24 lines
1.1 KiB
Rust
24 lines
1.1 KiB
Rust
use crate::apply_field;
|
|
use serde::{Deserialize, Serialize};
|
|
use crate::{ParamVal, Writer, Overridden, traits::MergeParams};
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
#[serde(deny_unknown_fields)]
|
|
pub struct FinalizeParams {
|
|
#[serde(default)] pub artifact_retention_days: ParamVal<u32>,
|
|
}
|
|
|
|
impl MergeParams for FinalizeParams {
|
|
fn defaults() -> Self { Self { artifact_retention_days: ParamVal::new(7) } }
|
|
fn apply(&mut self, i: Self, w: Writer, ov: &mut Overridden, p: &str) {
|
|
apply_field!(self.artifact_retention_days, i.artifact_retention_days, w, ov, p, "artifact_retention_days");
|
|
}
|
|
}
|
|
impl Default for FinalizeParams { fn default() -> Self { Self::defaults() } }
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub struct FinalizeSettings { pub artifact_retention_days: u32 }
|
|
impl Default for FinalizeSettings { fn default() -> Self { FinalizeParams::defaults().into() } }
|
|
impl From<&FinalizeParams> for FinalizeSettings { fn from(p: &FinalizeParams) -> Self { Self { artifact_retention_days: p.artifact_retention_days.value } } }
|
|
impl From<FinalizeParams> for FinalizeSettings { fn from(p: FinalizeParams) -> Self { (&p).into() } }
|