2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/888478c66456/
Changeset: 888478c66456
Branch: next-stable
User: greg
Date: 2014-04-04 17:55:24
Summary: Enhance error message displayed when installing a repository into Galaxy that has an invalid repository dependency definiton.
Affected #: 1 file
diff -r 64d677b1e16ab79a60f91b315ecc8bee7505281c -r 888478c664569310b972ab8be495c275beed22a0 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
@@ -2558,7 +2558,11 @@
invalid = True
break
if invalid:
- message += 'The repository dependency definitions for this repository are invalid and will be ignored.'
+ 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.'
status = 'error'
else:
repository_metadata_id = None
https://bitbucket.org/galaxy/galaxy-central/commits/4cb9c5ed03c9/
Changeset: 4cb9c5ed03c9
User: greg
Date: 2014-04-04 17:55:45
Summary: Merged next-stable
Affected #: 1 file
diff -r fd96caa42a4397db660ddd5c24e8c94c7b1c9d3e -r 4cb9c5ed03c9fef9972fa0a4bab275db1e0b1b8a 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
@@ -2558,7 +2558,11 @@
invalid = True
break
if invalid:
- message += 'The repository dependency definitions for this repository are invalid and will be ignored.'
+ 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.'
status = 'error'
else:
repository_metadata_id = None
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.
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/aa6203b24be3/
Changeset: aa6203b24be3
Branch: next-stable
User: greg
Date: 2014-04-03 23:40:44
Summary: Better fix than ea1fbe9 and handle first discovered unhandled secure / insecure protocol issue when messing with the tool shed url for installed repositories.
Affected #: 6 files
diff -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 -r aa6203b24be369697fd451e2a8dd45518d39073c lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -137,8 +137,8 @@
action='reselect_tool_panel_section',
**kwd ) )
else:
- message = "Unable to get latest revision for repository <b>%s</b> from the tool shed, so repository " % str( repository.name )
- message += "reinstallation is not possible at this time."
+ message = "Unable to get latest revision for repository <b>%s</b> from " % str( repository.name )
+ message += "the Tool Shed, so repository reinstallation is not possible at this time."
status = "error"
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='browse_repositories',
@@ -986,12 +986,15 @@
# The Tool Shed cannot handle the get_repository_id request, so the code must be older than the
# 04/2014 Galaxy release when it was introduced. It will be safest to error out and let the
# Tool Shed admin update the Tool Shed to a later release.
- err_msg = 'The Tool Shed %s is running a code revision that does not ' % str( tool_shed_url)
- err_msg += 'allow updating an installed repository where the updates include newly defined repository '
- err_msg += 'or tool dependency definitions, so the repository %s cannot ' % str( repository.name )
- err_msg += 'be updated at this time. Contact the Tool Shed administrator if possible and'
- err_msg += 'ask if they can update the Tool Shed code to the latest release.'
- return trans.show_error_message( err_msg )
+ message = 'The updates available for the repository <b>%s</b> ' % str( repository.name )
+ message += 'include newly defined repository or tool dependency definitions, and attempting '
+ message += 'to update the repository resulted in the following error. Contact the Tool Shed '
+ message += 'administrator if necessary.<br/>%s' % str( e )
+ status = 'error'
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='browse_repositories',
+ message=message,
+ status=status ) )
changeset_revisions = updating_to_changeset_revision
else:
changeset_revisions = kwd.get( 'changeset_revisions', None )
@@ -1811,7 +1814,7 @@
"""Update a cloned repository to the latest revision possible."""
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- tool_shed_url = kwd[ 'tool_shed_url' ]
+ tool_shed_url = kwd.get( 'tool_shed_url', None )
name = kwd.get( 'name', None )
owner = kwd.get( 'owner', None )
changeset_revision = kwd.get( 'changeset_revision', None )
diff -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 -r aa6203b24be369697fd451e2a8dd45518d39073c 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
@@ -2535,18 +2535,19 @@
repository_metadata_id = trans.security.encode_id( repository_metadata.id ),
metadata = repository_metadata.metadata
# Get a dictionary of all repositories upon which the contents of the current repository_metadata record depend.
+ toolshed_base_url = str( web.url_for( '/', qualified=True ) ).rstrip( '/' )
repository_dependencies = \
repository_dependency_util.get_repository_dependencies_for_changeset_revision( trans=trans,
repository=repository,
repository_metadata=repository_metadata,
- toolshed_base_url=str( web.url_for( '/', qualified=True ) ).rstrip( '/' ),
+ toolshed_base_url=toolshed_base_url,
key_rd_dicts_to_be_processed=None,
all_repository_dependencies=None,
handled_key_rd_dicts=None )
if metadata:
if 'repository_dependencies' in metadata and not repository_dependencies:
- # See if we have an invalid repository dependency definition or if the repository dependency is required only for compiling the
- # repository's tool dependency.
+ # See if we have an invalid repository dependency definition or if the repository dependency is required
+ # only for compiling the repository's tool dependency.
invalid = False
repository_dependencies_dict = metadata[ 'repository_dependencies' ]
rd_tups = repository_dependencies_dict.get( 'repository_dependencies', [] )
diff -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 -r aa6203b24be369697fd451e2a8dd45518d39073c lib/tool_shed/util/commit_util.py
--- a/lib/tool_shed/util/commit_util.py
+++ b/lib/tool_shed/util/commit_util.py
@@ -138,8 +138,8 @@
def handle_complex_repository_dependency_elem( trans, elem, sub_elem_index, sub_elem, sub_elem_altered, altered, unpopulate=False ):
"""
- Populate or unpopulate the toolshed and changeset_revision attributes of a <repository> tag that defines a complex repository
- dependency.
+ Populate or unpopulate the toolshed and changeset_revision attributes of a <repository> tag that defines
+ a complex repository dependency.
"""
# The received sub_elem looks something like the following:
# <repository name="package_eigen_2_0" owner="test" prior_installation_required="True" />
@@ -153,15 +153,16 @@
altered = True
return altered, sub_elem_altered, elem, error_message
-def handle_directory_changes( trans, repository, full_path, filenames_in_archive, remove_repo_files_not_in_tar, new_repo_alert, commit_message,
- undesirable_dirs_removed, undesirable_files_removed ):
+def handle_directory_changes( trans, repository, full_path, filenames_in_archive, remove_repo_files_not_in_tar, new_repo_alert,
+ commit_message, undesirable_dirs_removed, undesirable_files_removed ):
repo_dir = repository.repo_path( trans.app )
repo = hg.repository( suc.get_configured_ui(), repo_dir )
content_alert_str = ''
files_to_remove = []
filenames_in_archive = [ os.path.join( full_path, name ) for name in filenames_in_archive ]
if remove_repo_files_not_in_tar and not repository.is_new( trans.app ):
- # We have a repository that is not new (it contains files), so discover those files that are in the repository, but not in the uploaded archive.
+ # We have a repository that is not new (it contains files), so discover those files that are in the
+ # repository, but not in the uploaded archive.
for root, dirs, files in os.walk( full_path ):
if root.find( '.hg' ) < 0 and root.find( 'hgrc' ) < 0:
for undesirable_dir in UNDESIRABLE_DIRS:
@@ -413,9 +414,10 @@
# <install version="1.0">
for actions_index, actions_elem in enumerate( package_elem ):
if actions_elem.tag == 'actions_group':
- # Inspect all entries in the <actions_group> tag set, skipping <actions> tag sets that define os and architecture
- # attributes. We want to inspect only the last <actions> tag set contained within the <actions_group> tag set to
- # see if a complex repository dependency is defined.
+ # Inspect all entries in the <actions_group> tag set, skipping <actions>
+ # tag sets that define os and architecture attributes. We want to inspect
+ # only the last <actions> tag set contained within the <actions_group> tag
+ # set to see if a complex repository dependency is defined.
for actions_group_index, actions_group_elem in enumerate( actions_elem ):
if actions_group_elem.tag == 'actions':
# Skip all actions tags that include os or architecture attributes.
diff -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 -r aa6203b24be369697fd451e2a8dd45518d39073c lib/tool_shed/util/export_util.py
--- a/lib/tool_shed/util/export_util.py
+++ b/lib/tool_shed/util/export_util.py
@@ -228,11 +228,12 @@
repository = suc.get_repository_in_tool_shed( trans, repository_id )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
# Get a dictionary of all repositories upon which the contents of the current repository_metadata record depend.
+ toolshed_base_url = str( web.url_for( '/', qualified=True ) ).rstrip( '/' )
repository_dependencies = \
repository_dependency_util.get_repository_dependencies_for_changeset_revision( trans=trans,
repository=repository,
repository_metadata=repository_metadata,
- toolshed_base_url=str( web.url_for( '/', qualified=True ) ).rstrip( '/' ),
+ toolshed_base_url=toolshed_base_url,
key_rd_dicts_to_be_processed=None,
all_repository_dependencies=None,
handled_key_rd_dicts=None )
diff -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 -r aa6203b24be369697fd451e2a8dd45518d39073c 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
@@ -106,6 +106,8 @@
only those items contained in the received repo_info_dicts list will be processed.
"""
log.debug( "Creating repository dependency objects..." )
+ # Handle secure and insecure protocol since it may change over time.
+ tool_shed_url = suc.handle_tool_shed_url_protocol( trans.app, tool_shed_url )
# The following list will be maintained within this method to contain all created or updated tool shed repositories,
# including repository dependencies that may not be installed.
all_created_or_updated_tool_shed_repositories = []
@@ -293,8 +295,8 @@
def get_repository_dependencies_for_installed_tool_shed_repository( trans, repository ):
"""
- Send a request to the appropriate tool shed to retrieve the dictionary of repository dependencies defined for the received repository which is
- installed into Galaxy. This method is called only from Galaxy.
+ Send a request to the appropriate tool shed to retrieve the dictionary of repository dependencies defined
+ for the received repository which is installed into Galaxy. This method is called only from Galaxy.
"""
tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
url = suc.url_join( tool_shed_url,
@@ -565,12 +567,13 @@
key_rd_dicts_to_be_processed = remove_from_key_rd_dicts( key_rd_dict, key_rd_dicts_to_be_processed )
else:
# The repository is in a different tool shed, so build an url and send a request.
- error_message = "Repository dependencies are currently supported only within the same tool shed. Ignoring repository dependency definition "
+ error_message = "Repository dependencies are currently supported only within the same Tool Shed. Ignoring repository dependency definition "
error_message += "for tool shed %s, name %s, owner %s, changeset revision %s" % ( toolshed, name, owner, changeset_revision )
log.debug( error_message )
return toolshed, required_repository, required_repository_metadata, repository_key_rd_dicts, key_rd_dicts_to_be_processed, handled_key_rd_dicts
-def handle_next_repository_dependency( trans, key_rd_dicts_to_be_processed, all_repository_dependencies, handled_key_rd_dicts, circular_repository_dependencies ):
+def handle_next_repository_dependency( trans, key_rd_dicts_to_be_processed, all_repository_dependencies, handled_key_rd_dicts,
+ circular_repository_dependencies ):
next_repository_key_rd_dict = key_rd_dicts_to_be_processed.pop( 0 )
next_repository_key_rd_dicts = [ next_repository_key_rd_dict ]
next_repository_key = next_repository_key_rd_dict.keys()[ 0 ]
diff -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 -r aa6203b24be369697fd451e2a8dd45518d39073c 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
@@ -1341,9 +1341,7 @@
"""
# This method is used only in Galaxy, not the tool shed.
repository_query = __repository_query( app )
- if tool_shed.find( '//' ) > 0:
- tool_shed = tool_shed.split( '//' )[1]
- tool_shed = tool_shed.rstrip( '/' )
+ tool_shed = remove_protocol_from_tool_shed_url( tool_shed )
return repository_query \
.filter( and_( app.install_model.ToolShedRepository.table.c.tool_shed == tool_shed,
app.install_model.ToolShedRepository.table.c.name == name,
@@ -1597,6 +1595,12 @@
galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
return galaxy_url
+def handle_tool_shed_url_protocol( app, tool_shed_url ):
+ """Handle secure and insecure HTTP protocol since they may change over time."""
+ tool_shed_url = remove_protocol_from_tool_shed_url( tool_shed_url )
+ tool_shed_url = get_url_from_tool_shed( app, tool_shed_url )
+ return tool_shed_url
+
def have_shed_tool_conf_for_install( trans ):
if not trans.app.toolbox.shed_tool_confs:
return False
@@ -1653,6 +1657,12 @@
except:
pass
+def remove_protocol_from_tool_shed_url( tool_shed_url ):
+ if tool_shed_url.find( '//' ) > 0:
+ tool_shed_url = tool_shed_url.split( '//' )[1]
+ tool_shed_url = tool_shed_url.rstrip( '/' )
+ return tool_shed_url
+
def __repository_query( app ):
if app.name == "galaxy":
query = app.install_model.context.query( app.install_model.ToolShedRepository )
https://bitbucket.org/galaxy/galaxy-central/commits/b37fa2ccd056/
Changeset: b37fa2ccd056
User: greg
Date: 2014-04-03 23:41:18
Summary: Merged next-stable
Affected #: 6 files
diff -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 -r b37fa2ccd056f939f3605952a6910d64490fc04c lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -137,8 +137,8 @@
action='reselect_tool_panel_section',
**kwd ) )
else:
- message = "Unable to get latest revision for repository <b>%s</b> from the tool shed, so repository " % str( repository.name )
- message += "reinstallation is not possible at this time."
+ message = "Unable to get latest revision for repository <b>%s</b> from " % str( repository.name )
+ message += "the Tool Shed, so repository reinstallation is not possible at this time."
status = "error"
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='browse_repositories',
@@ -986,12 +986,15 @@
# The Tool Shed cannot handle the get_repository_id request, so the code must be older than the
# 04/2014 Galaxy release when it was introduced. It will be safest to error out and let the
# Tool Shed admin update the Tool Shed to a later release.
- err_msg = 'The Tool Shed %s is running a code revision that does not ' % str( tool_shed_url)
- err_msg += 'allow updating an installed repository where the updates include newly defined repository '
- err_msg += 'or tool dependency definitions, so the repository %s cannot ' % str( repository.name )
- err_msg += 'be updated at this time. Contact the Tool Shed administrator if possible and'
- err_msg += 'ask if they can update the Tool Shed code to the latest release.'
- return trans.show_error_message( err_msg )
+ message = 'The updates available for the repository <b>%s</b> ' % str( repository.name )
+ message += 'include newly defined repository or tool dependency definitions, and attempting '
+ message += 'to update the repository resulted in the following error. Contact the Tool Shed '
+ message += 'administrator if necessary.<br/>%s' % str( e )
+ status = 'error'
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='browse_repositories',
+ message=message,
+ status=status ) )
changeset_revisions = updating_to_changeset_revision
else:
changeset_revisions = kwd.get( 'changeset_revisions', None )
@@ -1811,7 +1814,7 @@
"""Update a cloned repository to the latest revision possible."""
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- tool_shed_url = kwd[ 'tool_shed_url' ]
+ tool_shed_url = kwd.get( 'tool_shed_url', None )
name = kwd.get( 'name', None )
owner = kwd.get( 'owner', None )
changeset_revision = kwd.get( 'changeset_revision', None )
diff -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 -r b37fa2ccd056f939f3605952a6910d64490fc04c 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
@@ -2535,18 +2535,19 @@
repository_metadata_id = trans.security.encode_id( repository_metadata.id ),
metadata = repository_metadata.metadata
# Get a dictionary of all repositories upon which the contents of the current repository_metadata record depend.
+ toolshed_base_url = str( web.url_for( '/', qualified=True ) ).rstrip( '/' )
repository_dependencies = \
repository_dependency_util.get_repository_dependencies_for_changeset_revision( trans=trans,
repository=repository,
repository_metadata=repository_metadata,
- toolshed_base_url=str( web.url_for( '/', qualified=True ) ).rstrip( '/' ),
+ toolshed_base_url=toolshed_base_url,
key_rd_dicts_to_be_processed=None,
all_repository_dependencies=None,
handled_key_rd_dicts=None )
if metadata:
if 'repository_dependencies' in metadata and not repository_dependencies:
- # See if we have an invalid repository dependency definition or if the repository dependency is required only for compiling the
- # repository's tool dependency.
+ # See if we have an invalid repository dependency definition or if the repository dependency is required
+ # only for compiling the repository's tool dependency.
invalid = False
repository_dependencies_dict = metadata[ 'repository_dependencies' ]
rd_tups = repository_dependencies_dict.get( 'repository_dependencies', [] )
diff -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 -r b37fa2ccd056f939f3605952a6910d64490fc04c lib/tool_shed/util/commit_util.py
--- a/lib/tool_shed/util/commit_util.py
+++ b/lib/tool_shed/util/commit_util.py
@@ -138,8 +138,8 @@
def handle_complex_repository_dependency_elem( trans, elem, sub_elem_index, sub_elem, sub_elem_altered, altered, unpopulate=False ):
"""
- Populate or unpopulate the toolshed and changeset_revision attributes of a <repository> tag that defines a complex repository
- dependency.
+ Populate or unpopulate the toolshed and changeset_revision attributes of a <repository> tag that defines
+ a complex repository dependency.
"""
# The received sub_elem looks something like the following:
# <repository name="package_eigen_2_0" owner="test" prior_installation_required="True" />
@@ -153,15 +153,16 @@
altered = True
return altered, sub_elem_altered, elem, error_message
-def handle_directory_changes( trans, repository, full_path, filenames_in_archive, remove_repo_files_not_in_tar, new_repo_alert, commit_message,
- undesirable_dirs_removed, undesirable_files_removed ):
+def handle_directory_changes( trans, repository, full_path, filenames_in_archive, remove_repo_files_not_in_tar, new_repo_alert,
+ commit_message, undesirable_dirs_removed, undesirable_files_removed ):
repo_dir = repository.repo_path( trans.app )
repo = hg.repository( suc.get_configured_ui(), repo_dir )
content_alert_str = ''
files_to_remove = []
filenames_in_archive = [ os.path.join( full_path, name ) for name in filenames_in_archive ]
if remove_repo_files_not_in_tar and not repository.is_new( trans.app ):
- # We have a repository that is not new (it contains files), so discover those files that are in the repository, but not in the uploaded archive.
+ # We have a repository that is not new (it contains files), so discover those files that are in the
+ # repository, but not in the uploaded archive.
for root, dirs, files in os.walk( full_path ):
if root.find( '.hg' ) < 0 and root.find( 'hgrc' ) < 0:
for undesirable_dir in UNDESIRABLE_DIRS:
@@ -413,9 +414,10 @@
# <install version="1.0">
for actions_index, actions_elem in enumerate( package_elem ):
if actions_elem.tag == 'actions_group':
- # Inspect all entries in the <actions_group> tag set, skipping <actions> tag sets that define os and architecture
- # attributes. We want to inspect only the last <actions> tag set contained within the <actions_group> tag set to
- # see if a complex repository dependency is defined.
+ # Inspect all entries in the <actions_group> tag set, skipping <actions>
+ # tag sets that define os and architecture attributes. We want to inspect
+ # only the last <actions> tag set contained within the <actions_group> tag
+ # set to see if a complex repository dependency is defined.
for actions_group_index, actions_group_elem in enumerate( actions_elem ):
if actions_group_elem.tag == 'actions':
# Skip all actions tags that include os or architecture attributes.
diff -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 -r b37fa2ccd056f939f3605952a6910d64490fc04c lib/tool_shed/util/export_util.py
--- a/lib/tool_shed/util/export_util.py
+++ b/lib/tool_shed/util/export_util.py
@@ -228,11 +228,12 @@
repository = suc.get_repository_in_tool_shed( trans, repository_id )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
# Get a dictionary of all repositories upon which the contents of the current repository_metadata record depend.
+ toolshed_base_url = str( web.url_for( '/', qualified=True ) ).rstrip( '/' )
repository_dependencies = \
repository_dependency_util.get_repository_dependencies_for_changeset_revision( trans=trans,
repository=repository,
repository_metadata=repository_metadata,
- toolshed_base_url=str( web.url_for( '/', qualified=True ) ).rstrip( '/' ),
+ toolshed_base_url=toolshed_base_url,
key_rd_dicts_to_be_processed=None,
all_repository_dependencies=None,
handled_key_rd_dicts=None )
diff -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 -r b37fa2ccd056f939f3605952a6910d64490fc04c 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
@@ -106,6 +106,8 @@
only those items contained in the received repo_info_dicts list will be processed.
"""
log.debug( "Creating repository dependency objects..." )
+ # Handle secure and insecure protocol since it may change over time.
+ tool_shed_url = suc.handle_tool_shed_url_protocol( trans.app, tool_shed_url )
# The following list will be maintained within this method to contain all created or updated tool shed repositories,
# including repository dependencies that may not be installed.
all_created_or_updated_tool_shed_repositories = []
@@ -293,8 +295,8 @@
def get_repository_dependencies_for_installed_tool_shed_repository( trans, repository ):
"""
- Send a request to the appropriate tool shed to retrieve the dictionary of repository dependencies defined for the received repository which is
- installed into Galaxy. This method is called only from Galaxy.
+ Send a request to the appropriate tool shed to retrieve the dictionary of repository dependencies defined
+ for the received repository which is installed into Galaxy. This method is called only from Galaxy.
"""
tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
url = suc.url_join( tool_shed_url,
@@ -565,12 +567,13 @@
key_rd_dicts_to_be_processed = remove_from_key_rd_dicts( key_rd_dict, key_rd_dicts_to_be_processed )
else:
# The repository is in a different tool shed, so build an url and send a request.
- error_message = "Repository dependencies are currently supported only within the same tool shed. Ignoring repository dependency definition "
+ error_message = "Repository dependencies are currently supported only within the same Tool Shed. Ignoring repository dependency definition "
error_message += "for tool shed %s, name %s, owner %s, changeset revision %s" % ( toolshed, name, owner, changeset_revision )
log.debug( error_message )
return toolshed, required_repository, required_repository_metadata, repository_key_rd_dicts, key_rd_dicts_to_be_processed, handled_key_rd_dicts
-def handle_next_repository_dependency( trans, key_rd_dicts_to_be_processed, all_repository_dependencies, handled_key_rd_dicts, circular_repository_dependencies ):
+def handle_next_repository_dependency( trans, key_rd_dicts_to_be_processed, all_repository_dependencies, handled_key_rd_dicts,
+ circular_repository_dependencies ):
next_repository_key_rd_dict = key_rd_dicts_to_be_processed.pop( 0 )
next_repository_key_rd_dicts = [ next_repository_key_rd_dict ]
next_repository_key = next_repository_key_rd_dict.keys()[ 0 ]
diff -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 -r b37fa2ccd056f939f3605952a6910d64490fc04c 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
@@ -1341,9 +1341,7 @@
"""
# This method is used only in Galaxy, not the tool shed.
repository_query = __repository_query( app )
- if tool_shed.find( '//' ) > 0:
- tool_shed = tool_shed.split( '//' )[1]
- tool_shed = tool_shed.rstrip( '/' )
+ tool_shed = remove_protocol_from_tool_shed_url( tool_shed )
return repository_query \
.filter( and_( app.install_model.ToolShedRepository.table.c.tool_shed == tool_shed,
app.install_model.ToolShedRepository.table.c.name == name,
@@ -1597,6 +1595,12 @@
galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
return galaxy_url
+def handle_tool_shed_url_protocol( app, tool_shed_url ):
+ """Handle secure and insecure HTTP protocol since they may change over time."""
+ tool_shed_url = remove_protocol_from_tool_shed_url( tool_shed_url )
+ tool_shed_url = get_url_from_tool_shed( app, tool_shed_url )
+ return tool_shed_url
+
def have_shed_tool_conf_for_install( trans ):
if not trans.app.toolbox.shed_tool_confs:
return False
@@ -1653,6 +1657,12 @@
except:
pass
+def remove_protocol_from_tool_shed_url( tool_shed_url ):
+ if tool_shed_url.find( '//' ) > 0:
+ tool_shed_url = tool_shed_url.split( '//' )[1]
+ tool_shed_url = tool_shed_url.rstrip( '/' )
+ return tool_shed_url
+
def __repository_query( app ):
if app.name == "galaxy":
query = app.install_model.context.query( app.install_model.ToolShedRepository )
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.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ea1fbe9d5bdb/
Changeset: ea1fbe9d5bdb
User: greg
Date: 2014-04-03 18:00:25
Summary: Add exception handling when updating an installed repository to a revision that include newly defined dependency definitions.
Affected #: 1 file
diff -r 4f3190509ba240ae8227b2321237876e3e66ecb2 -r ea1fbe9d5bdb9435830c3f2d2dbc623a22d4b1a4 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -976,10 +976,22 @@
# update_to_changeset_revision() method. We need to get the id of the same repository from the
# Tool Shed side.
repository = suc.get_tool_shed_repository_by_id( trans, updating_repository_id )
- url = suc.url_join( tool_shed_url,
- 'repository/get_repository_id?name=%s&owner=%s' % \
- ( str( repository.name ), str( repository.owner ) ) )
- repository_ids = common_util.tool_shed_get( trans.app, tool_shed_url, url )
+ # For backward compatibility to the 12/20/12 Galaxy release.
+ try:
+ url = suc.url_join( tool_shed_url,
+ 'repository/get_repository_id?name=%s&owner=%s' % \
+ ( str( repository.name ), str( repository.owner ) ) )
+ repository_ids = common_util.tool_shed_get( trans.app, tool_shed_url, url )
+ except Exception, e:
+ # The Tool Shed cannot handle the get_repository_id request, so the code must be older than the
+ # 04/2014 Galaxy release when it was introduced. It will be safest to error out and let the
+ # Tool Shed admin update the Tool Shed to a later release.
+ err_msg = 'The Tool Shed %s is running a code revision that does not ' % str( tool_shed_url)
+ err_msg += 'allow updating an installed repository where the updates include newly defined repository '
+ err_msg += 'or tool dependency definitions, so the repository %s cannot ' % str( repository.name )
+ err_msg += 'be updated at this time. Contact the Tool Shed administrator if possible and'
+ err_msg += 'ask if they can update the Tool Shed code to the latest release.'
+ return trans.show_error_message( err_msg )
changeset_revisions = updating_to_changeset_revision
else:
changeset_revisions = kwd.get( 'changeset_revisions', None )
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.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4f3190509ba2/
Changeset: 4f3190509ba2
User: dan
Date: 2014-04-03 17:17:47
Summary: Change Biostar 'submit' parameter to be called 'action'. Resolves needing to use workaround of 'click()' on submit button instead of submit() on form.
Affected #: 2 files
diff -r 59bd7349a128f06de64f6656f553887b09f18ea2 -r 4f3190509ba240ae8227b2321237876e3e66ecb2 lib/galaxy/util/biostar.py
--- a/lib/galaxy/util/biostar.py
+++ b/lib/galaxy/util/biostar.py
@@ -142,6 +142,6 @@
payload[ 'content' ] = "%s<br />%s" % ( payload['content'], payload2['content'] )
if 'tag_val' in payload2:
payload[ 'tag_val' ] = ','.join( [ payload2[ 'tag_val' ], payload[ 'tag_val' ] ] )
- if 'submit' not in payload:
- payload[ 'submit' ] = 1 #Automatically post bug reports to biostar
+ if 'action' not in payload:
+ payload[ 'action' ] = 1 #Automatically post bug reports to biostar
return payload
diff -r 59bd7349a128f06de64f6656f553887b09f18ea2 -r 4f3190509ba240ae8227b2321237876e3e66ecb2 templates/webapps/galaxy/biostar/post_redirect.mako
--- a/templates/webapps/galaxy/biostar/post_redirect.mako
+++ b/templates/webapps/galaxy/biostar/post_redirect.mako
@@ -4,9 +4,8 @@
${parent.javascripts()}
<script>
$( document ).ready( function(){
- $("#postRedirect").hide();
- ##need to use 'click()' on submit button instead of submit() on form, since Biostar uses a parameter named 'submit'
- $("#GalaxySubmitPostRedirectForm").click();
+ $("div#postRedirect").hide();
+ $("form#postRedirectForm").submit();
});
</script></%def>
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.