From 2130f76b672c6be529d264fd3249be8097310dd4 Mon Sep 17 00:00:00 2001 From: Afreen Sikandara Date: Mon, 15 Jun 2026 15:46:15 +0800 Subject: [PATCH 1/2] Fix liquibase sensitive data store error --- .../data_management_plugin/liquibase.py | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/plugins/flows/data_management/data_management_plugin/liquibase.py b/plugins/flows/data_management/data_management_plugin/liquibase.py index b7d6f16286..3d7c137c49 100644 --- a/plugins/flows/data_management/data_management_plugin/liquibase.py +++ b/plugins/flows/data_management/data_management_plugin/liquibase.py @@ -1,4 +1,3 @@ -import os from re import sub from enum import Enum from typing import List @@ -65,9 +64,6 @@ def create_params(self) -> List: # path to liquibase executable liquibase_path = Variable.get("liquibase_path") if Variable.get( "liquibase_path") else "/app/liquibase/liquibase" - liquibase_dir = os.path.dirname(liquibase_path) - liquibase_properties = os.path.join( - liquibase_dir, 'liquibase.properties') hana_driver_class_path = Variable.get("hana_driver_class_path") if Variable.get( "hana_driver_class_path") else "/app/liquibase/lib/ngdbc-latest.jar" @@ -83,7 +79,7 @@ def create_params(self) -> List: classpath = f"{postgres_driver_class_path}:{self.plugin_classpath}" driver = "org.postgresql.Driver" connection_base_url = f'jdbc:postgresql://{host}:{port}/{database_name}?' - connection_properties = f'user={admin_user}&password={admin_password}¤tSchema="{self.schema_name.lower()}"' + connection_properties = f'currentSchema="{self.schema_name.lower()}"' params = [ liquibase_path, @@ -94,20 +90,13 @@ def create_params(self) -> List: f"--logLevel={Variable.get('lb_log_level') if Variable.get('lb_log_level') else 'INFO'}", f"--defaultSchemaName={self.schema_name}", f"--liquibaseSchemaName={self.schema_name}", - f"--defaults-file={liquibase_properties}" + f"--url={connection_base_url}{connection_properties}", + f"--password={admin_password}", ] if self.tenant_configs.authMode != AuthMode.JWT: params.append(f"--username={admin_user}") - # Temporarily create liquibase.properties for sensitive values - # Won't be logged in traceback - with open(liquibase_properties, 'w') as file: - file.write(f''' - url: {connection_base_url}{connection_properties} - password: {admin_password} - ''') - match self.action: case LiquibaseAction.STATUS: params.append("--verbose") @@ -140,8 +129,8 @@ def update_schema(self): liquibase_error_message = self._mask_secrets(self._find_error_message( liquibase_msg_list), "***") raise RuntimeError( - # from cpe - f"Liquibase failed to run with return code '{cpe.returncode}': {liquibase_error_message}") + f"Liquibase failed to run with return code '{cpe.returncode}': {liquibase_error_message}" + ) from None else: print(f"Successfully ran liquibase command '{params[1]}'") @@ -162,7 +151,8 @@ def get_latest_available_version(self) -> str: liquibase_error_message = self._mask_secrets(self._find_error_message( liquibase_msg_list), "***") raise RuntimeError( - f"Liquibase failed to run with return code '{cpe.returncode}': {liquibase_error_message}") + f"Liquibase failed to run with return code '{cpe.returncode}': {liquibase_error_message}" + ) from None else: print(f"Successfully ran liquibase command '{params[1]}'") liquibase_msg_list = liquibase_msg_masked.split("\n") @@ -181,6 +171,8 @@ def _find_error_message(self, liquibase_stdout: List) -> str: for output in liquibase_stdout: if LB_ERROR_MESSAGE_REGEX.search(output): return output + # Output did not match the expected error format + return "No error message found in liquibase output, check the logs above for details" def _mask_secrets(self, text, replacement): text = sub(PASSWORD_REGEX, replacement, text) # mask password From f0835400149897cdf6aa967dc3076522f09868af Mon Sep 17 00:00:00 2001 From: Afreen Sikandara Date: Mon, 15 Jun 2026 15:46:23 +0800 Subject: [PATCH 2/2] Fix create cache plugin --- plugins/flows/base/create_cachedb_file_plugin/flow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/flows/base/create_cachedb_file_plugin/flow.py b/plugins/flows/base/create_cachedb_file_plugin/flow.py index 109eef7f49..74476e5ee7 100644 --- a/plugins/flows/base/create_cachedb_file_plugin/flow.py +++ b/plugins/flows/base/create_cachedb_file_plugin/flow.py @@ -26,7 +26,8 @@ def create_cachedb_file_plugin(options: CreateCacheOptions): match options.flow_action_type: case CacheFlowAction.CREATE_DATAMART_CACHE: create_cache_flow(options) - has_snapshot_config = bool(options.snapshot_copy_config) + snap = options.snapshot_copy_config + has_snapshot_config = bool(snap and (snap.timestamp or snap.table_config or snap.patients_to_be_copied)) if options.results_schema_name and options.schema_name != options.results_schema_name and not has_snapshot_config: create_results_cache_flow(options)