1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ed15e6865e1e/
Changeset: ed15e6865e1e
User: dannon
Date: 2013-04-03 20:58:42
Summary: Add functionality for deleting all hidden datasets in a history. This is card https://trello.com/c/0SoREcMn
Affected #: 2 files
diff -r a3e96840fd63592d234a1e50b2d5e201fe430b3f -r ed15e6865e1e8d0648cd307f7026ac284da7553a lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -498,6 +498,21 @@
return trans.fill_template( "history/display_structured.mako", items=items )
@web.expose
+ def delete_hidden_datasets( self, trans ):
+ """
+ This method deletes all hidden datasets in the current history.
+ """
+ count = 0
+ for hda in trans.history.datasets:
+ if not hda.visible and not hda.deleted and not hda.purged:
+ hda.mark_deleted()
+ count += 1
+ trans.sa_session.add( hda )
+ trans.log_event( "HDA id %s has been deleted" % hda.id )
+ trans.sa_session.flush()
+ return trans.show_ok_message( "%d hidden datasets have been deleted" % count, refresh_frames=['history'] )
+
+ @web.expose
def purge_deleted_datasets( self, trans ):
count = 0
if trans.app.config.allow_user_dataset_purge:
diff -r a3e96840fd63592d234a1e50b2d5e201fe430b3f -r ed15e6865e1e8d0648cd307f7026ac284da7553a templates/webapps/galaxy/root/index.mako
--- a/templates/webapps/galaxy/root/index.mako
+++ b/templates/webapps/galaxy/root/index.mako
@@ -45,6 +45,11 @@
galaxy_main.location = "${h.url_for( controller='history', action='unhide_datasets', current=True )}";
}
},
+ "${_("Delete Hidden Datasets")}": function() {
+ if ( confirm( "Really delete all hidden datasets?" ) ) {
+ galaxy_main.location = "${h.url_for( controller='history', action='delete_hidden_datasets')}";
+ }
+ },
"${_("Purge Deleted Datasets")}": function() {
if ( confirm( "Really delete all deleted datasets permanently? This cannot be undone." ) ) {
galaxy_main.location = "${h.url_for( controller='history', action='purge_deleted_datasets' )}";
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/a3e96840fd63/
Changeset: a3e96840fd63
User: inithello
Date: 2013-04-03 20:32:29
Summary: Add the test data required by 9259:0dc6a4052711.
Affected #: 1 file
diff -r 0dc6a4052711af50bbfaa438f3d591ff9bae4175 -r a3e96840fd63592d234a1e50b2d5e201fe430b3f test/tool_shed/test_data/htseq_count/htseq_count.tar
Binary file test/tool_shed/test_data/htseq_count/htseq_count.tar has changed
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/0dc6a4052711/
Changeset: 0dc6a4052711
User: inithello
Date: 2013-04-03 17:56:58
Summary: Tool shed functional test enhancements. Functional tests for displaying images on a tool's page. Updated test string in tool migration stage test.
Affected #: 5 files
diff -r 1c7460ba03f9363c9d96e35dc53c3d3f95002346 -r 0dc6a4052711af50bbfaa438f3d591ff9bae4175 test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -838,6 +838,11 @@
self.visit_url( url )
self.check_for_strings( strings_displayed, strings_not_displayed )
+ def load_page_for_installed_tool( self, tool_guid, strings_displayed=[], strings_not_displayed=[] ):
+ url = '/tool_runner?tool_id=%s' % tool_guid
+ self.visit_galaxy_url( url )
+ self.check_for_strings( strings_displayed, strings_not_displayed )
+
def load_workflow_image_in_tool_shed( self, repository, workflow_name, changeset_revision=None, strings_displayed=[], strings_not_displayed=[] ):
if not changeset_revision:
changeset_revision = self.get_repository_tip( repository )
diff -r 1c7460ba03f9363c9d96e35dc53c3d3f95002346 -r 0dc6a4052711af50bbfaa438f3d591ff9bae4175 test/tool_shed/functional/test_0140_tool_help_images.py
--- /dev/null
+++ b/test/tool_shed/functional/test_0140_tool_help_images.py
@@ -0,0 +1,86 @@
+from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
+import tool_shed.base.test_db_util as test_db_util
+import logging
+log = logging.getLogger(__name__)
+
+repository_name = 'htseq_count_0140'
+repository_description = "Converter: BED to GFF"
+repository_long_description = "Convert bed to gff"
+
+category_name = 'Test 0140 Tool Help Images'
+category_description = 'Test 0140 Tool Help Images'
+
+'''
+1) Create and populate the htseq_count_0140 repository.
+2) Visit the manage_repository page.
+3) Simulate clicking the htseq_count tool button.
+4) On the resulting display tool page, look for the image string similar to the following string where the encoded repository_id is previously determined:
+
+src="/repository/static/images/<id>/count_modes.png"
+
+'''
+
+
+class TestToolHelpImages( ShedTwillTestCase ):
+ '''Test features related to tool help images.'''
+
+ def test_0000_initiate_users( self ):
+ """Create necessary user accounts."""
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
+ test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ self.logout()
+ self.login( email=common.admin_email, username=common.admin_username )
+ admin_user = test_db_util.get_user( common.admin_email )
+ assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email
+ admin_user_private_role = test_db_util.get_private_role( admin_user )
+
+ def test_0005_create_htseq_count_repository( self ):
+ '''Create and populate htseq_count_0140.'''
+ '''
+ We are at step 1 - Create and populate the htseq_count_0140 repository.
+ Create the htseq_count_0140 repository and upload the tarball.
+ '''
+ category = self.create_category( name=category_name, description=category_description )
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ # Create a repository named htseq_count_0140 owned by user1.
+ repository = self.get_or_create_repository( name=repository_name,
+ description=repository_description,
+ long_description=repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Upload htseq_count.tar to the repository.
+ self.upload_file( repository,
+ filename='htseq_count/htseq_count.tar',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Uploaded htseq_count.tar.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0010_load_tool_page( self ):
+ '''Load the tool page and check for the image.'''
+ '''
+ We are at step 2
+ Visit the manage_repository page and the tool page, and look for the image url
+ similar to the following string:
+
+ src="/repository/static/images/<id>/count_modes.png"
+ '''
+ repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ # Get the repository tip.
+ changeset_revision = self.get_repository_tip( repository )
+ self.display_manage_repository_page( repository )
+ # Generate the image path.
+ image_path = 'src="/repository/static/images/%s/count_modes.png"' % self.security.encode_id( repository.id )
+ # The repository uploaded in this test should only have one metadata revision, with one tool defined, which
+ # should be the tool that contains a link to the image.
+ repository_metadata = repository.metadata_revisions[ 0 ].metadata
+ tool_path = repository_metadata[ 'tools' ][ 0 ][ 'tool_config' ]
+ self.load_display_tool_page( repository, tool_path, changeset_revision, strings_displayed=[ image_path ], strings_not_displayed=[] )
diff -r 1c7460ba03f9363c9d96e35dc53c3d3f95002346 -r 0dc6a4052711af50bbfaa438f3d591ff9bae4175 test/tool_shed/functional/test_0430_browse_utilities.py
--- a/test/tool_shed/functional/test_0430_browse_utilities.py
+++ b/test/tool_shed/functional/test_0430_browse_utilities.py
@@ -1,7 +1,8 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
import tool_shed.base.test_db_util as test_db_util
import logging
-log = logging.getLogger(__name__)
+
+log = logging.getLogger( __name__ )
datatypes_repository_name = 'emboss_datatypes_0430'
datatypes_repository_description = 'Galaxy applicable datatypes for EMBOSS for test 0430'
diff -r 1c7460ba03f9363c9d96e35dc53c3d3f95002346 -r 0dc6a4052711af50bbfaa438f3d591ff9bae4175 test/tool_shed/functional/test_1140_tool_help_images.py
--- /dev/null
+++ b/test/tool_shed/functional/test_1140_tool_help_images.py
@@ -0,0 +1,119 @@
+from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
+import tool_shed.base.test_db_util as test_db_util
+import logging
+log = logging.getLogger(__name__)
+
+repository_name = 'htseq_count_0140'
+repository_description = "Converter: BED to GFF"
+repository_long_description = "Convert bed to gff"
+
+category_name = 'Test 0140 Tool Help Images'
+category_description = 'Test 0140 Tool Help Images'
+
+'''
+1) Create and populate the htseq_count_0140 repository.
+2) Visit the manage_repository page, then the tool page, and look for the image string
+similar to the following string where the encoded repository_id is previously determined:
+
+src="/repository/static/images/<id>/count_modes.png"
+
+Galaxy side:
+1) Install the htseq_count repository from the tool shed into Galaxy.
+2) In the center tool panel, look for the image string similar to the following string where the encoded_repository_id is previously determined as the installed ToolShedRepository id:
+
+src="/tool_runner/static/images/<id>/count_modes.png"
+'''
+
+
+class TestToolHelpImages( ShedTwillTestCase ):
+ '''Test features related to tool help images.'''
+
+ def test_0000_initiate_users( self ):
+ """Create necessary user accounts."""
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
+ test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ self.logout()
+ self.login( email=common.admin_email, username=common.admin_username )
+ admin_user = test_db_util.get_user( common.admin_email )
+ assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email
+ admin_user_private_role = test_db_util.get_private_role( admin_user )
+
+ def test_0005_create_htseq_count_repository( self ):
+ '''Create and populate htseq_count_0140.'''
+ '''
+ We are at step 1 - Create and populate the htseq_count_0140 repository.
+ Create the htseq_count_0140 repository and upload the tarball.
+ '''
+ category = self.create_category( name=category_name, description=category_description )
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ # Create a repository named htseq_count_0140 owned by user1.
+ repository = self.get_or_create_repository( name=repository_name,
+ description=repository_description,
+ long_description=repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ if self.repository_is_new( repository ):
+ # Upload htseq_count.tar to the repository if it hasn't already been populated.
+ self.upload_file( repository,
+ filename='htseq_count/htseq_count.tar',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Uploaded htseq_count.tar.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0010_load_tool_page( self ):
+ '''Load the tool page and check for the image URL.'''
+ '''
+ This is a duplicate of test method _0010 in test_0140_tool_help_images.
+ '''
+ repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ # Get the repository tip.
+ changeset_revision = self.get_repository_tip( repository )
+ self.display_manage_repository_page( repository )
+ # Generate the image path.
+ image_path = 'src="/repository/static/images/%s/count_modes.png"' % self.security.encode_id( repository.id )
+ # The repository uploaded in this test should only have one metadata revision, with one tool defined, which
+ # should be the tool that contains a link to the image.
+ repository_metadata = repository.metadata_revisions[ 0 ].metadata
+ tool_path = repository_metadata[ 'tools' ][ 0 ][ 'tool_config' ]
+ self.load_display_tool_page( repository, tool_path, changeset_revision, strings_displayed=[ image_path ], strings_not_displayed=[] )
+
+ def test_0015_install_htseq_count_repository( self ):
+ '''Install the htseq_count_0140 repository into Galaxy.'''
+ '''
+ We are at step 1 - Install the htseq_count_0140 repository from the tool shed into Galaxy.
+ '''
+ repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ self.galaxy_logout()
+ self.galaxy_login( email=common.admin_email, username=common.admin_username )
+ self.install_repository( 'htseq_count_0140',
+ 'user1',
+ category_name,
+ strings_displayed=[],
+ install_tool_dependencies=False,
+ install_repository_dependencies=False )
+
+ def test_0020_verify_tool_image_link( self ):
+ '''Load the tool page and verify the image link.'''
+ '''
+ We are at step 2
+
+ In the center tool panel, look for the image string similar to the following string where the
+ encoded_repository_id is previously determined as the installed ToolShedRepository id:
+
+ src="/tool_runner/static/images/<id>/count_modes.png"
+ '''
+ repository = test_db_util.get_installed_repository_by_name_owner( repository_name, common.test_user_1_name )
+ image_path = 'src="/tool_runner/static/images/%s/count_modes.png"' % self.security.encode_id( repository.id )
+ # The repository uploaded in this test should only define one tool, which should be the tool that contains a link to an image.
+ repository_metadata = repository.metadata
+ tool_id = repository_metadata[ 'tools' ][ 0 ][ 'guid' ]
+ self.load_page_for_installed_tool( tool_id, strings_displayed=[ image_path ] )
diff -r 1c7460ba03f9363c9d96e35dc53c3d3f95002346 -r 0dc6a4052711af50bbfaa438f3d591ff9bae4175 test/tool_shed/functional/test_1400_review_migration_stages.py
--- a/test/tool_shed/functional/test_1400_review_migration_stages.py
+++ b/test/tool_shed/functional/test_1400_review_migration_stages.py
@@ -1,8 +1,10 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
import tool_shed.base.test_db_util as test_db_util
+
class TestToolMigrationStages( ShedTwillTestCase ):
'''Verify that the migration stages display correctly.'''
+
def test_0000_initiate_users( self ):
"""Create necessary user accounts and login as an admin user."""
self.logout()
@@ -15,11 +17,12 @@
admin_user = test_db_util.get_user( common.admin_email )
assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email
admin_user_private_role = test_db_util.get_private_role( admin_user )
+
def test_0005_load_migration_stages_page( self ):
'''Load the migration page and check for the appropriate migration stages.'''
stages = [
'emboss_5', 'emboss_datatypes', 'emboss', '5.0.0', '0002_tools.sh',
- 'freebayes', '0.9.4_a46483351fd0196637614121868fb5c386612b55', 'samtools', '0.1.18', 'FreeBayes requires g++',
+ 'freebayes', '0.9.4_9696d0ce8a962f7bb61c4791be5ce44312b81cf8', 'samtools', '0.1.18', 'FreeBayes requires g++',
'ncurses', 'zlib', '0003_tools.sh',
'ncbi_blast_plus', 'blast_datatypes', 'blast+', '2.2.26+', 'blast.ncbi.nlm.nih.gov', 'NCBI BLAST+ tools', '0004_tools.sh',
'bwa_wrappers', '0.5.9', 'zlib and libpthread', 'Map with BWA for Illumina', '0005_tools.sh',
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/1c7460ba03f9/
Changeset: 1c7460ba03f9
User: dannon
Date: 2013-04-03 17:54:28
Summary: Allow anonymous access to list/show in api/histories.
Affected #: 1 file
diff -r c1faecf25f52a01cf55ba95df42791bf3399ed59 -r 1c7460ba03f9363c9d96e35dc53c3d3f95002346 lib/galaxy/webapps/galaxy/api/histories.py
--- a/lib/galaxy/webapps/galaxy/api/histories.py
+++ b/lib/galaxy/webapps/galaxy/api/histories.py
@@ -11,7 +11,7 @@
class HistoriesController( BaseAPIController, UsesHistoryMixin ):
- @web.expose_api
+ @web.expose_api_anonymous
def index( self, trans, deleted='False', **kwd ):
"""
GET /api/histories
@@ -42,7 +42,7 @@
trans.response.status = 500
return rval
- @web.expose_api
+ @web.expose_api_anonymous
def show( self, trans, id, deleted='False', **kwd ):
"""
GET /api/histories/{encoded_history_id}
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/65d18f3829a0/
Changeset: 65d18f3829a0
User: dannon
Date: 2013-04-02 23:20:18
Summary: Swap history_contents to use expose_api_anonymous.
Affected #: 1 file
diff -r 4ed80ec3f309f5c8e1c9e735666a2b9b682ff388 -r 65d18f3829a0771910af5b65b5e4c9ed59774b2b lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -12,7 +12,7 @@
class HistoryContentsController( BaseAPIController, UsesHistoryDatasetAssociationMixin, UsesHistoryMixin,
UsesLibraryMixin, UsesLibraryMixinItems ):
- @web.expose_api
+ @web.expose_api_anonymous
def index( self, trans, history_id, ids=None, **kwd ):
"""
GET /api/histories/{encoded_history_id}/contents
@@ -35,7 +35,7 @@
try:
# get the history, if anon user and requesting current history - allow it
if( ( trans.user == None )
- and ( history_id == trans.security.encode_id( trans.history.id ) ) ):
+ and ( history_id == trans.security.encode_id( trans.history.id ) ) ):
#TODO:?? is secure?
history = trans.history
@@ -117,7 +117,7 @@
'error' : str( exception )
}
- @web.expose_api
+ @web.expose_api_anonymous
def show( self, trans, id, history_id, **kwd ):
"""
GET /api/histories/{encoded_history_id}/contents/{encoded_content_id}
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.