Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
feat: configuration field filters is now optional
Lars Wirzenius committed 9 months ago
commit 5c10459d90d3a618340eee1be3adaf41b41f7439
parent 9ab275d
1 file changed +4 -2
modified src/config.rs
@@ -23,7 +23,6 @@ const DEFAULT_STATUS_PAGE_UPDATE_INTERVAL: u64 = 10;
#[serde(deny_unknown_fields)]
pub struct Config {
    default_adapter: Option<String>,
-
    filters: Option<Vec<EventFilter>>,
    triggers: Option<Vec<TriggerConfig>>,
    report_dir: Option<PathBuf>,
    status_update_interval_seconds: Option<u64>,
@@ -32,6 +31,9 @@ pub struct Config {
    #[serde(default)]
    adapters: HashMap<String, AdapterSpec>,

+
    #[serde(default)]
+
    filters: Vec<EventFilter>,
+

    #[serde(deserialize_with = "deserialize_duration")]
    #[serde(default = "default_max_run_time")]
    max_run_time: Duration,
@@ -89,7 +91,7 @@ impl Config {
    }

    pub fn filters(&self) -> &[EventFilter] {
-
        self.filters.as_deref().unwrap_or(&[])
+
        &self.filters
    }

    pub fn to_triggers(&self) -> Vec<Trigger> {