Skip to content
This repository has been archived by the owner on Jan 25, 2018. It is now read-only.

Allow for meta and parameter_meta blocks in the workflow section #53

Merged
merged 1 commit into from
Nov 29, 2016

Conversation

geoffjentry
Copy link
Contributor

Closes WDL issue #67. PRs for related repos (WDL, wdltool & cromwell) to follow after this is merged

@@ -286,6 +286,26 @@ object AstTools {

def terminalMap(ast: Ast, source: WdlSource) = (findTerminals(ast) map {(_, source)}).toMap

def wdlSectionToStringMap(ast: Ast, node: String, wdlSyntaxErrorFormatter: WdlSyntaxErrorFormatter): Map[String, String] = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was refactored nearly verbatim from Task

Copy link
Contributor

Choose a reason for hiding this comment

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

Refactored or copy/pasted? Is it DRYable? My bad. I'm a fool.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The whole point of moving it here was to not copy paste

@mcovarr mcovarr self-assigned this Nov 28, 2016
case a if a.isEmpty => Map.empty[String, String]
case a if a.size == 1 =>
// Yes, even 'meta {}' and 'parameter_meta {}' sections have RuntimeAttribute ASTs.
// In hindsight, this was a poor name for the AST.
Copy link
Contributor

Choose a reason for hiding this comment

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

ToL how hard would this be to fix now that we're actually supporting these things?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Touching on our convo this morning, probably not hard but I'd be real leery of hosing things up.

The name definitely is confusing, if it weren't for that comment I'd not have realized I needed this bit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you concerned the existing tests wouldn't notice if you did in fact hose this up?

Copy link
Contributor

Choose a reason for hiding this comment

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

My ToL 2c, this seems possibly worth hosing-up (but then obviously also fixing-up), if possible?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the offender is:

     $kv = :identifier :colon $e -> RuntimeAttribute(key=$0, value=$2)

... which is causing all the key/value pairs to create RuntimeAttribute ASTs. You could rename it something more generic like KeyValuePair, and update all wdl4s builders to search for that instead of RuntimeAttribute. Hopefully...

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, since these are (should) be constants, we could say the meta block is actually a list of identifier -> String?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed earlier in slack with @mcovarr - my concern was that the original author of that comment is someone I would have expected to fix that if it wasn't a big deal. I can see reasons why he wouldn't have that don't fit that model however.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah. My refined ToL preference would actually be, disallow expressions in meta blocks... but (shrug)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe @cjllanwarne is correct. As the underlying AST structure is tangential to this change and because I'd like to get this change in the release (and I don't have faith I'd manage to get both squared away) I filed wdl issue 73.

I can't imagine there's a reason to not change the grammar for that (in fact it would more closely adhere to my reading of the spec) but we shouldn't change functionality like that w/o PO discussion, etc.

@mcovarr
Copy link
Contributor

mcovarr commented Nov 28, 2016

👍

Approved with PullApprove

@mcovarr mcovarr removed their assignment Nov 28, 2016
@Horneth
Copy link
Contributor

Horneth commented Nov 28, 2016

👍 with maybe a small test to make sure that the pairs make it to the meta and parameter_meta attributes in the workflow once the namespace is loaded ?

Approved with PullApprove

@geoffjentry
Copy link
Contributor Author

@Horneth I'll double check but I don't think the one test I modified would pass if that weren't the case

@geoffjentry
Copy link
Contributor Author

@Horneth Double checked - unless I misunderstood you that's explicitly checked by the one key test as that content is coming from the workflow/task objects

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants