Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions ci/nightly/pipeline.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2365,6 +2365,20 @@ steps:
agents:
queue: hetzner-aarch64-16cpu-32gb

- id: orchestratord-oidc-auth
label: Orchestratord OIDC auth end-to-end
artifact_paths: ["mz_debug_*.zip"]
depends_on: devel-docker-tags
timeout_in_minutes: 60
plugins:
- ./ci/plugins/mzcompose:
composition: orchestratord
run: oidc-auth
args: [--recreate-cluster]
ci-builder: stable
agents:
queue: hetzner-aarch64-16cpu-32gb

- id: emulator
label: Materialize Emulator
depends_on: build-aarch64
Expand Down
42 changes: 42 additions & 0 deletions src/dyncfg-file/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ fn json_to_config_val(json: &JsonValue, template: &ConfigVal) -> Result<ConfigVa
v.as_f64().ok_or_else(|| anyhow::anyhow!("not an f64"))?,
)),
(ConfigVal::String(_), JsonValue::String(v)) => Ok(ConfigVal::String(v.clone())),
(ConfigVal::OptString(_), JsonValue::Null) => Ok(ConfigVal::OptString(None)),
(ConfigVal::OptString(_), JsonValue::String(v)) => {
Ok(ConfigVal::OptString(Some(v.clone())))
}
(ConfigVal::Duration(_), JsonValue::String(v)) => {
Ok(ConfigVal::Duration(humantime::parse_duration(v)?))
}
Expand Down Expand Up @@ -240,4 +244,42 @@ mod tests {
assert_eq!(BOOL_CONFIG.get(&set), false);
assert_eq!(STRING_CONFIG.get(&set), "modified");
}

#[mz_ore::test(tokio::test)]
async fn test_file_sync_opt_string() {
const OPT_STRING_CONFIG: Config<Option<&str>> =
Config::new("test_opt_string", None, "A test optional string config");
let set = ConfigSet::default().add(&OPT_STRING_CONFIG);

let mut config_file = tempfile::NamedTempFile::new().unwrap();
config_file
.write_all(b"{\"test_opt_string\": \"hello\"}")
.unwrap();
sync_file_to_configset(
set.clone(),
&config_file,
Duration::from_secs(1),
None,
|_, _| {},
)
.await
.unwrap();
assert_eq!(OPT_STRING_CONFIG.get(&set), Some("hello".to_string()));

// null clears the value back to None
let mut config_file = tempfile::NamedTempFile::new().unwrap();
config_file
.write_all(b"{\"test_opt_string\": null}")
.unwrap();
sync_file_to_configset(
set.clone(),
&config_file,
Duration::from_secs(1),
None,
|_, _| {},
)
.await
.unwrap();
assert_eq!(OPT_STRING_CONFIG.get(&set), None);
}
}
Loading
Loading