mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Tool versioning: now store version information in hda/ldda tables. Information is kept when copied between hda/ldda, and now displayed in the "Show Info" pages for hdas and lddas.
This commit is contained in:
@@ -534,7 +534,7 @@ class JobWrapper( object ):
|
||||
if self.version_string_cmd:
|
||||
version_filename = self.get_version_string_path()
|
||||
if os.path.exists(version_filename):
|
||||
self.version_string = "Tool version: %s" % open(version_filename).read()
|
||||
self.version_string = open(version_filename).read()
|
||||
os.unlink(version_filename)
|
||||
|
||||
if self.app.config.outputs_to_working_directory:
|
||||
@@ -587,7 +587,8 @@ class JobWrapper( object ):
|
||||
|
||||
dataset.blurb = 'done'
|
||||
dataset.peek = 'no peek'
|
||||
dataset.info = context['stdout'] + context['stderr'] + self.version_string
|
||||
dataset.info = context['stdout'] + context['stderr']
|
||||
dataset.tool_version = self.version_string
|
||||
dataset.set_size()
|
||||
if context['stderr']:
|
||||
dataset.blurb = "error"
|
||||
|
||||
@@ -753,7 +753,7 @@ class DatasetInstance( object ):
|
||||
"""A base class for all 'dataset instances', HDAs, LDAs, etc"""
|
||||
states = Dataset.states
|
||||
permitted_actions = Dataset.permitted_actions
|
||||
def __init__( self, id=None, hid=None, name=None, info=None, blurb=None, peek=None, extension=None,
|
||||
def __init__( self, id=None, hid=None, name=None, info=None, blurb=None, peek=None, tool_version=None, extension=None,
|
||||
dbkey=None, metadata=None, history=None, dataset=None, deleted=False, designation=None,
|
||||
parent_id=None, validation_errors=None, visible=True, create_dataset=False, sa_session=None ):
|
||||
self.name = name or "Unnamed dataset"
|
||||
@@ -761,6 +761,7 @@ class DatasetInstance( object ):
|
||||
self.info = info
|
||||
self.blurb = blurb
|
||||
self.peek = peek
|
||||
self.tool_version = tool_version
|
||||
self.extension = extension
|
||||
self.designation = designation
|
||||
self.metadata = metadata or dict()
|
||||
@@ -1020,6 +1021,7 @@ class HistoryDatasetAssociation( DatasetInstance ):
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
tool_version=self.tool_version,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset = self.dataset,
|
||||
@@ -1057,6 +1059,7 @@ class HistoryDatasetAssociation( DatasetInstance ):
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
tool_version=self.tool_version,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
@@ -1410,6 +1413,7 @@ class LibraryDatasetDatasetAssociation( DatasetInstance ):
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
tool_version=self.tool_version,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
@@ -1434,6 +1438,7 @@ class LibraryDatasetDatasetAssociation( DatasetInstance ):
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
tool_version=self.tool_version,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
|
||||
@@ -113,6 +113,7 @@ HistoryDatasetAssociation.table = Table( "history_dataset_association", metadata
|
||||
Column( "info", TrimmedString( 255 ) ),
|
||||
Column( "blurb", TrimmedString( 255 ) ),
|
||||
Column( "peek" , TEXT ),
|
||||
Column( "tool_version" , TEXT ),
|
||||
Column( "extension", TrimmedString( 64 ) ),
|
||||
Column( "metadata", MetadataType(), key="_metadata" ),
|
||||
Column( "parent_id", Integer, ForeignKey( "history_dataset_association.id" ), nullable=True ),
|
||||
@@ -305,6 +306,7 @@ LibraryDatasetDatasetAssociation.table = Table( "library_dataset_dataset_associa
|
||||
Column( "info", TrimmedString( 255 ) ),
|
||||
Column( "blurb", TrimmedString( 255 ) ),
|
||||
Column( "peek" , TEXT ),
|
||||
Column( "tool_version" , TEXT ),
|
||||
Column( "extension", TrimmedString( 64 ) ),
|
||||
Column( "metadata", MetadataType(), key="_metadata" ),
|
||||
Column( "parent_id", Integer, ForeignKey( "library_dataset_dataset_association.id" ), nullable=True ),
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
"""
|
||||
Migration script to add a 'tool_version' column to the hda/ldda tables.
|
||||
"""
|
||||
|
||||
from sqlalchemy import *
|
||||
from sqlalchemy.orm import *
|
||||
from migrate import *
|
||||
from migrate.changeset import *
|
||||
|
||||
from galaxy.model.custom_types import *
|
||||
|
||||
metadata = MetaData( migrate_engine )
|
||||
db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) )
|
||||
|
||||
def upgrade():
|
||||
print __doc__
|
||||
metadata.reflect()
|
||||
try:
|
||||
hda_table = Table( "history_dataset_association", metadata, autoload=True )
|
||||
c = Column( "tool_version", TEXT )
|
||||
c.create( hda_table )
|
||||
assert c is hda_table.c.tool_version
|
||||
|
||||
ldda_table = Table( "library_dataset_dataset_association", metadata, autoload=True )
|
||||
c = Column( "tool_version", TEXT )
|
||||
c.create( ldda_table )
|
||||
assert c is ldda_table.c.tool_version
|
||||
|
||||
except Exception, e:
|
||||
print "Adding the tool_version column to the hda/ldda tables failed: ", str( e )
|
||||
|
||||
def downgrade():
|
||||
metadata.reflect()
|
||||
try:
|
||||
hda_table = Table( "history_dataset_association", metadata, autoload=True )
|
||||
hda_table.c.tool_version.drop()
|
||||
|
||||
ldda_table = Table( "library_dataset_dataset_association", metadata, autoload=True )
|
||||
ldda_table.c.tool_version.drop()
|
||||
except Exception, e:
|
||||
print "Dropping the tool_version column from hda/ldda table failed: ", str( e )
|
||||
@@ -100,6 +100,13 @@
|
||||
${ldda.get_size( nice_size=True )}
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
%if ldda.tool_version:
|
||||
<div class="form-row">
|
||||
<label>Tool version:</label>
|
||||
${ldda.tool_version}
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
%endif
|
||||
<div class="form-row">
|
||||
<label>Data type:</label>
|
||||
${ldda.ext}
|
||||
@@ -154,7 +161,7 @@
|
||||
%endfor
|
||||
%if ldda.peek != "no peek":
|
||||
<div class="form-row">
|
||||
<div id="info${ldda.id}" class="historyItemBody">
|
||||
<div id="info${ldda.id}" class="historyItemBody">
|
||||
<label>Peek:</label>
|
||||
<div><pre id="peek${ldda.id}" class="peek">${ldda.display_peek()}</pre></div>
|
||||
</div>
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
<tr><td>Filesize:</td><td>${nice_size(hda.dataset.file_size)}</td></tr>
|
||||
<tr><td>Dbkey:</td><td>${hda.dbkey}</td></tr>
|
||||
<tr><td>Format:</td><td>${hda.ext}</td></tr>
|
||||
<tr><td>Tool Version:</td><td>${hda.tool_version}</td></tr>
|
||||
</table>
|
||||
<br />
|
||||
<table class="tabletip">
|
||||
|
||||
Reference in New Issue
Block a user