commit/galaxy-central: greg: Fix queries in the current user's lists of repositories that display the latest revision of each of their repositories with 1) missing tool test components 2) failing tool tests and 3) no failing tool tests. Add links for the same filtered lists for all users under the Review repositories with tools section in the tool shed menu.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/9a21a5156b2e/ Changeset: 9a21a5156b2e User: greg Date: 2013-04-30 22:40:06 Summary: Fix queries in the current user's lists of repositories that display the latest revision of each of their repositories with 1) missing tool test components 2) failing tool tests and 3) no failing tool tests. Add links for the same filtered lists for all users under the Review repositories with tools section in the tool shed menu. Affected #: 5 files diff -r f44f6beea3daf77bd48fdb8a657f7cb593b72b6f -r 9a21a5156b2efd6b4a169a62bd663bf69fdadf79 lib/galaxy/webapps/tool_shed/controllers/repository.py --- a/lib/galaxy/webapps/tool_shed/controllers/repository.py +++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py @@ -65,6 +65,9 @@ repositories_by_user_grid = repository_grids.RepositoriesByUserGrid() repositories_i_own_grid = repository_grids.RepositoriesIOwnGrid() repositories_in_category_grid = repository_grids.RepositoriesInCategoryGrid() + repositories_missing_tool_test_components_grid = repository_grids.RepositoriesMissingToolTestComponentsGrid() + repositories_with_failing_tool_tests_grid = repository_grids.RepositoriesWithFailingToolTestsGrid() + repositories_with_no_failing_tool_tests_grid = repository_grids.RepositoriesWithNoFailingToolTestsGrid() repository_dependencies_grid = repository_grids.RepositoryDependenciesGrid() repository_grid = repository_grids.RepositoryGrid() # The repository_metadata_grid is not currently displayed, but is sub-classed by several grids. @@ -121,6 +124,23 @@ return self.datatypes_grid( trans, **kwd ) @web.expose + def browse_deprecated_repositories_i_own( self, trans, **kwd ): + if 'operation' in kwd: + operation = kwd[ 'operation' ].lower() + if operation == "view_or_manage_repository": + return trans.response.send_redirect( web.url_for( controller='repository', + action='view_or_manage_repository', + **kwd ) ) + selected_changeset_revision, repository = self.__get_repository_from_refresh_on_change( trans, **kwd ) + if repository: + return trans.response.send_redirect( web.url_for( controller='repository', + action='browse_repositories', + operation='view_or_manage_repository', + id=trans.security.encode_id( repository.id ), + changeset_revision=selected_changeset_revision ) ) + return self.deprecated_repositories_i_own_grid( trans, **kwd ) + + @web.expose def browse_invalid_tools( self, trans, **kwd ): params = util.Params( kwd ) message = util.restore_text( params.get( 'message', '' ) ) @@ -188,6 +208,34 @@ return self.my_writable_repositories_grid( trans, **kwd ) @web.expose + def browse_my_writable_repositories_missing_tool_test_components( self, trans, **kwd ): + if 'operation' in kwd: + operation = kwd[ 'operation' ].lower() + if operation == "view_or_manage_repository": + return trans.response.send_redirect( web.url_for( controller='repository', + action='view_or_manage_repository', + **kwd ) ) + elif operation == "repositories_by_user": + return trans.response.send_redirect( web.url_for( controller='repository', + action='browse_repositories_by_user', + **kwd ) ) + elif operation in [ 'mark as deprecated', 'mark as not deprecated' ]: + kwd[ 'mark_deprecated' ] = operation == 'mark as deprecated' + return trans.response.send_redirect( web.url_for( controller='repository', + action='deprecate', + **kwd ) ) + if 'message' not in kwd: + message = 'This list contains repositories that match the following criteria:<br>' + message += '<ul>' + message += '<li>you are authorized to update them</li>' + message += '<li>the latest installable revision contains at least 1 tool with no defined tests <b>OR</b>:</li>' + message += '<li>the latest installable revision contains at least 1 tool with a test that requires a missing test data file</li>' + message += '</ul>' + kwd[ 'message' ] = message + kwd[ 'status' ] = 'warning' + return self.my_writable_repositories_missing_tool_test_components_grid( trans, **kwd ) + + @web.expose def browse_my_writable_repositories_with_failing_tool_tests( self, trans, **kwd ): if 'operation' in kwd: operation = kwd[ 'operation' ].lower() @@ -246,44 +294,6 @@ return self.my_writable_repositories_with_no_failing_tool_tests_grid( trans, **kwd ) @web.expose - def browse_my_writable_repositories_missing_tool_test_components( self, trans, **kwd ): - if 'operation' in kwd: - operation = kwd[ 'operation' ].lower() - if operation == "view_or_manage_repository": - return trans.response.send_redirect( web.url_for( controller='repository', - action='view_or_manage_repository', - **kwd ) ) - elif operation == "repositories_by_user": - return trans.response.send_redirect( web.url_for( controller='repository', - action='browse_repositories_by_user', - **kwd ) ) - elif operation in [ 'mark as deprecated', 'mark as not deprecated' ]: - kwd[ 'mark_deprecated' ] = operation == 'mark as deprecated' - return trans.response.send_redirect( web.url_for( controller='repository', - action='deprecate', - **kwd ) ) - if 'message' not in kwd: - message = 'This list contains repositories that match the following criteria:<br>' - message += '<ul>' - message += '<li>you are authorized to update them</li>' - message += '<li>the latest installable revision contains at least 1 tool with no defined tests <b>OR</b>:</li>' - message += '<li>the latest installable revision contains at least 1 tool with a test that requires a missing test data file</li>' - message += '</ul>' - kwd[ 'message' ] = message - kwd[ 'status' ] = 'warning' - return self.my_writable_repositories_missing_tool_test_components_grid( trans, **kwd ) - - @web.expose - def browse_deprecated_repositories_i_own( self, trans, **kwd ): - if 'operation' in kwd: - operation = kwd[ 'operation' ].lower() - if operation == "view_or_manage_repository": - return trans.response.send_redirect( web.url_for( controller='repository', - action='view_or_manage_repository', - **kwd ) ) - return self.deprecated_repositories_i_own_grid( trans, **kwd ) - - @web.expose def browse_repositories( self, trans, **kwd ): # We add params to the keyword dict in this method in order to rename the param with an "f-" prefix, simulating filtering by clicking a search # link. We have to take this approach because the "-" character is illegal in HTTP requests. @@ -427,6 +437,89 @@ return self.repositories_in_category_grid( trans, **kwd ) @web.expose + def browse_repositories_missing_tool_test_components( self, trans, **kwd ): + if 'operation' in kwd: + operation = kwd[ 'operation' ].lower() + if operation == "view_or_manage_repository": + return trans.response.send_redirect( web.url_for( controller='repository', + action='view_or_manage_repository', + **kwd ) ) + elif operation == "repositories_by_user": + return trans.response.send_redirect( web.url_for( controller='repository', + action='browse_repositories_by_user', + **kwd ) ) + elif operation in [ 'mark as deprecated', 'mark as not deprecated' ]: + kwd[ 'mark_deprecated' ] = operation == 'mark as deprecated' + return trans.response.send_redirect( web.url_for( controller='repository', + action='deprecate', + **kwd ) ) + if 'message' not in kwd: + message = 'This list contains repositories that match the following criteria:<br>' + message += '<ul>' + message += '<li>the latest installable revision contains at least 1 tool with no defined tests <b>OR</b>:</li>' + message += '<li>the latest installable revision contains at least 1 tool with a test that requires a missing test data file</li>' + message += '</ul>' + kwd[ 'message' ] = message + kwd[ 'status' ] = 'warning' + return self.repositories_missing_tool_test_components_grid( trans, **kwd ) + + @web.expose + def browse_repositories_with_failing_tool_tests( self, trans, **kwd ): + if 'operation' in kwd: + operation = kwd[ 'operation' ].lower() + if operation == "view_or_manage_repository": + return trans.response.send_redirect( web.url_for( controller='repository', + action='view_or_manage_repository', + **kwd ) ) + elif operation == "repositories_by_user": + return trans.response.send_redirect( web.url_for( controller='repository', + action='browse_repositories_by_user', + **kwd ) ) + elif operation in [ 'mark as deprecated', 'mark as not deprecated' ]: + kwd[ 'mark_deprecated' ] = operation == 'mark as deprecated' + return trans.response.send_redirect( web.url_for( controller='repository', + action='deprecate', + **kwd ) ) + if 'message' not in kwd: + message = 'This list contains repositories that match the following criteria:<br>' + message += '<ul>' + message += '<li>the latest installable revision contains at least 1 tool</li>' + message += '<li>the latest installable revision is not missing any tool test components</li>' + message += '<li>the latest installable revision has at least 1 tool test that fails</li>' + message += '</ul>' + kwd[ 'message' ] = message + kwd[ 'status' ] = 'warning' + return self.repositories_with_failing_tool_tests_grid( trans, **kwd ) + + @web.expose + def browse_repositories_with_no_failing_tool_tests( self, trans, **kwd ): + if 'operation' in kwd: + operation = kwd[ 'operation' ].lower() + if operation == "view_or_manage_repository": + return trans.response.send_redirect( web.url_for( controller='repository', + action='view_or_manage_repository', + **kwd ) ) + elif operation == "repositories_by_user": + return trans.response.send_redirect( web.url_for( controller='repository', + action='browse_repositories_by_user', + **kwd ) ) + elif operation in [ 'mark as deprecated', 'mark as not deprecated' ]: + kwd[ 'mark_deprecated' ] = operation == 'mark as deprecated' + return trans.response.send_redirect( web.url_for( controller='repository', + action='deprecate', + **kwd ) ) + if 'message' not in kwd: + message = 'This list contains repositories that match the following criteria:<br>' + message += '<ul>' + message += '<li>the latest installable revision contains at least 1 tool</li>' + message += '<li>the latest installable revision is not missing any tool test components</li>' + message += '<li>the latest installable revision has no tool tests that fail</li>' + message += '</ul>' + kwd[ 'message' ] = message + kwd[ 'status' ] = 'warning' + return self.repositories_with_no_failing_tool_tests_grid( trans, **kwd ) + + @web.expose def browse_repository( self, trans, id, **kwd ): params = util.Params( kwd ) message = util.restore_text( params.get( 'message', '' ) ) diff -r f44f6beea3daf77bd48fdb8a657f7cb593b72b6f -r 9a21a5156b2efd6b4a169a62bd663bf69fdadf79 lib/tool_shed/grids/repository_grids.py --- a/lib/tool_shed/grids/repository_grids.py +++ b/lib/tool_shed/grids/repository_grids.py @@ -1,17 +1,24 @@ -import os, logging +import logging +import os from galaxy.webapps.tool_shed import model from galaxy.web.framework.helpers import grids -from galaxy.model.orm import and_, or_ +from galaxy.model.orm import and_ +from galaxy.model.orm import or_ from galaxy.util import json import tool_shed.util.shed_util_common as suc import tool_shed.grids.util as grids_util from tool_shed.util import metadata_util from galaxy import eggs + eggs.require('markupsafe') from markupsafe import escape as escape_html + eggs.require('mercurial') -from mercurial import hg, ui, patch, commands +from mercurial import commands +from mercurial import hg +from mercurial import patch +from mercurial import ui log = logging.getLogger( __name__ ) @@ -462,7 +469,7 @@ class MyWritableRepositoriesGrid( RepositoryGrid ): # This grid filters out repositories that have been marked as either deprecated or deleted. - title = 'Repositories that I can change' + title = 'Repositories I can change' columns = [ RepositoryGrid.NameColumn( "Name", key="name", @@ -505,19 +512,19 @@ .filter( model.Repository.table.c.id < 0 ) -class MyWritableRepositoriesMissingToolTestComponentsGrid( MyWritableRepositoriesGrid ): - title = "Repositories that I can change with missing tool test components" +class RepositoriesMissingToolTestComponentsGrid( RepositoryGrid ): + title = "Repositories with missing tool test components" columns = [ - RepositoriesIOwnGrid.NameColumn( "Name", - key="name", - link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ), - attach_popup=True ), + RepositoryGrid.NameColumn( "Name", + key="name", + link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ), + attach_popup=False ), RepositoryGrid.LatestInstallableRevisionColumn( "Latest Installable Revision" ), RepositoryGrid.UserColumn( "Owner", + key="User.username", model_class=model.User, link=( lambda item: dict( operation="repositories_by_user", id=item.id ) ), - attach_popup=False, - key="User.username" ) + attach_popup=False ) ] columns.append( grids.MulticolFilterColumn( "Search repository name", cols_to_filter=[ columns[0] ], @@ -528,6 +535,29 @@ use_paging = False def build_initial_query( self, trans, **kwd ): + # Filter by latest installable revisions that contain tools with missing tool test components. + revision_clause_list = [] + for repository in trans.sa_session.query( model.Repository ): + changeset_revision = filter_by_latest_downloadable_changeset_revision_that_has_missing_tool_test_components( trans, repository ) + if changeset_revision: + revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision ) + if revision_clause_list: + return trans.sa_session.query( model.Repository ) \ + .join( model.RepositoryMetadata ) \ + .filter( or_( *revision_clause_list ) ) \ + .join( model.User.table ) + # Return an empty query. + return trans.sa_session.query( model.Repository ) \ + .filter( model.Repository.table.c.id < 0 ) + + +class MyWritableRepositoriesMissingToolTestComponentsGrid( RepositoriesMissingToolTestComponentsGrid ): + title = "Repositories I can change with missing tool test components" + columns = [ col for col in RepositoriesMissingToolTestComponentsGrid.columns ] + operations = [] + use_paging = False + + def build_initial_query( self, trans, **kwd ): # First get all repositories that the current user is authorized to update. username = trans.user.username user_clause_list = [] @@ -545,8 +575,8 @@ revision_clause_list = [] for repository in trans.sa_session.query( model.Repository ) \ .filter( or_( *user_clause_list ) ): - changeset_revision = suc.filter_by_latest_downloadable_changeset_revision_that_has_missing_tool_test_components( trans, repository ) - if changeset_revision not in [ None, suc.INITIAL_CHANGELOG_HASH ]: + changeset_revision = filter_by_latest_downloadable_changeset_revision_that_has_missing_tool_test_components( trans, repository ) + if changeset_revision: revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision ) if revision_clause_list: return trans.sa_session.query( model.Repository ) \ @@ -559,19 +589,19 @@ .filter( model.Repository.table.c.id < 0 ) -class MyWritableRepositoriesWithFailingToolTestsGrid( MyWritableRepositoriesMissingToolTestComponentsGrid ): - title = "Repositories that I can change with failing tool tests" +class RepositoriesWithFailingToolTestsGrid( RepositoryGrid ): + title = "Repositories with failing tool tests" columns = [ - RepositoriesIOwnGrid.NameColumn( "Name", - key="name", - link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ), - attach_popup=True ), + RepositoryGrid.NameColumn( "Name", + key="name", + link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ), + attach_popup=False ), RepositoryGrid.LatestInstallableRevisionColumn( "Latest Installable Revision" ), RepositoryGrid.UserColumn( "Owner", + key="User.username", model_class=model.User, link=( lambda item: dict( operation="repositories_by_user", id=item.id ) ), - attach_popup=False, - key="User.username" ) + attach_popup=False ) ] columns.append( grids.MulticolFilterColumn( "Search repository name", cols_to_filter=[ columns[0] ], @@ -582,6 +612,29 @@ use_paging = False def build_initial_query( self, trans, **kwd ): + # Filter by latest installable revisions that contain tools with at least 1 failing tool test. + revision_clause_list = [] + for repository in trans.sa_session.query( model.Repository ): + changeset_revision = filter_by_latest_downloadable_changeset_revision_that_has_failing_tool_tests( trans, repository ) + if changeset_revision: + revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision ) + if revision_clause_list: + return trans.sa_session.query( model.Repository ) \ + .join( model.RepositoryMetadata ) \ + .filter( or_( *revision_clause_list ) ) \ + .join( model.User.table ) + # Return an empty query. + return trans.sa_session.query( model.Repository ) \ + .filter( model.Repository.table.c.id < 0 ) + + +class MyWritableRepositoriesWithFailingToolTestsGrid( RepositoriesWithFailingToolTestsGrid ): + title = "Repositories I can change with failing tool tests" + columns = [ col for col in RepositoriesWithFailingToolTestsGrid.columns ] + operations = [] + use_paging = False + + def build_initial_query( self, trans, **kwd ): # First get all repositories that the current user is authorized to update. username = trans.user.username user_clause_list = [] @@ -595,38 +648,37 @@ user_clause_list.append( model.Repository.table.c.id == repository.id ) if user_clause_list: # We have the list of repositories that the current user is authorized to update, so filter further by latest installable revisions that contain - # tools with missing tool test components. + # tools with at least 1 failing tool test. revision_clause_list = [] for repository in trans.sa_session.query( model.Repository ) \ .filter( or_( *user_clause_list ) ): - changeset_revision = suc.filter_by_latest_downloadable_changeset_revision_that_has_missing_tool_test_components( trans, repository ) - if changeset_revision not in [ None, suc.INITIAL_CHANGELOG_HASH ]: + changeset_revision = filter_by_latest_downloadable_changeset_revision_that_has_failing_tool_tests( trans, repository ) + if changeset_revision: revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision ) if revision_clause_list: return trans.sa_session.query( model.Repository ) \ .join( model.User.table ) \ .filter( or_( *user_clause_list ) ) \ .join( model.RepositoryMetadata ) \ - .filter( or_( *revision_clause_list ) ) \ - .filter( model.RepositoryMetadata.table.c.tools_functionally_correct == False ) + .filter( or_( *revision_clause_list ) ) # Return an empty query. return trans.sa_session.query( model.Repository ) \ .filter( model.Repository.table.c.id < 0 ) -class MyWritableRepositoriesWithNoFailingToolTestsGrid( MyWritableRepositoriesMissingToolTestComponentsGrid ): - title = "Repositories that I can change with failing tool tests" +class RepositoriesWithNoFailingToolTestsGrid( RepositoryGrid ): + title = "Repositories with no failing tool tests" columns = [ - RepositoriesIOwnGrid.NameColumn( "Name", - key="name", - link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ), - attach_popup=True ), + RepositoryGrid.NameColumn( "Name", + key="name", + link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ), + attach_popup=False ), RepositoryGrid.LatestInstallableRevisionColumn( "Latest Installable Revision" ), RepositoryGrid.UserColumn( "Owner", + key="User.username", model_class=model.User, link=( lambda item: dict( operation="repositories_by_user", id=item.id ) ), - attach_popup=False, - key="User.username" ) + attach_popup=False ) ] columns.append( grids.MulticolFilterColumn( "Search repository name", cols_to_filter=[ columns[0] ], @@ -637,6 +689,30 @@ use_paging = False def build_initial_query( self, trans, **kwd ): + # We have the list of repositories that the current user is authorized to update, so filter further by latest installable revisions that contain + # tools with at least 1 failing tool test. + revision_clause_list = [] + for repository in trans.sa_session.query( model.Repository ): + changeset_revision = filter_by_latest_downloadable_changeset_revision_that_has_no_failing_tool_tests( trans, repository ) + if changeset_revision: + revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision ) + if revision_clause_list: + return trans.sa_session.query( model.Repository ) \ + .join( model.RepositoryMetadata ) \ + .filter( or_( *revision_clause_list ) ) \ + .join( model.User.table ) + # Return an empty query. + return trans.sa_session.query( model.Repository ) \ + .filter( model.Repository.table.c.id < 0 ) + + +class MyWritableRepositoriesWithNoFailingToolTestsGrid( RepositoriesWithNoFailingToolTestsGrid ): + title = "Repositories I can change with no failing tool tests" + columns = [ col for col in RepositoriesWithNoFailingToolTestsGrid.columns ] + operations = [] + use_paging = False + + def build_initial_query( self, trans, **kwd ): # First get all repositories that the current user is authorized to update. username = trans.user.username user_clause_list = [] @@ -650,20 +726,19 @@ user_clause_list.append( model.Repository.table.c.id == repository.id ) if user_clause_list: # We have the list of repositories that the current user is authorized to update, so filter further by latest installable revisions that contain - # tools with missing tool test components. + # at least 1 tool, no missing tool test components, and no failing tool tests. revision_clause_list = [] for repository in trans.sa_session.query( model.Repository ) \ .filter( or_( *user_clause_list ) ): - changeset_revision = suc.filter_by_latest_downloadable_changeset_revision_that_has_missing_tool_test_components( trans, repository ) - if changeset_revision not in [ None, suc.INITIAL_CHANGELOG_HASH ]: + changeset_revision = filter_by_latest_downloadable_changeset_revision_that_has_no_failing_tool_tests( trans, repository ) + if changeset_revision: revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision ) if revision_clause_list: return trans.sa_session.query( model.Repository ) \ .join( model.User.table ) \ .filter( or_( *user_clause_list ) ) \ .join( model.RepositoryMetadata ) \ - .filter( or_( *revision_clause_list ) ) \ - .filter( model.RepositoryMetadata.table.c.tools_functionally_correct == True ) + .filter( or_( *revision_clause_list ) ) # Return an empty query. return trans.sa_session.query( model.Repository ) \ .filter( model.Repository.table.c.id < 0 ) @@ -1259,3 +1334,62 @@ model.Repository.table.c.deleted == False, model.Repository.table.c.deprecated == False ) ) \ .join( model.User.table ) + +# ------ utility methods ------------------- + +def filter_by_latest_downloadable_changeset_revision_that_has_failing_tool_tests( trans, repository ): + """ + Inspect the latest installable changeset revision for the received repository to see if it includes at least 1 tool that has at least 1 failing test. + """ + encoded_repository_id = trans.security.encode_id( repository.id ) + repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) ) + tip_ctx = str( repo.changectx( repo.changelog.tip() ) ) + repository_metadata = get_latest_installable_repository_metadata_if_it_includes_tools( trans, repository ) + if repository_metadata and not repository_metadata.tools_functionally_correct: + return repository_metadata.changeset_revision + return None + +def filter_by_latest_downloadable_changeset_revision_that_has_missing_tool_test_components( trans, repository ): + """ + Inspect the latest installable changeset revision for the received repository to see if it includes tools that are either missing functional tests + or functional test data. If the changset revision includes tools, but is missing tool test components, return the changeset revision hash. + """ + encoded_repository_id = trans.security.encode_id( repository.id ) + repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) ) + tip_ctx = str( repo.changectx( repo.changelog.tip() ) ) + repository_metadata = get_latest_installable_repository_metadata_if_it_includes_tools( trans, repository ) + if repository_metadata and repository_metadata.missing_test_components: + return repository_metadata.changeset_revision + return None + +def filter_by_latest_downloadable_changeset_revision_that_has_no_failing_tool_tests( trans, repository ): + """ + Inspect the latest installable changeset revision for the received repository to see if it includes tools with no failing tests. + """ + encoded_repository_id = trans.security.encode_id( repository.id ) + repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) ) + tip_ctx = str( repo.changectx( repo.changelog.tip() ) ) + repository_metadata = get_latest_installable_repository_metadata_if_it_includes_tools( trans, repository ) + if repository_metadata and not repository_metadata.missing_test_components and repository_metadata.tools_functionally_correct: + return repository_metadata.changeset_revision + return None + +def get_latest_installable_repository_metadata_if_it_includes_tools( trans, repository ): + """Return the latest installable repository_metadata record for the received repository if one exists.""" + encoded_repository_id = trans.security.encode_id( repository.id ) + repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) ) + tip_ctx = str( repo.changectx( repo.changelog.tip() ) ) + repository_metadata = None + try: + repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, encoded_repository_id, tip_ctx ) + if repository_metadata and repository_metadata.includes_tools and repository_metadata.downloadable: + return repository_metadata + return None + except: + latest_installable_revision = suc.get_previous_downloadable_changeset_revision( repository, repo, tip_ctx ) + if latest_installable_revision == suc.INITIAL_CHANGELOG_HASH: + return None + repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, encoded_repository_id, latest_installable_revision ) + if repository_metadata and repository_metadata.includes_tools and repository_metadata.downloadable: + return repository_metadata + return None diff -r f44f6beea3daf77bd48fdb8a657f7cb593b72b6f -r 9a21a5156b2efd6b4a169a62bd663bf69fdadf79 lib/tool_shed/util/shed_util_common.py --- a/lib/tool_shed/util/shed_util_common.py +++ b/lib/tool_shed/util/shed_util_common.py @@ -255,29 +255,6 @@ sa_session.flush() return tool_shed_repository -def filter_by_latest_downloadable_changeset_revision_that_has_missing_tool_test_components( trans, repository ): - """ - Inspect the latest installable changeset revision for the received repository to see if it includes tool that are either missing functional tests - or functional test data. If the changset revision includes tools, but is missing tool test components, return the changeset revision hash. Otherwise - return the INITIAL_CHANGELOG_HASH. - """ - print_debug = repository.name == 'convert_chars' - encoded_repository_id = trans.security.encode_id( repository.id ) - repo = hg.repository( get_configured_ui(), repository.repo_path( trans.app ) ) - tip_ctx = str( repo.changectx( repo.changelog.tip() ) ) - repository_metadata = None - try: - repository_metadata = get_repository_metadata_by_changeset_revision( trans, encoded_repository_id, tip_ctx ) - except: - latest_installable_revision = get_previous_downloadable_changeset_revision( repository, repo, tip_ctx ) - if latest_installable_revision != INITIAL_CHANGELOG_HASH: - repository_metadata = get_repository_metadata_by_changeset_revision( trans, encoded_repository_id, latest_installable_revision ) - else: - repository_metadata = None - if repository_metadata and repository_metadata.downloadable and repository_metadata.missing_test_components: - return repository_metadata.changeset_revision - return INITIAL_CHANGELOG_HASH - def generate_clone_url_for_installed_repository( app, repository ): """Generate the URL for cloning a repository that has been installed into a Galaxy instance.""" tool_shed_url = get_url_from_tool_shed( app, repository.tool_shed ) diff -r f44f6beea3daf77bd48fdb8a657f7cb593b72b6f -r 9a21a5156b2efd6b4a169a62bd663bf69fdadf79 templates/webapps/tool_shed/admin/index.mako --- a/templates/webapps/tool_shed/admin/index.mako +++ b/templates/webapps/tool_shed/admin/index.mako @@ -96,9 +96,18 @@ Reviewing Repositories With Tools </div><div class="toolSectionBody"> - <div class="toolSectionBg"> - <div class="toolTitle"> - <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_with_invalid_tests' )}">Repositories missing tests or data</a> + <div class="toolSectionPad"></div> + <div class="toolSectionBody"> + <div class="toolSectionBg"> + <div class="toolTitle"> + <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_missing_tool_test_components' )}">Latest revision missing tool tests</a> + </div> + <div class="toolTitle"> + <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_with_failing_tool_tests' )}">Latest revision failing tool tests</a> + </div> + <div class="toolTitle"> + <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_with_no_failing_tool_tests' )}">Latest revision all tool tests pass</a> + </div></div></div></div> diff -r f44f6beea3daf77bd48fdb8a657f7cb593b72b6f -r 9a21a5156b2efd6b4a169a62bd663bf69fdadf79 templates/webapps/tool_shed/index.mako --- a/templates/webapps/tool_shed/index.mako +++ b/templates/webapps/tool_shed/index.mako @@ -164,7 +164,13 @@ <div class="toolSectionBody"><div class="toolSectionBg"><div class="toolTitle"> - <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_with_invalid_tests' )}">Repositories missing tests or data</a> + <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_missing_tool_test_components' )}">Latest revision missing tool tests</a> + </div> + <div class="toolTitle"> + <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_with_failing_tool_tests' )}">Latest revision failing tool tests</a> + </div> + <div class="toolTitle"> + <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_with_no_failing_tool_tests' )}">Latest revision all tool tests pass</a></div></div></div> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org