Canonical load -> merge -> validate -> save pipeline for the project automation sidecar. Returns the merged project patch and the validated effective config; nothing is saved when validation fails.
(
dashboard_root: &Path,
global: &AutomationConfig,
patch: AutomationConfigPatch,
)
| 280 | /// automation sidecar. Returns the merged project patch and the validated |
| 281 | /// effective config; nothing is saved when validation fails. |
| 282 | pub async fn apply_project_config_patch( |
| 283 | dashboard_root: &Path, |
| 284 | global: &AutomationConfig, |
| 285 | patch: AutomationConfigPatch, |
| 286 | ) -> Result<(AutomationConfigPatch, AutomationConfig)> { |
| 287 | let current = load_project_config(dashboard_root).await?; |
| 288 | let project = merge_project_config(current, patch); |
| 289 | let effective = effective_config(global, Some(&project))?; |
| 290 | save_project_config(dashboard_root, &project).await?; |
| 291 | Ok((project, effective)) |
| 292 | } |
| 293 | |
| 294 | pub fn validate_config(config: &AutomationConfig) -> Result<()> { |
| 295 | if config.timeout_secs == 0 { |
no test coverage detected