feat: Support Schema type in the Launch form #110
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TL;DR
Adds Launch form support for the Schema input type. The Schema structure will be pulled from the Task or Workflow closure. The user only needs to provide a
uri
indicating the location of the schema to load.Type
Are all requirements met?
Complete description
Adding an input was fairly straightforward. Since the only input we need is a string value, I reused all of the Simple input code paths to render a single text field. Parsing a Literal to an input value just requires reading the
uri
field off of the incoming Literal value.The complication is in converting the input string to the final Literal value. The
type
value of the resultingLiteral
needs to be theschema
value from the type definition in the source Task/Workflow closure. But the code for doing the parsing only had access to our mappedInputType
enum and the input's value. To address this, I extended theInputTypeDefinition
interface to also include the sourceliteralType
taken from theVariable
we read out of the closure. This allows the conversion code to copy over the necessary information. This also has the advantage of allowing nested types such as collections to just work, since they will also pass down the nested variable types.The majority of the changes ended up being all of the unit test cases, which previously only passed an
InputType
and now must pass a fullInputTypeDefinition
Tracking Issue
flyteorg/flyte#405
Follow-up issue
NA