From e52b94da68c672927d72bb56f875385a8d0f1dd9 Mon Sep 17 00:00:00 2001 From: Artem Rys Date: Fri, 24 Jan 2025 16:59:18 +0100 Subject: [PATCH 1/6] fix: do not require calls of _reload endpoint --- .../commands/rest_builder/endpoint/base.py | 7 ++++++- .../commands/rest_builder/endpoint/multiple_model.py | 2 ++ .../commands/rest_builder/endpoint/single_model.py | 4 +++- .../commands/rest_builder/global_config_builder_schema.py | 3 +++ splunk_add_on_ucc_framework/install_python_libraries.py | 2 +- .../bin/splunk_ta_uccexample_rh_account.py | 3 ++- .../bin/splunk_ta_uccexample_rh_settings.py | 1 + .../bin/splunk_ta_uccexample_rh_account.py | 3 ++- .../bin/splunk_ta_uccexample_rh_settings.py | 1 + .../package_files_conflict_test/globalConfig.json | 2 +- .../package_global_config_everything/globalConfig.json | 2 +- .../globalConfig.json | 2 +- .../package_global_config_multi_input/globalConfig.json | 2 +- .../package_global_config_only_one_tab/globalConfig.json | 2 +- tests/unit/test_install_python_libraries.py | 4 ++-- 15 files changed, 28 insertions(+), 12 deletions(-) diff --git a/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/base.py b/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/base.py index 0d620cd92..621c4136b 100644 --- a/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/base.py +++ b/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/base.py @@ -123,7 +123,7 @@ def generate_rh(self) -> str: class RestEndpointBuilder: - def __init__(self, name: Optional[str], namespace: str, **kwargs: str): + def __init__(self, name: Optional[str], namespace: str, **kwargs: Any): self._name = name self._namespace = namespace self._entities: List[RestEntityBuilder] = [] @@ -144,6 +144,7 @@ def __init__(self, name: Optional[str], namespace: str, **kwargs: str): self._rest_handler_name = f"{self._namespace}_rh_{self._name}" self._rest_handler_module = kwargs.get("rest_handler_module") self._rest_handler_class = kwargs.get("rest_handler_class") + self._need_reload = kwargs.get("need_reload", True) @property def name(self) -> str: @@ -173,6 +174,10 @@ def rh_class(self) -> Optional[str]: def entities(self) -> List[RestEntityBuilder]: return self._entities + @property + def need_reload(self) -> bool: + return self._need_reload + def add_entity(self, entity: RestEntityBuilder) -> None: self._entities.append(entity) diff --git a/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/multiple_model.py b/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/multiple_model.py index ff4aa8061..3cffdbce9 100644 --- a/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/multiple_model.py +++ b/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/multiple_model.py @@ -57,6 +57,7 @@ class MultipleModelEndpointBuilder(RestEndpointBuilder): models=[ {models} ], + need_reload={need_reload}, ) @@ -81,4 +82,5 @@ def generate_rh(self) -> str: entities="\n".join(entities), models=indent(models_lines, 2), conf_name=self.conf_name, + need_reload=self.need_reload, ) diff --git a/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/single_model.py b/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/single_model.py index 24e2c560d..f79bb2af3 100644 --- a/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/single_model.py +++ b/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/single_model.py @@ -62,7 +62,8 @@ class SingleModelEndpointBuilder(RestEndpointBuilder): endpoint = SingleModel( '{conf_name}', model, - config_name='{config_name}' + config_name='{config_name}', + need_reload={need_reload}, ) @@ -85,4 +86,5 @@ def generate_rh(self) -> str: entity=entity.generate_rh(), conf_name=self.conf_name, config_name=self._name, + need_reload=self.need_reload, ) diff --git a/splunk_add_on_ucc_framework/commands/rest_builder/global_config_builder_schema.py b/splunk_add_on_ucc_framework/commands/rest_builder/global_config_builder_schema.py index 4d9ef94ef..4f0e12df0 100644 --- a/splunk_add_on_ucc_framework/commands/rest_builder/global_config_builder_schema.py +++ b/splunk_add_on_ucc_framework/commands/rest_builder/global_config_builder_schema.py @@ -102,6 +102,7 @@ def _builder_configs(self) -> None: rest_handler_class=config.get( "restHandlerClass", REST_HANDLER_DEFAULT_CLASS ), + need_reload=False, ) self._endpoints[name] = endpoint content = self._get_oauth_enitities(config["entity"]) @@ -140,6 +141,7 @@ def _builder_settings(self) -> None: namespace=self.global_config.namespace, rest_handler_module=REST_HANDLER_DEFAULT_MODULE, rest_handler_class=REST_HANDLER_DEFAULT_CLASS, + need_reload=False, ) self._endpoints["settings"] = endpoint for setting in self.global_config.settings: @@ -173,6 +175,7 @@ def _builder_inputs(self) -> None: rest_handler_name=rest_handler_name, rest_handler_module=rest_handler_module, rest_handler_class=rest_handler_class, + need_reload=False, ) self._endpoints[name] = single_model_endpoint content = self._get_oauth_enitities(input_item["entity"]) diff --git a/splunk_add_on_ucc_framework/install_python_libraries.py b/splunk_add_on_ucc_framework/install_python_libraries.py index d62d74ee4..efaeb20bc 100644 --- a/splunk_add_on_ucc_framework/install_python_libraries.py +++ b/splunk_add_on_ucc_framework/install_python_libraries.py @@ -28,7 +28,7 @@ logger = logging.getLogger("ucc_gen") -LIBS_REQUIRED_FOR_UI = {"splunktaucclib": "6.4.0"} +LIBS_REQUIRED_FOR_UI = {"splunktaucclib": "6.5.0"} LIBS_REQUIRED_FOR_OAUTH = {"solnlib": "5.5.0"} diff --git a/tests/testdata/expected_addons/expected_output_global_config_configuration/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_account.py b/tests/testdata/expected_addons/expected_output_global_config_configuration/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_account.py index 62a50565d..644cda463 100644 --- a/tests/testdata/expected_addons/expected_output_global_config_configuration/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_account.py +++ b/tests/testdata/expected_addons/expected_output_global_config_configuration/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_account.py @@ -152,7 +152,8 @@ endpoint = SingleModel( 'splunk_ta_uccexample_account', model, - config_name='account' + config_name='account', + need_reload=False, ) diff --git a/tests/testdata/expected_addons/expected_output_global_config_configuration/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_settings.py b/tests/testdata/expected_addons/expected_output_global_config_configuration/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_settings.py index 701ec38f1..6076fa044 100644 --- a/tests/testdata/expected_addons/expected_output_global_config_configuration/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_settings.py +++ b/tests/testdata/expected_addons/expected_output_global_config_configuration/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_settings.py @@ -172,6 +172,7 @@ model_logging, model_custom_abc ], + need_reload=False, ) diff --git a/tests/testdata/expected_addons/expected_output_global_config_everything/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_account.py b/tests/testdata/expected_addons/expected_output_global_config_everything/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_account.py index a321bc1c2..784538f3f 100644 --- a/tests/testdata/expected_addons/expected_output_global_config_everything/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_account.py +++ b/tests/testdata/expected_addons/expected_output_global_config_everything/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_account.py @@ -239,7 +239,8 @@ endpoint = SingleModel( 'splunk_ta_uccexample_account', model, - config_name='account' + config_name='account', + need_reload=False, ) diff --git a/tests/testdata/expected_addons/expected_output_global_config_everything/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_settings.py b/tests/testdata/expected_addons/expected_output_global_config_everything/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_settings.py index 90d173b7c..17f2c3e3a 100644 --- a/tests/testdata/expected_addons/expected_output_global_config_everything/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_settings.py +++ b/tests/testdata/expected_addons/expected_output_global_config_everything/Splunk_TA_UCCExample/bin/splunk_ta_uccexample_rh_settings.py @@ -177,6 +177,7 @@ model_logging, model_custom_abc ], + need_reload=False, ) diff --git a/tests/testdata/test_addons/package_files_conflict_test/globalConfig.json b/tests/testdata/test_addons/package_files_conflict_test/globalConfig.json index 184d29cb3..091fea5d7 100644 --- a/tests/testdata/test_addons/package_files_conflict_test/globalConfig.json +++ b/tests/testdata/test_addons/package_files_conflict_test/globalConfig.json @@ -199,7 +199,7 @@ "meta": { "name": "test_addon", "restRoot": "test_addon", - "version": "5.56.0+12f4cd8cd", + "version": "5.57.0+f11804ebf", "displayName": "This is my add-on", "schemaVersion": "0.0.9" } diff --git a/tests/testdata/test_addons/package_global_config_everything/globalConfig.json b/tests/testdata/test_addons/package_global_config_everything/globalConfig.json index bb730aadc..2b9977ff2 100644 --- a/tests/testdata/test_addons/package_global_config_everything/globalConfig.json +++ b/tests/testdata/test_addons/package_global_config_everything/globalConfig.json @@ -1897,7 +1897,7 @@ "meta": { "name": "Splunk_TA_UCCExample", "restRoot": "splunk_ta_uccexample", - "version": "5.56.0+12f4cd8cd", + "version": "5.57.0+f11804ebf", "displayName": "Splunk UCC test Add-on", "schemaVersion": "0.0.9", "supportedThemes": [ diff --git a/tests/testdata/test_addons/package_global_config_everything_uccignore/globalConfig.json b/tests/testdata/test_addons/package_global_config_everything_uccignore/globalConfig.json index aa7624300..2f1d5859a 100644 --- a/tests/testdata/test_addons/package_global_config_everything_uccignore/globalConfig.json +++ b/tests/testdata/test_addons/package_global_config_everything_uccignore/globalConfig.json @@ -1246,7 +1246,7 @@ "meta": { "name": "Splunk_TA_UCCExample", "restRoot": "splunk_ta_uccexample", - "version": "5.56.0+12f4cd8cd", + "version": "5.57.0+f11804ebf", "displayName": "Splunk UCC test Add-on", "schemaVersion": "0.0.9" } diff --git a/tests/testdata/test_addons/package_global_config_multi_input/globalConfig.json b/tests/testdata/test_addons/package_global_config_multi_input/globalConfig.json index 582030268..33a4d317a 100644 --- a/tests/testdata/test_addons/package_global_config_multi_input/globalConfig.json +++ b/tests/testdata/test_addons/package_global_config_multi_input/globalConfig.json @@ -769,7 +769,7 @@ "meta": { "name": "Splunk_TA_UCCExample", "restRoot": "splunk_ta_uccexample", - "version": "5.56.0+12f4cd8cd", + "version": "5.57.0+f11804ebf", "displayName": "Splunk UCC test Add-on", "schemaVersion": "0.0.9" } diff --git a/tests/testdata/test_addons/package_global_config_only_one_tab/globalConfig.json b/tests/testdata/test_addons/package_global_config_only_one_tab/globalConfig.json index 4dad66c1c..9edc96a6b 100644 --- a/tests/testdata/test_addons/package_global_config_only_one_tab/globalConfig.json +++ b/tests/testdata/test_addons/package_global_config_only_one_tab/globalConfig.json @@ -36,7 +36,7 @@ "meta": { "name": "Splunk_TA_UCCExample", "restRoot": "splunk_ta_uccexample", - "version": "5.56.0+12f4cd8cd", + "version": "5.57.0+f11804ebf", "displayName": "Splunk UCC test Add-on", "schemaVersion": "0.0.9" } diff --git a/tests/unit/test_install_python_libraries.py b/tests/unit/test_install_python_libraries.py index f16e60135..19d30087b 100644 --- a/tests/unit/test_install_python_libraries.py +++ b/tests/unit/test_install_python_libraries.py @@ -160,7 +160,7 @@ def test_install_libraries_when_no_splunktaucclib_is_present_but_has_ui(tmp_path expected_msg = ( f"This add-on has an UI, so the splunktaucclib is required but not found in {tmp_lib_reqs_file}. " - f"Please add it there and make sure it is at least version 6.4.0." + f"Please add it there and make sure it is at least version 6.5.0." ) with pytest.raises(SplunktaucclibNotFound) as exc: @@ -180,7 +180,7 @@ def test_install_libraries_when_wrong_splunktaucclib_is_present_but_has_ui(tmp_p tmp_lib_reqs_file = tmp_lib_path / "requirements.txt" tmp_lib_reqs_file.write_text("splunktaucclib==6.3\n") - expected_msg = "splunktaucclib found but has the wrong version. Please make sure it is at least version 6.4.0." + expected_msg = "splunktaucclib found but has the wrong version. Please make sure it is at least version 6.5.0." with pytest.raises(WrongSplunktaucclibVersion) as exc: install_python_libraries( From 200b917b1abf065adc3b329b4544af4c5f67be5e Mon Sep 17 00:00:00 2001 From: kkedziak Date: Thu, 30 Jan 2025 13:26:42 +0100 Subject: [PATCH 2/6] Add config parameter --- .../commands/rest_builder/endpoint/base.py | 2 +- .../rest_builder/global_config_builder_schema.py | 10 +++++++--- splunk_add_on_ucc_framework/global_config.py | 4 ++++ splunk_add_on_ucc_framework/schema/schema.json | 5 +++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/base.py b/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/base.py index 621c4136b..ff9ee2aa4 100644 --- a/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/base.py +++ b/splunk_add_on_ucc_framework/commands/rest_builder/endpoint/base.py @@ -144,7 +144,7 @@ def __init__(self, name: Optional[str], namespace: str, **kwargs: Any): self._rest_handler_name = f"{self._namespace}_rh_{self._name}" self._rest_handler_module = kwargs.get("rest_handler_module") self._rest_handler_class = kwargs.get("rest_handler_class") - self._need_reload = kwargs.get("need_reload", True) + self._need_reload = kwargs.get("need_reload", False) @property def name(self) -> str: diff --git a/splunk_add_on_ucc_framework/commands/rest_builder/global_config_builder_schema.py b/splunk_add_on_ucc_framework/commands/rest_builder/global_config_builder_schema.py index 4f0e12df0..7ffa1ccf4 100644 --- a/splunk_add_on_ucc_framework/commands/rest_builder/global_config_builder_schema.py +++ b/splunk_add_on_ucc_framework/commands/rest_builder/global_config_builder_schema.py @@ -84,6 +84,10 @@ def oauth_conf_file_names(self) -> List[str]: def endpoints(self) -> List[RestEndpointBuilder]: return list(self._endpoints.values()) + @property + def need_reload(self) -> bool: + return self.global_config.options.get("reloadHandlerConfigFiles", False) + def _parse_builder_schema(self) -> None: self._builder_configs() self._builder_settings() @@ -102,7 +106,7 @@ def _builder_configs(self) -> None: rest_handler_class=config.get( "restHandlerClass", REST_HANDLER_DEFAULT_CLASS ), - need_reload=False, + need_reload=self.need_reload, ) self._endpoints[name] = endpoint content = self._get_oauth_enitities(config["entity"]) @@ -141,7 +145,7 @@ def _builder_settings(self) -> None: namespace=self.global_config.namespace, rest_handler_module=REST_HANDLER_DEFAULT_MODULE, rest_handler_class=REST_HANDLER_DEFAULT_CLASS, - need_reload=False, + need_reload=self.need_reload, ) self._endpoints["settings"] = endpoint for setting in self.global_config.settings: @@ -175,7 +179,7 @@ def _builder_inputs(self) -> None: rest_handler_name=rest_handler_name, rest_handler_module=rest_handler_module, rest_handler_class=rest_handler_class, - need_reload=False, + need_reload=self.need_reload, ) self._endpoints[name] = single_model_endpoint content = self._get_oauth_enitities(input_item["entity"]) diff --git a/splunk_add_on_ucc_framework/global_config.py b/splunk_add_on_ucc_framework/global_config.py index 09716b0d1..bf35c174f 100644 --- a/splunk_add_on_ucc_framework/global_config.py +++ b/splunk_add_on_ucc_framework/global_config.py @@ -154,6 +154,10 @@ def alerts(self) -> List[Dict[str, Any]]: def meta(self) -> Dict[str, Any]: return self._content["meta"] + @property + def options(self) -> Dict[str, Any]: + return self._content.get("options", {}) + @property def namespace(self) -> str: return self.meta["restRoot"] diff --git a/splunk_add_on_ucc_framework/schema/schema.json b/splunk_add_on_ucc_framework/schema/schema.json index f5f5e7a8b..ad04dd7ab 100644 --- a/splunk_add_on_ucc_framework/schema/schema.json +++ b/splunk_add_on_ucc_framework/schema/schema.json @@ -2659,6 +2659,11 @@ "items": { "$ref": "#/definitions/RestHandler" } + }, + "reloadHandlerConfigFiles": { + "type": "boolean", + "description": "If true, the handler configuration files will be reloaded after every HTTP request, increasing the IO load on the system.", + "default": false } }, "additionalProperties": false From 93fcebe5797f3ceee389ee7015ee070d433d6e33 Mon Sep 17 00:00:00 2001 From: kkedziak Date: Thu, 30 Jan 2025 14:12:32 +0100 Subject: [PATCH 3/6] Add tests --- .../schema/schema.json | 2 +- tests/unit/test_endpoint.py | 96 +++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 tests/unit/test_endpoint.py diff --git a/splunk_add_on_ucc_framework/schema/schema.json b/splunk_add_on_ucc_framework/schema/schema.json index ad04dd7ab..ee99b79d6 100644 --- a/splunk_add_on_ucc_framework/schema/schema.json +++ b/splunk_add_on_ucc_framework/schema/schema.json @@ -2662,7 +2662,7 @@ }, "reloadHandlerConfigFiles": { "type": "boolean", - "description": "If true, the handler configuration files will be reloaded after every HTTP request, increasing the IO load on the system.", + "description": "If true, the handler configuration files will be reloaded after every HTTP request, increasing the IO load on the system. Default is false.", "default": false } }, diff --git a/tests/unit/test_endpoint.py b/tests/unit/test_endpoint.py new file mode 100644 index 000000000..aea455c07 --- /dev/null +++ b/tests/unit/test_endpoint.py @@ -0,0 +1,96 @@ +from textwrap import dedent + +import pytest + +from splunk_add_on_ucc_framework.commands.rest_builder.endpoint.multiple_model import ( + MultipleModelEndpointBuilder, +) +from splunk_add_on_ucc_framework.commands.rest_builder.endpoint.single_model import ( + SingleModelEndpointBuilder, + SingleModelEntityBuilder, +) + + +@pytest.mark.parametrize("need_reload", [True, False]) +def test_multiple_model_endpoint_builder_need_reload(need_reload): + endpoint = MultipleModelEndpointBuilder("test", "test", need_reload=need_reload) + assert endpoint.generate_rh() == dedent( + f""" + import import_declare_test + + from splunktaucclib.rest_handler.endpoint import ( + field, + validator, + RestModel, + MultipleModel, + ) + from splunktaucclib.rest_handler import admin_external, util + from None import None + import logging + + util.remove_http_proxy_env_vars() + + + + endpoint = MultipleModel( + 'test_test', + models=[ + + ], + need_reload={need_reload}, + ) + + + if __name__ == '__main__': + logging.getLogger().addHandler(logging.NullHandler()) + admin_external.handle( + endpoint, + handler=None, + ) + """ + ) + + +@pytest.mark.parametrize("need_reload", [True, False]) +def test_single_model_endpoint_builder_need_reload(need_reload): + endpoint = SingleModelEndpointBuilder("test", "test", need_reload=need_reload) + endpoint.add_entity(SingleModelEntityBuilder("test_entity", [])) + assert endpoint.generate_rh() == dedent( + f""" + import import_declare_test + + from splunktaucclib.rest_handler.endpoint import ( + field, + validator, + RestModel, + SingleModel, + ) + from splunktaucclib.rest_handler import admin_external, util + from None import None + import logging + + util.remove_http_proxy_env_vars() + + + fields = [ + + ] + model = RestModel(fields, name='test_entity') + + + endpoint = SingleModel( + 'test_test', + model, + config_name='test', + need_reload={need_reload}, + ) + + + if __name__ == '__main__': + logging.getLogger().addHandler(logging.NullHandler()) + admin_external.handle( + endpoint, + handler=None, + ) + """ + ) From 3ae77a65d595b239803da09afce590ce81f56077 Mon Sep 17 00:00:00 2001 From: kkedziak Date: Mon, 3 Feb 2025 12:57:40 +0100 Subject: [PATCH 4/6] Revert --- .../commands/rest_builder/global_config_builder_schema.py | 2 +- splunk_add_on_ucc_framework/global_config.py | 4 ---- splunk_add_on_ucc_framework/schema/schema.json | 5 ----- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/splunk_add_on_ucc_framework/commands/rest_builder/global_config_builder_schema.py b/splunk_add_on_ucc_framework/commands/rest_builder/global_config_builder_schema.py index 7ffa1ccf4..8e303ba43 100644 --- a/splunk_add_on_ucc_framework/commands/rest_builder/global_config_builder_schema.py +++ b/splunk_add_on_ucc_framework/commands/rest_builder/global_config_builder_schema.py @@ -86,7 +86,7 @@ def endpoints(self) -> List[RestEndpointBuilder]: @property def need_reload(self) -> bool: - return self.global_config.options.get("reloadHandlerConfigFiles", False) + return False def _parse_builder_schema(self) -> None: self._builder_configs() diff --git a/splunk_add_on_ucc_framework/global_config.py b/splunk_add_on_ucc_framework/global_config.py index bf35c174f..09716b0d1 100644 --- a/splunk_add_on_ucc_framework/global_config.py +++ b/splunk_add_on_ucc_framework/global_config.py @@ -154,10 +154,6 @@ def alerts(self) -> List[Dict[str, Any]]: def meta(self) -> Dict[str, Any]: return self._content["meta"] - @property - def options(self) -> Dict[str, Any]: - return self._content.get("options", {}) - @property def namespace(self) -> str: return self.meta["restRoot"] diff --git a/splunk_add_on_ucc_framework/schema/schema.json b/splunk_add_on_ucc_framework/schema/schema.json index ee99b79d6..f5f5e7a8b 100644 --- a/splunk_add_on_ucc_framework/schema/schema.json +++ b/splunk_add_on_ucc_framework/schema/schema.json @@ -2659,11 +2659,6 @@ "items": { "$ref": "#/definitions/RestHandler" } - }, - "reloadHandlerConfigFiles": { - "type": "boolean", - "description": "If true, the handler configuration files will be reloaded after every HTTP request, increasing the IO load on the system. Default is false.", - "default": false } }, "additionalProperties": false From 8cf14f1535673731400a491fee199d9083b2cdec Mon Sep 17 00:00:00 2001 From: kkedziak Date: Tue, 4 Feb 2025 16:52:46 +0100 Subject: [PATCH 5/6] Update splunktaucclib --- splunk_add_on_ucc_framework/install_python_libraries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/splunk_add_on_ucc_framework/install_python_libraries.py b/splunk_add_on_ucc_framework/install_python_libraries.py index efaeb20bc..c0ba0f180 100644 --- a/splunk_add_on_ucc_framework/install_python_libraries.py +++ b/splunk_add_on_ucc_framework/install_python_libraries.py @@ -28,7 +28,7 @@ logger = logging.getLogger("ucc_gen") -LIBS_REQUIRED_FOR_UI = {"splunktaucclib": "6.5.0"} +LIBS_REQUIRED_FOR_UI = {"splunktaucclib": "6.6.0"} LIBS_REQUIRED_FOR_OAUTH = {"solnlib": "5.5.0"} From 22a04ce8aaaf203fe5af4b2c801bd3bce3c9de2a Mon Sep 17 00:00:00 2001 From: kkedziak Date: Tue, 4 Feb 2025 16:57:55 +0100 Subject: [PATCH 6/6] Fix a test --- tests/unit/test_install_python_libraries.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_install_python_libraries.py b/tests/unit/test_install_python_libraries.py index 19d30087b..7e5968531 100644 --- a/tests/unit/test_install_python_libraries.py +++ b/tests/unit/test_install_python_libraries.py @@ -160,7 +160,7 @@ def test_install_libraries_when_no_splunktaucclib_is_present_but_has_ui(tmp_path expected_msg = ( f"This add-on has an UI, so the splunktaucclib is required but not found in {tmp_lib_reqs_file}. " - f"Please add it there and make sure it is at least version 6.5.0." + f"Please add it there and make sure it is at least version 6.6.0." ) with pytest.raises(SplunktaucclibNotFound) as exc: @@ -180,7 +180,7 @@ def test_install_libraries_when_wrong_splunktaucclib_is_present_but_has_ui(tmp_p tmp_lib_reqs_file = tmp_lib_path / "requirements.txt" tmp_lib_reqs_file.write_text("splunktaucclib==6.3\n") - expected_msg = "splunktaucclib found but has the wrong version. Please make sure it is at least version 6.5.0." + expected_msg = "splunktaucclib found but has the wrong version. Please make sure it is at least version 6.6.0." with pytest.raises(WrongSplunktaucclibVersion) as exc: install_python_libraries(