Skip to content

Fixes and improvements for galaxy.json.#2697

Merged
mvdbeek merged 9 commits intogalaxyproject:devfrom
jmchilton:metadata_fixing
Aug 17, 2016
Merged

Fixes and improvements for galaxy.json.#2697
mvdbeek merged 9 commits intogalaxyproject:devfrom
jmchilton:metadata_fixing

Conversation

@jmchilton
Copy link
Member

@jmchilton jmchilton commented Aug 1, 2016

  • c715e9d fixes external metadata setting for these new primary datasets that I guess broke with tool working directory isolation added in Galaxy 16.04.
  • 6c6574e fixes setting dbkey via galaxy.json which I guess broke years ago.
  • 5437711 Enhances metadata setting allowed for explicit (as opposed to discovered) outputs - now has a test case and allows dbkey and info like option available for discovered datasets.
  • 40ff8b0 Adds a test case demonstrating galaxy.json specification of metadata for discovered datasets.
  • 1932fc1 contains a small improvement to reporting when testing metadata in tool tests.

Update:

I rebased a unit test fix, and pushed out two new commits - one that fixed a very old bug that wouldn't allow tools to 'only' test discovered datasets and one that added a new tool documenting specifying arbitrary metadata in outputs.

The failing framework test seems legitimate but runs fine locally, I wonder if the test framework has a race condition when using postgres.

@nsoranzo
Copy link
Member

nsoranzo commented Aug 2, 2016

Failed framework test seems legit.

…hange.

This has been broken since 16.04 I guess? Maybe retry internally means it hasn't been an issue?
Based on the change - I guess this must have been broken a long time ago - so maybe it isn't used? A subsequent change will add a test though - so hopefully there will be no regressions of this again.
…puts.

I call explicit outputs galaxy.json entries of type="dataset" (as opposed to type="new_primary_dataset" - which I call discovered datasets). Previously galaxy.json could set the name and extension of these datasets. I've added a test case to verify this and a small tweak to the tool test framework to allow easy testing of such metadata setting.

In order to bring explicit output metadata setting closer to parity with discovered dataset metadata setting, I've added the ability to define 'dbkey' and 'info' entries in galaxy.json for these outputs.
Seems like a race condition but I can't determine why there would be one here - this check should help determine if it is a race condition or something else.
Previously some sort of test on the base file the primary datasets were keyed on was required.
Also update the metadata test comparison to support non-textual values (e.g. floating point and integer metadata fields).
@jmchilton
Copy link
Member Author

@nsoranzo Yeah - it was an hda id being conflated with a dataset id - this wasn't a problem in one-off testing but tested with the rest of the tests it is a problem I think - or maybe it was a type problem - either way I fixed both and verified the tool under question works with postgres now. Thanks for the catch.

@jmchilton
Copy link
Member Author

@bgruening and @nsoranzo - thanks for the reviews - either of you willing to merge?

try:
context_value = context[context_key]
setattr(dataset, context_key, context_value)
except Exception:
Copy link
Member

@mvdbeek mvdbeek Aug 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmchilton I know this was pre-existing, but is the expected Exception here only KeyError ?
Maybe sth. like

if context_key in context:
    context_value = context[context_key]
    setattr(dataset, context_key, context_value)

would be better ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an ExpressionContext not a dictionary - I just looked into the code and it looks like it would throw a KeyError and it would respect in. I'l make the change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it - thanks for the suggestion.

@mvdbeek mvdbeek merged commit 5cc3613 into galaxyproject:dev Aug 17, 2016
@mvdbeek
Copy link
Member

mvdbeek commented Aug 17, 2016

Thanks @jmchilton, I'm sure this will come in handy !

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants