From e64bdd20e71cadbd7ff8bd8be09c819458d86497 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 12 Nov 2019 19:43:29 -0500 Subject: [PATCH 1/9] remove unused toolshed_updater mako function --- .../admin/tool_shed_repository/common.mako | 20 ------------------- .../admin/tool_shed_repository/common.mako | 20 ------------------- 2 files changed, 40 deletions(-) diff --git a/lib/tool_shed/webapp/templates/admin/tool_shed_repository/common.mako b/lib/tool_shed/webapp/templates/admin/tool_shed_repository/common.mako index 16f9d793f5b4..d2783be488be 100644 --- a/lib/tool_shed/webapp/templates/admin/tool_shed_repository/common.mako +++ b/lib/tool_shed/webapp/templates/admin/tool_shed_repository/common.mako @@ -376,26 +376,6 @@ -<%def name="tool_dependency_installation_updater()"> - <% - can_update = False - if query.count(): - # Get the first tool dependency to get to the tool shed repository. - tool_dependency = query[0] - tool_shed_repository = tool_dependency.tool_shed_repository - can_update = tool_shed_repository.tool_dependencies_being_installed or tool_shed_repository.missing_tool_dependencies - %> - %if can_update: - - %endif - - <%def name="repository_installation_updater()"> <% can_update = False diff --git a/templates/admin/tool_shed_repository/common.mako b/templates/admin/tool_shed_repository/common.mako index 16f9d793f5b4..d2783be488be 100644 --- a/templates/admin/tool_shed_repository/common.mako +++ b/templates/admin/tool_shed_repository/common.mako @@ -376,26 +376,6 @@ -<%def name="tool_dependency_installation_updater()"> - <% - can_update = False - if query.count(): - # Get the first tool dependency to get to the tool shed repository. - tool_dependency = query[0] - tool_shed_repository = tool_dependency.tool_shed_repository - can_update = tool_shed_repository.tool_dependencies_being_installed or tool_shed_repository.missing_tool_dependencies - %> - %if can_update: - - %endif - - <%def name="repository_installation_updater()"> <% can_update = False From 2023eb8c85f23135229f2df166e7ade7d8155ec1 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 12 Nov 2019 19:51:58 -0500 Subject: [PATCH 2/9] Remove unused tool_dependency_status_updates --- .../admin/tool_shed_repository/common.mako | 56 ------------------- .../admin/tool_shed_repository/common.mako | 56 ------------------- 2 files changed, 112 deletions(-) diff --git a/lib/tool_shed/webapp/templates/admin/tool_shed_repository/common.mako b/lib/tool_shed/webapp/templates/admin/tool_shed_repository/common.mako index d2783be488be..fcd2ff6a9a80 100644 --- a/lib/tool_shed/webapp/templates/admin/tool_shed_repository/common.mako +++ b/lib/tool_shed/webapp/templates/admin/tool_shed_repository/common.mako @@ -258,62 +258,6 @@ %endif -<%def name="dependency_status_updater()"> - - - <%def name="repository_installation_status_updater()"> - - <%def name="repository_installation_status_updater()"> - - -%if context.get("message"): - ${render_msg( message, status )} -%endif - -%if tool_shed_repositories: -
-
Monitor installing tool shed repositories
-
- - - - - - - - - %for tool_shed_repository in tool_shed_repositories: - <% - encoded_repository_id = trans.security.encode_id( tool_shed_repository.id ) - ids_of_tool_dependencies_missing_or_being_installed = [ trans.security.encode_id( td.id ) for td in tool_shed_repository.tool_dependencies_missing_or_being_installed ] - link_to_manage_tool_dependencies = tool_shed_repository.status in [ trans.install_model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES ] - %> - - - - - - - - %endfor -
NameDescriptionOwnerRevisionStatus
${tool_shed_repository.name|h}${tool_shed_repository.description}${tool_shed_repository.owner}${tool_shed_repository.changeset_revision}
${tool_shed_repository.status|h}
-
-
-
-%else: - ${render_msg("There is no repository being installed.", "info")} -%endif diff --git a/lib/tool_shed/webapp/templates/admin/tool_shed_repository/purge_repository_confirmation.mako b/lib/tool_shed/webapp/templates/admin/tool_shed_repository/purge_repository_confirmation.mako deleted file mode 100644 index 36a7f562b667..000000000000 --- a/lib/tool_shed/webapp/templates/admin/tool_shed_repository/purge_repository_confirmation.mako +++ /dev/null @@ -1,74 +0,0 @@ -<%inherit file="/base.mako"/> -<%namespace file="/message.mako" import="render_msg" /> -<%namespace file="/admin/tool_shed_repository/repository_actions_menu.mako" import="*" /> - -<%def name="stylesheets()"> - ${parent.stylesheets()} - ${h.css( "library" )} - - -<%def name="javascripts()"> - ${parent.javascripts()} - - -${render_galaxy_repository_actions( repository )} - -%if message: - ${render_msg( message, status )} -%endif - -
-

- Purging the repository named ${repository.name|h} will result in deletion of all records for the - following associated items from the database. Click the Purge button to purge this repository - and its associated items. -

-
- -
-
Purge tool shed repository ${repository.name|h}
-
- <% - tool_versions = 0 - tool_dependencies = 0 - required_repositories = 0 - orphan_repository_repository_dependency_association_records = 0 - orphan_repository_dependency_records = 0 - # Count this repository's tool version lineage chain links that will be purged. - for tool_version in repository.tool_versions: - for tool_version_association in tool_version.parent_tool_association: - tool_versions += 1 - for tool_version_association in tool_version.child_tool_association: - tool_versions += 1 - tool_versions += 1 - # Count this repository's associated tool dependencies that will be purged. - for tool_dependency in repository.tool_dependencies: - tool_dependencies += 1 - # Count this repository's associated required repositories that will be purged. - for rrda in repository.required_repositories: - required_repositories += 1 - # Count any "orphan" repository_dependency records associated with the repository but not with any - # repository_repository_dependency_association records that will be purged. - for orphan_repository_dependency in \ - trans.sa_session.query( trans.app.install_model.RepositoryDependency ) \ - .filter( trans.app.install_model.RepositoryDependency.table.c.tool_shed_repository_id == repository.id ): - for orphan_rrda in \ - trans.sa_session.query( trans.app.install_model.RepositoryRepositoryDependencyAssociation ) \ - .filter( trans.app.install_model.RepositoryRepositoryDependencyAssociation.table.c.repository_dependency_id == orphan_repository_dependency.id ): - orphan_repository_repository_dependency_association_records += 1 - orphan_repository_dependency_records += 1 - %> - - - - - - -
Tool version records${tool_versions|h}
Tool dependency records${tool_dependencies|h}
Repository dependency records${required_repositories|h}
Orphan repository_repository_dependency_association records${orphan_repository_repository_dependency_association_records|h}
Orphan repository_dependency records${orphan_repository_dependency_records|h}
-
-
- -
-
-
- diff --git a/lib/tool_shed/webapp/templates/admin/tool_shed_repository/reselect_tool_panel_section.mako b/lib/tool_shed/webapp/templates/admin/tool_shed_repository/reselect_tool_panel_section.mako deleted file mode 100644 index d901b6d08e8f..000000000000 --- a/lib/tool_shed/webapp/templates/admin/tool_shed_repository/reselect_tool_panel_section.mako +++ /dev/null @@ -1,101 +0,0 @@ -<%inherit file="/base.mako"/> -<%namespace file="/message.mako" import="render_msg" /> -<%namespace file="/admin/tool_shed_repository/common.mako" import="render_dependencies_section" /> -<%namespace file="/admin/tool_shed_repository/common.mako" import="render_readme_section" /> -<%namespace file="/webapps/tool_shed/repository/common.mako" import="*" /> -<%namespace file="/webapps/tool_shed/common/common.mako" import="*" /> - -<%def name="stylesheets()"> - ${parent.stylesheets()} - ${h.css( "library" )} - - -<%def name="javascripts()"> - ${parent.javascripts()} - ${container_javascripts()} - - -%if message: - ${render_msg( message, status )} -%endif - -
-
-
-
- -
-
- <% readme_files_dict = containers_dict.get( 'readme_files', None ) %> - %if readme_files_dict: -
- - -
Repository README files - may contain important installation or license information
-
- ${render_readme_section( containers_dict )} -
- %endif - %if has_repository_dependencies or includes_tool_dependencies: -
- - -
Confirm dependency installation
-
- ${render_dependencies_section( install_resolver_dependencies_check_box, install_repository_dependencies_check_box, install_tool_dependencies_check_box, containers_dict, revision_label=None, export=False )} - %endif - %if shed_tool_conf_select_field: -
- - -
Choose the configuration file whose tool_path setting will be used for installing repositories
-
- <% - if len( shed_tool_conf_select_field.options ) == 1: - select_help = "Your Galaxy instance is configured with 1 shed-related tool configuration file, so repositories will be " - select_help += "installed using its tool_path setting." - else: - select_help = "Your Galaxy instance is configured with %d shed-related tool configuration files, " % len( shed_tool_conf_select_field.options ) - select_help += "so select the file whose tool_path setting you want used for installing repositories." - %> -
- - ${render_select(shed_tool_conf_select_field)} -
- ${select_help|h} -
-
-
- %else: - - %endif - %if includes_tools_for_display_in_tool_panel: -
-
- ${render_checkbox(no_changes_check_box)} - -
- Uncheck and select a different tool panel section to load the tools into a different section in the tool panel. -
-
-
- - -
- Add a new tool panel section to contain the installed tools (optional). -
-
-
- - ${render_select(tool_panel_section_select_field)} -
- Choose an existing section in your tool panel to contain the installed tools (optional). -
-
- %endif -
- -
-
-
-
From 6b10f5c114e79e9e5a67cd8c1993bdedbe5fa209 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 12 Nov 2019 20:14:35 -0500 Subject: [PATCH 6/9] Remove unused tool shed mako. --- .../deactivate_or_uninstall_repository.mako | 208 ------------------ 1 file changed, 208 deletions(-) delete mode 100644 lib/tool_shed/webapp/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako diff --git a/lib/tool_shed/webapp/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako b/lib/tool_shed/webapp/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako deleted file mode 100644 index 111832fea44e..000000000000 --- a/lib/tool_shed/webapp/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako +++ /dev/null @@ -1,208 +0,0 @@ -<%inherit file="/base.mako"/> -<%namespace file="/message.mako" import="render_msg" /> -<%namespace file="/admin/tool_shed_repository/common.mako" import="*" /> -<%namespace file="/admin/tool_shed_repository/repository_actions_menu.mako" import="*" /> -<%namespace file="/webapps/tool_shed/common/common.mako" import="*" /> - -<% -repository = context.get( 'repository', None ) -if isinstance( repository, list ): - repositories = repository -else: - repositories = [ repository ] -%> - -%if len( repositories ) == 1: - ${render_galaxy_repository_actions( repositories[0] )} -%endif - -%if message: - ${render_msg( message, status )} -%endif - -
-
-%for repository in repositories: - -
${repository.name|h}
-
-
- - ${repository.description|h} -
-
-
- - ${repository.changeset_revision|h} -
-
- - ${repository.tool_shed|h} -
-
-
- - ${repository.owner|h} -
-
- - ${repository.deleted|h} -
-
- <% - can_deactivate_repository = repository.can_deactivate - can_uninstall_repository = repository.can_uninstall - %> - %if can_deactivate_repository: - - - - -
- -
-
- * The repository and all of its contents will remain on disk and can still be used by dependent items. -
- %if repository.includes_tools_for_display_in_tool_panel: -
- * The repository's tools will not be loaded into the tool panel. -
- %endif - %if repository.includes_tool_dependencies: -
- * The repository's installed tool dependencies will remain on disk. -
- %endif - %if repository.includes_datatypes: -
- * The repository's datatypes, datatype converters and display applications will be eliminated from the datatypes registry. -
- %endif -
- * The repository record's deleted column in the tool_shed_repository database table will be set to True. -
-
- %endif - %if can_uninstall_repository: - - - - -
- -
-
- * The repository and all of its contents will be removed from disk and can no longer be used by dependent items. -
- %if repository.includes_tools_for_display_in_tool_panel: -
- * The repository's tool tag sets will be removed from the tool config file in which they are defined. -
- %endif - %if repository.includes_tool_dependencies: -
- * The repository's installed tool dependencies will be removed from disk and can no longer be used by dependent items. -
-
- * Each associated tool dependency record's status column in the tool_dependency database table will be set to 'Uninstalled'. -
- %endif - %if repository.includes_datatypes: -
- * The repository's datatypes, datatype converters and display applications will be eliminated from the datatypes registry. -
- %endif -
- * The repository record's deleted column in the tool_shed_repository database table will be set to True. -
-
- * The repository record's uninstalled column in the tool_shed_repository database table will be set to True. -
-
-
- <% - irm = trans.app.installed_repository_manager - repository_tup = irm.get_repository_tuple_for_installed_repository_manager( repository ) - - # Get installed repositories that this repository requires. - installed_dependent_repositories = [] - installed_runtime_dependent_tool_dependencies = [] - installed_dependent_repositories = irm.installed_dependent_repositories_of_installed_repositories.get( repository_tup, [] ) - - # Get this repository's installed tool dependencies. - installed_tool_dependencies = irm.installed_tool_dependencies_of_installed_repositories.get( repository_tup, [] ) - - # Get installed runtime dependent tool dependencies of this repository's installed tool dependencies. - installed_runtime_dependent_tool_dependencies = [] - for itd_tup in installed_tool_dependencies: - installed_dependent_td_tups = \ - irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.get( itd_tup, [] ) - if installed_dependent_td_tups: - installed_runtime_dependent_tool_dependencies.extend( installed_dependent_td_tups ) - %> - %if installed_dependent_repositories or installed_runtime_dependent_tool_dependencies: - - - - -
- -
- %if installed_dependent_repositories: - -
    - %for installed_dependent_repository_tup in installed_dependent_repositories: - <% - tool_shed, name, owner, installed_changeset_revision = installed_dependent_repository_tup - %> -
  • Revision ${ installed_changeset_revision | h} of repository ${name | h} owned by ${owner | h}
  • - %endfor -
- %endif - %if installed_runtime_dependent_tool_dependencies: - -
    - %for td_tup in installed_runtime_dependent_tool_dependencies: - <% - tool_shed_repository_id, name, version, type = td_tup - containing_repository = irm.get_containing_repository_for_tool_dependency( td_tup ) - repository_name = containing_repository.name - changeset_revision = containing_repository.changeset_revision - owner = containing_repository.owner - %> -
  • - Version ${version | h} of ${type | h} ${name | h} contained in revision - ${changeset_revision | h} of repository ${repository_name | h} owned by ${owner | h} -
  • - %endfor -
- %endif -
- %endif - %endif -
-
-%endfor -
- <% - can_deactivate_repository = True in map( lambda x: x.can_deactivate, repositories ) - can_uninstall_repository = True in map( lambda x: x.can_uninstall, repositories ) - %> - %if can_deactivate_repository and can_uninstall_repository: - <% deactivate_uninstall_button_text = "Deactivate or Uninstall" %> - ${render_checkbox(remove_from_disk_check_box)} - -

- %elif can_deactivate_repository: - <% deactivate_uninstall_button_text = "Deactivate" %> - %else: - <% deactivate_uninstall_button_text = "Uninstall" %> - ##hack to mimic check box - - %endif - -
-
-
- From e18df9616300aaaf731bba32a524d6056d379ac5 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 13 Nov 2019 08:44:54 -0500 Subject: [PATCH 7/9] Remove unused browse repository from admin toolshed. --- .../galaxy/controllers/admin_toolshed.py | 11 ------ .../browse_repository.mako | 36 ------------------- 2 files changed, 47 deletions(-) delete mode 100644 templates/admin/tool_shed_repository/browse_repository.mako diff --git a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py index 618d90fbd689..b0778d2243c4 100644 --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -57,17 +57,6 @@ def activate_repository(self, trans, **kwd): message=message, status=status)) - @web.expose - @web.require_admin - def browse_repository(self, trans, **kwd): - message = escape(kwd.get('message', '')) - status = kwd.get('status', 'done') - repository = repository_util.get_installed_tool_shed_repository(trans.app, kwd['id']) - return trans.fill_template('/admin/tool_shed_repository/browse_repository.mako', - repository=repository, - message=message, - status=status) - @web.legacy_expose_api @web.require_admin def browse_repositories(self, trans, **kwd): diff --git a/templates/admin/tool_shed_repository/browse_repository.mako b/templates/admin/tool_shed_repository/browse_repository.mako deleted file mode 100644 index 0931cd34f54c..000000000000 --- a/templates/admin/tool_shed_repository/browse_repository.mako +++ /dev/null @@ -1,36 +0,0 @@ -<%inherit file="/base.mako"/> -<%namespace file="/message.mako" import="render_msg" /> -<%namespace file="/admin/tool_shed_repository/common.mako" import="*" /> -<%namespace file="/admin/tool_shed_repository/repository_actions_menu.mako" import="*" /> - -<%def name="stylesheets()"> - ${parent.stylesheets()} - ${h.css( "dynatree_skin/ui.dynatree" )} - - -<%def name="javascripts()"> - ${parent.javascripts()} - ## ${h.js( "libs/jquery/jquery-ui", "libs/jquery/jquery.dynatree" )} - ${browse_files(repository.name, repository.repo_files_directory(trans.app))} - - -${render_galaxy_repository_actions( repository )} - -%if message: - ${render_msg( message, status )} -%endif - -
-
Browse ${repository.name|h} revision ${repository.changeset_revision} files
-
-
- -
- Loading... -
-
-
-
-
-
-
From 88a6fdd656eb11b6abcd10247df2437baf7d9d11 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 13 Nov 2019 11:52:24 -0500 Subject: [PATCH 8/9] Change update_tool_shed_status in tool shed twill test to test API endpoint. --- lib/tool_shed/test/base/twilltestcase.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/tool_shed/test/base/twilltestcase.py b/lib/tool_shed/test/base/twilltestcase.py index d5f92adbe4bf..8aa315cb93d9 100644 --- a/lib/tool_shed/test/base/twilltestcase.py +++ b/lib/tool_shed/test/base/twilltestcase.py @@ -1580,10 +1580,9 @@ def update_installed_repository(self, installed_repository, strings_displayed=No self.check_for_strings(strings_displayed, strings_not_displayed) def update_tool_shed_status(self): - params = { - 'all_installed_repositories': True - } - self.visit_galaxy_url('/admin_toolshed/update_tool_shed_status_for_installed_repository', params=params) + api_key = get_master_api_key() + response = requests.get(self.galaxy_url + "/api/tool_shed_repositories/check_for_updates?key=" + api_key) + assert response.status_code != 403, response.content def upload_file(self, repository, From 4731e742ef8ec44054aa7b91df2ff80a28053494 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 7 Jan 2020 13:50:01 -0500 Subject: [PATCH 9/9] Cleanup now unused update check code? --- lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py | 9 --------- .../galaxy_install/grids/admin_toolshed_grids.py | 4 ---- 2 files changed, 13 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py index b0778d2243c4..3662647a7707 100644 --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -1266,12 +1266,3 @@ def update_to_changeset_revision(self, trans, **kwd): id=trans.security.encode_id(repository.id), message=message, status=status)) - - @web.expose - @web.require_admin - def update_tool_shed_status_for_installed_repository(self, trans, **kwd): - message, status = repository_util.check_for_updates(trans.app, trans.install_model, kwd.get('id', None)) - return trans.response.send_redirect(web.url_for(controller='admin', - action='repositories', - message=message, - status=status)) diff --git a/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py b/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py index 289cad2458de..b78e6d22ea29 100644 --- a/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py +++ b/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py @@ -150,10 +150,6 @@ def get_accepted_filters(self): visible=False, filterable="standard")) global_actions = [ - grids.GridAction(label="Update tool shed status", - url_args=dict(controller='admin_toolshed', - action='update_tool_shed_status_for_installed_repository', - all_installed_repositories=True)) ] operations = [grids.GridOperation(label="Update tool shed status", condition=(lambda item: not item.deleted),