New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.01] More robust nametag discovery and propagation. #5403

Merged
merged 3 commits into from Feb 2, 2018

Conversation

Projects
None yet
4 participants
@jmchilton
Member

jmchilton commented Jan 27, 2018

  • Nametags weren't being discovered on collection inputs - so for instance tools that take in a single collection and produce a dataset or file weren't propagating nametags (unless the collection contents had tags). To see this create two unnamed datasets without tags, create a pair from them, add a tag to the pair, and run the pair through the "paired_test" test tool.
  • Nametags weren't being propagated to the outputs of collection operations - to either dataset or collection outputs.

This PR fixes both problems I think.

Ping @nekrut

@dannon

This comment has been minimized.

Member

dannon commented Jan 27, 2018

@jmchilton Thanks for taking a look at this; I'd been playing whack-a-mole trying to nail down all the places this needed to be handled.

@mvdbeek

Works great, thanks @jmchilton!

@@ -2486,6 +2486,12 @@ def copy(self, parent_id=None):
object_session(self).flush()
return hda
def copy_tags_to(self, copy_tags=None):
if copy_tags is not None:
for _, tag in copy_tags.items():

This comment has been minimized.

@mvdbeek

mvdbeek Jan 29, 2018

Member

we could just use for tag in copy_tags.values()

preserved_tags[tag.value] = tag
# grap tags from incoming HDCAs
for key, collection_pairs in inp_dataset_collections.items():

This comment has been minimized.

@mvdbeek

mvdbeek Jan 29, 2018

Member

given that we're not using key we could just use for collection_pairs in inp_dataset_collections.values():

# grap tags from incoming HDAs
preserved_tags = {}
for data in inp_data.values():
for tag in [t for t in data.tags if t.user_tname == 'name']:

This comment has been minimized.

@mvdbeek

mvdbeek Feb 1, 2018

Member
Traceback (most recent call last):
  File "/galaxy/lib/galaxy/tools/__init__.py", line 1360, in handle_single_execution
    completed_job=completed_job,
  File "/galaxy/lib/galaxy/tools/__init__.py", line 1441, in execute
    return self.tool_action.execute(self, trans, incoming=incoming, set_output_hid=set_output_hid, history=history, **kwargs)
  File "/galaxy/lib/galaxy/tools/actions/__init__.py", line 224, in execute
    history, inp_data, inp_dataset_collections, preserved_tags = self._collect_inputs(tool, trans, incoming, history, current_user_roles)
  File "/galaxy/lib/galaxy/tools/actions/__init__.py", line 199, in _collect_inputs
    for tag in [t for t in data.tags if t.user_tname == 'name']:
AttributeError: 'NoneType' object has no attribute 'tags'

Looks like data can be None for optional inputs, so I guess you need to wrap this in an additional if data:

This comment has been minimized.

@jmchilton

jmchilton Feb 2, 2018

Member

Ahh - okay - thanks!

# if sub-collection mapping, this will be an DC not an HDCA
# (e.g. part of collection not a collection instance) and thus won't have tags.
if hasattr(collection, "tags"):
for tag in [t for t in collection.tags if t.user_tname == 'name']:

This comment has been minimized.

@mvdbeek

mvdbeek Feb 1, 2018

Member

Probably the same issue here.
Probably not an issue here because of line 207.

jmchilton added some commits Jan 26, 2018

More robust nametag discovery and propagation.
- Nametags weren't being picked up on collection inputs - so for instance tools that take in a single collection and produce a dataset or file weren't propagating nametags (unless the collection contents had tags). To see this create two unnamed datasets without tags, create a pair from them, add a tag to the pair, and run the pair through the "paired_test" test tool.
- Nametags weren't being propagated to the outputs of collection operations.

@mvdbeek mvdbeek merged commit 60561c2 into galaxyproject:release_18.01 Feb 2, 2018

6 checks passed

api test Build finished. 342 tests run, 4 skipped, 0 failed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
framework test Build finished. 171 tests run, 0 skipped, 0 failed.
Details
integration test Build finished. 79 tests run, 4 skipped, 0 failed.
Details
selenium test Build finished. 118 tests run, 3 skipped, 0 failed.
Details
toolshed test Build finished. 577 tests run, 0 skipped, 0 failed.
Details
@mvdbeek

This comment has been minimized.

Member

mvdbeek commented Feb 2, 2018

Great, thanks a lot @jmchilton !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment