From ce34e4eeb8790b6ce5e4eda3d0eae596ea212758 Mon Sep 17 00:00:00 2001 From: Paul Leopardi Date: Thu, 8 Jan 2026 12:37:12 +1100 Subject: [PATCH 1/2] For vn13p1-am, use Github for config_root_path --- packages/um/package.py | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/packages/um/package.py b/packages/um/package.py index 3080d714..78aa1afc 100644 --- a/packages/um/package.py +++ b/packages/um/package.py @@ -277,6 +277,45 @@ def check_model_vs_sources_vs_ref( f"The value {resource_path} will be used for {sources_var}.") + def check_model_vs_root_path_vs_um_ref( + model, + config_env, + resource_path): + """ + Check the values set by the variants "config_root_path" and "um_ref" + against any existing config_root_path value in config_env, and remind + that the config_root_path value will be overridden by resource_path. + """ + root_path_var = "config_root_path" + root_path_value = spec.variants[root_path_var].value + um_ref_value = spec.variants["um_ref"].value + tty.info(f"The spec sets um_ref={um_ref_value}") + if root_path_value == "none": + # In this case, the spec value for root_path_var has not + # overridden the model configuration value, if any. + if root_path_var not in config_env: + tty.info( + f"The {model} model does not specify {root_path_var}.") + else: # root_path_var in config_env + env_value = config_env[root_path_var] + if env_value == "": + tty.info( + f"The {model} model sets {root_path_var}=''.") + else: + tty.warn( + f"The {model} model sets " + f"{root_path_var}={env_value}.") + else: # root_path_value != "none" + # In this case, the spec value for root_path_var has already + # overridden the model configuration value, if any. + assert root_path_value == config_env[root_path_var] + tty.warn(f"The spec sets {root_path_var}={root_path_value}.") + tty.info( + f"The value {resource_path} will be used for {root_path_var}.") + tty.info( + f"The config_revision will be set to the empty string.") + + spec = self.spec # Use rose-app.conf to set config options. @@ -375,6 +414,17 @@ def check_model_vs_sources_vs_ref( ref_var, resource_path) config_env[sources_var] = resource_path + if ref_var == "um_ref": + # Check and update config_root_path if necessary. + # Output appropriate warning messages. + check_model_vs_root_path_vs_um_ref( + model, + config_env, + resource_path) + # Set the config_env variables to the required values. + config_env["config_root_path"] = resource_path + config_env["config_revision"] = "" + else: # The model does not use Github URLs and ignores the ref variants. for ref_var in self._resource_cfg: From e0119c595d743dfcb6cb589bb5cc5f898ccf2fbd Mon Sep 17 00:00:00 2001 From: Paul Leopardi Date: Thu, 8 Jan 2026 13:32:25 +1100 Subject: [PATCH 2/2] Address ruff syntax check --- packages/um/package.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/um/package.py b/packages/um/package.py index 78aa1afc..70593a5b 100644 --- a/packages/um/package.py +++ b/packages/um/package.py @@ -312,8 +312,7 @@ def check_model_vs_root_path_vs_um_ref( tty.warn(f"The spec sets {root_path_var}={root_path_value}.") tty.info( f"The value {resource_path} will be used for {root_path_var}.") - tty.info( - f"The config_revision will be set to the empty string.") + tty.info("The config_revision will be set to the empty string.") spec = self.spec