commit/galaxy-central: greg: Display repository dependency definition attributes for repositories being installed into Galaxy where the dependency hierarchy cannot be determined likely due to invalid dependency definitions.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/165927888055/ Changeset: 165927888055 User: greg Date: 2014-04-10 17:35:37 Summary: Display repository dependency definition attributes for repositories being installed into Galaxy where the dependency hierarchy cannot be determined likely due to invalid dependency definitions. Affected #: 5 files diff -r b3b39af86c36a4f141bbe64dfec4ad59f3facbe7 -r 165927888055c164e493a948e05d10c00d018458 lib/galaxy/webapps/tool_shed/api/repositories.py --- a/lib/galaxy/webapps/tool_shed/api/repositories.py +++ b/lib/galaxy/webapps/tool_shed/api/repositories.py @@ -276,7 +276,7 @@ @web.expose_api def repository_ids_for_setting_metadata( self, trans, my_writable=False, **kwd ): """ - GET /api/get_repository_ids_for_setting_metadata + GET /api/repository_ids_for_setting_metadata Displays a collection (list) of repository ids ordered for setting metadata. diff -r b3b39af86c36a4f141bbe64dfec4ad59f3facbe7 -r 165927888055c164e493a948e05d10c00d018458 lib/galaxy/webapps/tool_shed/api/repository_revisions.py --- a/lib/galaxy/webapps/tool_shed/api/repository_revisions.py +++ b/lib/galaxy/webapps/tool_shed/api/repository_revisions.py @@ -26,7 +26,7 @@ Creates and saves a gzip compressed tar archive of a repository and optionally all of it's repository dependencies. The following parameters are included in the payload. - :param tool_shed_url (required): the base URL of the Tool Shed from which the Repository was installed + :param tool_shed_url (required): the base URL of the Tool Shed from which the Repository is to be exported :param name (required): the name of the Repository :param owner (required): the owner of the Repository :param changeset_revision (required): the changeset_revision of the RepositoryMetadata object associated with the Repository diff -r b3b39af86c36a4f141bbe64dfec4ad59f3facbe7 -r 165927888055c164e493a948e05d10c00d018458 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 @@ -2570,11 +2570,8 @@ invalid = True break if invalid: - message += 'The repository dependency definitions for this repository are invalid and will be ignored. ' - message += 'The complete dependency hierarchy could not be determined. The cause of repository dependency ' - message += 'definition errors like this can usually be seen when viewing the repository directly from the ' - message += 'Tool Shed. The exact cause cannot be determined when visiting the Tool Shed from Galaxy to ' - message += 'install the repository.' + message = repository_dependency_util.generate_message_for_invalid_repository_dependencies( metadata, + error_from_tuple=False ) status = 'error' else: repository_metadata_id = None diff -r b3b39af86c36a4f141bbe64dfec4ad59f3facbe7 -r 165927888055c164e493a948e05d10c00d018458 lib/galaxy/webapps/tool_shed/controllers/upload.py --- a/lib/galaxy/webapps/tool_shed/controllers/upload.py +++ b/lib/galaxy/webapps/tool_shed/controllers/upload.py @@ -288,7 +288,8 @@ status = 'error' # Handle messaging for invalid repository dependencies. invalid_repository_dependencies_message = \ - repository_dependency_util.generate_message_for_invalid_repository_dependencies( metadata_dict ) + repository_dependency_util.generate_message_for_invalid_repository_dependencies( metadata_dict, + error_from_tuple=True ) if invalid_repository_dependencies_message: message += invalid_repository_dependencies_message status = 'error' diff -r b3b39af86c36a4f141bbe64dfec4ad59f3facbe7 -r 165927888055c164e493a948e05d10c00d018458 lib/tool_shed/util/repository_dependency_util.py --- a/lib/tool_shed/util/repository_dependency_util.py +++ b/lib/tool_shed/util/repository_dependency_util.py @@ -225,18 +225,46 @@ build_repository_dependency_relationships( trans, all_repo_info_dicts, all_created_or_updated_tool_shed_repositories ) return created_or_updated_tool_shed_repositories, tool_panel_section_keys, all_repo_info_dicts, filtered_repo_info_dicts -def generate_message_for_invalid_repository_dependencies( metadata_dict ): - """Return the error message associated with an invalid repository dependency for display in the caller.""" +def generate_message_for_invalid_repository_dependencies( metadata_dict, error_from_tuple=False ): + """Get or generate and return an error message associated with an invalid repository dependency.""" message = '' if metadata_dict: - invalid_repository_dependencies_dict = metadata_dict.get( 'invalid_repository_dependencies', None ) - if invalid_repository_dependencies_dict: - invalid_repository_dependencies = invalid_repository_dependencies_dict.get( 'invalid_repository_dependencies', [] ) - for repository_dependency_tup in invalid_repository_dependencies: - toolshed, name, owner, changeset_revision, prior_installation_required, only_if_compiling_contained_td, error = \ - common_util.parse_repository_dependency_tuple( repository_dependency_tup, contains_error=True ) - if error: - message = '%s ' % str( error ) + if error_from_tuple: + # Return the error messages associated with a set of one or more invalid repository dependency tuples. + invalid_repository_dependencies_dict = metadata_dict.get( 'invalid_repository_dependencies', None ) + if invalid_repository_dependencies_dict is not None: + invalid_repository_dependencies = invalid_repository_dependencies_dict.get( 'invalid_repository_dependencies', [] ) + for repository_dependency_tup in invalid_repository_dependencies: + toolshed, name, owner, changeset_revision, prior_installation_required, only_if_compiling_contained_td, error = \ + common_util.parse_repository_dependency_tuple( repository_dependency_tup, contains_error=True ) + if error: + message += '%s ' % str( error ) + else: + # The complete dependency hierarchy could not be determined for a repository being installed into + # Galaxy. This is likely due to invalid repository dependency definitions, so we'll get them from + # the metadata and parse them for display in an error message. This will hopefully communicate the + # problem to the user in such a way that a resolution can be determined. + message += 'The complete dependency hierarchy could not be determined for this repository, so no required ' + message += 'repositories will not be installed. This is likely due to invalid repository dependency definitions. ' + repository_dependencies_dict = metadata_dict.get( 'repository_dependencies', None ) + if repository_dependencies_dict is not None: + rd_tups = repository_dependencies_dict.get( 'repository_dependencies', None ) + if rd_tups is not None: + message += 'Here are the attributes of the dependencies defined for this repository to help determine the ' + message += 'cause of this problem.<br/>' + message += '<table cellpadding="2" cellspacing="2">' + message += '<tr><th>Tool shed</th><th>Repository name</th><th>Owner</th><th>Changeset revision</th>' + message += '<th>Prior install required</th></tr>' + for rd_tup in rd_tups: + tool_shed, name, owner, changeset_revision, pir, oicct = \ + common_util.parse_repository_dependency_tuple( rd_tup ) + if asbool( pir ): + pir_str = 'True' + else: + pir_str = '' + message += '<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>' % \ + ( tool_shed, name, owner, changeset_revision, pir_str ) + message += '</table>' return message def get_key_for_repository_changeset_revision( trans, toolshed_base_url, repository, repository_metadata, all_repository_dependencies ): 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