Skip to content
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

Implement optional and default_value for workflow input parameters. #8807

Closed

Conversation

jmchilton
Copy link
Member

@jmchilton jmchilton commented Oct 15, 2019

#8232 + transforming workflow state for the tool form client.

@jmchilton jmchilton force-pushed the workflow_defaults_tool_form branch 5 times, most recently from 1440f85 to 73599d8 Compare October 17, 2019 17:16
@jmchilton jmchilton changed the title [WIP] Implement optional and default_value for workflow input parameters. Implement optional and default_value for workflow input parameters. Oct 18, 2019
@galaxybot galaxybot added this to the 20.01 milestone Oct 18, 2019
Copy link
Member

@mvdbeek mvdbeek left a comment

Choose a reason for hiding this comment

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

I like this a lot, but we should fix the default values that are selected without user intervention (i.e define a required integer parameter in the workflow editor, it shouldn't default to '0' in the workflow run form imo).

I started working on this in mvdbeek@04c555d but I still need to wrap my head around how we forward invalid parameter selections in the regular tool form and why you can only create a non-optional IntegerToolParameter with a valid value.

If you can drop the debug statements (assuming they are just for debugging) I'm happy to merge and build on this.

lib/galaxy/workflow/modules.py Outdated Show resolved Hide resolved
lib/galaxy/workflow/modules.py Outdated Show resolved Hide resolved
test/api/test_workflows.py Outdated Show resolved Hide resolved
test/api/test_workflows.py Outdated Show resolved Hide resolved
test/api/test_workflows.py Outdated Show resolved Hide resolved
test/api/test_workflows.py Outdated Show resolved Hide resolved
lib/galaxy/workflow/modules.py Outdated Show resolved Hide resolved
@mvdbeek
Copy link
Member

mvdbeek commented Oct 28, 2019

why you can only create a non-optional IntegerToolParameter with a valid value.

I guess that's just what we say in the schema: https://docs.galaxyproject.org/en/latest/dev/schema.html#id24

If false, parameter must have a value. Defaults to "false".

I do feel like that's a weird choice for a mandatory workflow integer parameter though, but maybe I'm wrong.

@jmchilton
Copy link
Member Author

I should have taken a pass at cleaning up the debug (prints, unneeded try/excpt, etc..) - sorry @mvdbeek. I'll rebase with a cleaning up of all of this - I'll eliminate that extra str cast as well and see if that was important.

jmchilton added a commit to jmchilton/galaxy that referenced this pull request Oct 28, 2019
@jmchilton
Copy link
Member Author

I'm well on the record that the tool state interactions are absolutely the most terrifying part of Galaxy in terms of long term technical viability. I'm in no rush to push something through that complicates things and leaves them in a partially implemented state. This can wait for us to implement (or leverage) the concept of "a required value without a default" so we can look at things all together and make judgements.

Frankly - I'm uncomfortable with merging this without implementing optional data inputs at the same time 🤷‍♂.

@mvdbeek
Copy link
Member

mvdbeek commented Oct 28, 2019

This can wait for us to implement (or leverage) the concept of "a required value without a default"

We should line out what that would involve and look like. Would this be another attribute on parameters such as no_default_value="true", or would we just do what we do for optional parameters, but raise an exception when attempting to execute the tool if no value has been chosen (and have the tool form highlight that parameter in some way) ?
What you're worried about is having a tool state (let's say an integer parameter) in the database that doesn't have a value, and it'd be difficult to know if that's legitimately without value ?

@jmchilton
Copy link
Member Author

Would this be another attribute on parameters such as no_default_value="true", or would we just do what we do for optional parameters, but raise an exception when attempting to execute the tool if no value has been chosen (and have the tool form highlight that parameter in some way) ?

I don't know - either seems fine to me. Whatever is cleanest?

What you're worried about is having a tool state (let's say an integer parameter) in the database that doesn't have a value, and it'd be difficult to know if that's legitimately without value ?

I'm just worried about more crazy paths through basic.py frankly. This state thing though seems to be a legitimate concern - especially for executed tools - but hopefully we'd catch this problem before getting that far.

@martenson
Copy link
Member

this is now in conflict, please resolve it

Add abstractions to separate module tool state (for commiunicating with client and tied to tool form rendering) from abstract export state and state in database. The conditionals and such are client details we don't want in the workflow YAML and we don't want in the database.
@jmchilton
Copy link
Member Author

Closing in favor of #8807. Applying the workflow module interface changes to a second application clears up I think what I stumbled into here...

@jmchilton jmchilton closed this Dec 6, 2019
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.

4 participants