From f0aff2837b60cad79c49d40f28ae6e2745d17f91 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 8 Oct 2020 20:07:06 -0400 Subject: [PATCH 1/7] When compiling dynamic installation confs, ensure location is actually writeable This makes it so, for example in CVMFS-using deployments, you can't accidentally try to install a tool to a non-writeable shed conf. --- lib/galaxy/tools/toolbox/base.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/tools/toolbox/base.py b/lib/galaxy/tools/toolbox/base.py index f2ca16e8160..d9dc196f536 100644 --- a/lib/galaxy/tools/toolbox/base.py +++ b/lib/galaxy/tools/toolbox/base.py @@ -216,11 +216,13 @@ class AbstractToolBox(Dictifiable, ManagesIntegratedToolPanelMixin): ) if parsing_shed_tool_conf: - shed_tool_conf_dict = dict(config_filename=config_filename, - tool_path=tool_path, - tool_cache_data_dir=tool_cache_data_dir, - config_elems=config_elems) - self._dynamic_tool_confs.append(shed_tool_conf_dict) + # if read_only mode, (CVMFS consumer) don't add to dynamic_confs + if os.access(config_filename, os.W_OK): + shed_tool_conf_dict = dict(config_filename=config_filename, + tool_path=tool_path, + tool_cache_data_dir=tool_cache_data_dir, + config_elems=config_elems) + self._dynamic_tool_confs.append(shed_tool_conf_dict) def _get_tool_by_uuid(self, tool_uuid): if tool_uuid in self._tools_by_uuid: From e08b7f92a5fa599347b3a88031817e89fa141118 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Fri, 22 Jan 2021 14:07:31 -0500 Subject: [PATCH 2/7] Fix regression of 'disabled' masthead items. Looks like this functionality (was manual class addition) never made it to the new masthead. --- client/src/components/Masthead/MastheadItem.vue | 1 + client/src/layout/menu.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/components/Masthead/MastheadItem.vue b/client/src/components/Masthead/MastheadItem.vue index d3c5119a7ec..e24d7a66873 100644 --- a/client/src/components/Masthead/MastheadItem.vue +++ b/client/src/components/Masthead/MastheadItem.vue @@ -42,6 +42,7 @@ :target="item.target || '_parent'" role="menuitem" @click="open(item, $event)" + :disabled="item.disabled === true" > {{ item.title }} diff --git a/client/src/layout/menu.js b/client/src/layout/menu.js index 9c9802da72f..bcda98c7839 100644 --- a/client/src/layout/menu.js +++ b/client/src/layout/menu.js @@ -250,7 +250,7 @@ export function fetchMenu(options = {}) { menu: [ { title: `${_l("Logged in as")} ${Galaxy.user.get("email")}`, - class: "dropdown-item disabled", + disabled: true, }, { title: _l("Preferences"), From c4d201e5c8d61eabf1a80dbddbc9470cd156f4df Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 27 Jan 2021 17:40:25 +0100 Subject: [PATCH 3/7] Resolve container_image_cache_path relative to data_dir --- lib/galaxy/config/__init__.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/galaxy/config/__init__.py b/lib/galaxy/config/__init__.py index 7d92bb69d10..5fded3efceb 100644 --- a/lib/galaxy/config/__init__.py +++ b/lib/galaxy/config/__init__.py @@ -615,11 +615,7 @@ class GalaxyAppConfiguration(BaseAppConfiguration, CommonConfigurationMixin): log.warning("preserve_python_environment set to unknown value [%s], defaulting to legacy_only") self.preserve_python_environment = "legacy_only" self.nodejs_path = kwargs.get("nodejs_path") - # Older default container cache path, I don't think anyone is using it anymore and it wasn't documented - we - # should probably drop the backward compatiblity to save the path check. self.container_image_cache_path = self._in_data_dir(kwargs.get("container_image_cache_path", "container_images")) - if not os.path.exists(self.container_image_cache_path): - self.container_image_cache_path = self._in_root_dir(kwargs.get("container_image_cache_path", self._in_data_dir("container_cache"))) self.output_size_limit = int(kwargs.get('output_size_limit', 0)) # activation_email was used until release_15.03 activation_email = kwargs.get('activation_email') From a8a85b5e096943272a5d133c5acae90c52283f01 Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Wed, 27 Jan 2021 20:01:41 +0100 Subject: [PATCH 4/7] Update default container location Co-authored-by: Nicola Soranzo --- lib/galaxy/config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/config/__init__.py b/lib/galaxy/config/__init__.py index 5fded3efceb..29cf28fa2a7 100644 --- a/lib/galaxy/config/__init__.py +++ b/lib/galaxy/config/__init__.py @@ -615,7 +615,7 @@ class GalaxyAppConfiguration(BaseAppConfiguration, CommonConfigurationMixin): log.warning("preserve_python_environment set to unknown value [%s], defaulting to legacy_only") self.preserve_python_environment = "legacy_only" self.nodejs_path = kwargs.get("nodejs_path") - self.container_image_cache_path = self._in_data_dir(kwargs.get("container_image_cache_path", "container_images")) + self.container_image_cache_path = self._in_data_dir(kwargs.get("container_image_cache_path", "container_cache")) self.output_size_limit = int(kwargs.get('output_size_limit', 0)) # activation_email was used until release_15.03 activation_email = kwargs.get('activation_email') From 88d7c4bb798d884b410213738f1bf21ae219070b Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 29 Jan 2021 15:43:07 +0100 Subject: [PATCH 5/7] Fix tool version switch in workflow editor Fixes https://github.com/galaxyproject/galaxy/issues/10914 --- client/src/components/Workflow/Editor/Node.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/components/Workflow/Editor/Node.vue b/client/src/components/Workflow/Editor/Node.vue index b636928d8e1..1cbd9f3f31a 100644 --- a/client/src/components/Workflow/Editor/Node.vue +++ b/client/src/components/Workflow/Editor/Node.vue @@ -294,6 +294,7 @@ export default { }, setData(data) { this.config_form = data.config_form; + this.content_id = this.config_form?.id; this.tool_state = data.tool_state; this.errors = data.errors; this.annotation = data.annotation; From 4f56ba2d1d7cf7a5b2038c6b4d862d09b2db7e2b Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sat, 30 Jan 2021 12:22:11 +0100 Subject: [PATCH 6/7] Selenium test for tool version update --- client/src/mvc/tool/tool-form-base.js | 1 + lib/galaxy/selenium/navigates_galaxy.py | 11 ++++----- lib/galaxy/selenium/navigation.yml | 1 + .../selenium/test_workflow_editor.py | 24 +++++++++++++++++++ 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/client/src/mvc/tool/tool-form-base.js b/client/src/mvc/tool/tool-form-base.js index a71f05e8210..a93b457496e 100644 --- a/client/src/mvc/tool/tool-form-base.js +++ b/client/src/mvc/tool/tool-form-base.js @@ -149,6 +149,7 @@ export default FormBase.extend({ // button for version selection var versions_button = new Ui.ButtonMenu({ icon: "fa-cubes", + cls: "btn btn-secondary float-right tool-versions", title: options.narrow ? null : "Versions", tooltip: "Select another tool version", }); diff --git a/lib/galaxy/selenium/navigates_galaxy.py b/lib/galaxy/selenium/navigates_galaxy.py index f461a851542..af5fb4edd94 100644 --- a/lib/galaxy/selenium/navigates_galaxy.py +++ b/lib/galaxy/selenium/navigates_galaxy.py @@ -1028,18 +1028,17 @@ class NavigatesGalaxy(HasDriver): workflow_button = workflow_row.find_element_by_css_selector(workflow_selector) workflow_button.click() - def workflow_index_click_option(self, option_title, workflow_index=0): - self.workflow_click_option(".workflow-dropdown", workflow_index) + def select_dropdown_item(self, option_title): menu_element = self.wait_for_selector_visible(".dropdown-menu.show") menu_options = menu_element.find_elements_by_css_selector("a.dropdown-item") - found_option = False for menu_option in menu_options: if option_title in menu_option.text: menu_option.click() - found_option = True - break + return True - if not found_option: + def workflow_index_click_option(self, option_title, workflow_index=0): + self.workflow_click_option(".workflow-dropdown", workflow_index) + if not self.select_dropdown_item(option_title): raise AssertionError("Failed to find workflow action option with title [%s]" % option_title) def workflow_index_click_tag_display(self, workflow_index=0): diff --git a/lib/galaxy/selenium/navigation.yml b/lib/galaxy/selenium/navigation.yml index 388cfcd7b12..200edcc6adb 100644 --- a/lib/galaxy/selenium/navigation.yml +++ b/lib/galaxy/selenium/navigation.yml @@ -378,6 +378,7 @@ workflow_editor: label_input: "[tour_id='__label'] input" annotation_input: "[tour_id='__annotation'] textarea" + tool_version_button: ".tool-versions" connector_for: "div[output-handle-id='${source_id}'][input-handle-id='${sink_id}']" diff --git a/lib/galaxy_test/selenium/test_workflow_editor.py b/lib/galaxy_test/selenium/test_workflow_editor.py index ffc08b0187a..69806ed72ce 100644 --- a/lib/galaxy_test/selenium/test_workflow_editor.py +++ b/lib/galaxy_test/selenium/test_workflow_editor.py @@ -298,6 +298,30 @@ steps: self.screenshot("workflow_editor_edit_menu") self.workflow_editor_click_option("Save As") + @selenium_test + def test_editor_tool_upgrade(self): + workflow_populator = self.workflow_populator + workflow_id = workflow_populator.upload_yaml_workflow("""class: GalaxyWorkflow +inputs: [] +steps: + - tool_id: multiple_versions + tool_version: 0.1 + label: multiple_versions + state: + foo: bar + """, exact_tools=True) + self.workflow_index_open() + self.workflow_index_click_option("Edit") + editor = self.components.workflow_editor + editor.node._(label="multiple_versions").wait_for_and_click() + editor.tool_version_button.wait_for_and_click() + assert self.select_dropdown_item('Switch to 0.2'), 'Switch to tool version dropdown item not found' + self.screenshot("workflow_editor_version_update") + self.assert_has_changes_and_save() + self.sleep_for(self.wait_types.UX_RENDER) + workflow = self.workflow_populator.download_workflow(workflow_id) + assert workflow['steps']['0']['tool_version'] == '0.2' + @selenium_test def test_editor_tool_upgrade_message(self): workflow_populator = self.workflow_populator From 9f496b58dbf27171d696918a2c60c63790075241 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sat, 30 Jan 2021 15:30:35 +0100 Subject: [PATCH 7/7] Backport assert_has_changes_and_save --- lib/galaxy_test/selenium/test_workflow_editor.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/galaxy_test/selenium/test_workflow_editor.py b/lib/galaxy_test/selenium/test_workflow_editor.py index 69806ed72ce..0dfcba661f3 100644 --- a/lib/galaxy_test/selenium/test_workflow_editor.py +++ b/lib/galaxy_test/selenium/test_workflow_editor.py @@ -517,6 +517,12 @@ steps: form_element.click() return name + @retry_assertion_during_transitions + def assert_has_changes_and_save(self): + save_button = self.components.workflows.save_button + save_button.wait_for_visible() + save_button.wait_for_and_click() + @retry_assertion_during_transitions def assert_modal_has_text(self, expected_text): modal_element = self.wait_for_selector_visible(self.modal_body_selector())