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

Add components section to improve reusability through referencing within the spec #43

Closed
frankkilcommins opened this issue Apr 14, 2023 · 6 comments · Fixed by #57
Closed
Assignees
Labels
enhancement New feature or request implementor-draft In scope for first version

Comments

@frankkilcommins
Copy link
Collaborator

frankkilcommins commented Apr 14, 2023

It's currently possible to compose a workflows document and reference other workflow documents, but referencing capabilities of steps and/or reusing step inputs across workflows or steps is limited.

The current scope and referencing of inputs and outputs for steps and workflows is described by the following picture:
Workflows-Access-Scope-for-Inputs-and-Outputs

Defining workflow inputs, steps and/or step inputs under a global components section (similar to OpenAPI) could bring better reusability through referencing.

Proposal for Components within the Workflows Specification

Components

Holds a set of reusable objects for different aspects of the Workflows Specification. All objects defined within the components object will have no effect on the workflow unless they are explicitly referenced from properties outside the components object.

Field Name Type Description
inputs Map[string, Schema Object] An object to hold reusable JSON Schema objects to be referenced from workflow inputs. Remark: possibly trimmed down version of OAS Schema Object
steps Map[string, Step Object] An object to hold a reusable Step Objects.
parameters Map[string, Parameter Object] An object to hold reusable Parameter Objects
@frankkilcommins frankkilcommins added the enhancement New feature or request label Apr 14, 2023
shaisachs added a commit to shaisachs/sig-workflows that referenced this issue Apr 26, 2023
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
@shaisachs shaisachs self-assigned this Apr 26, 2023
@frankkilcommins frankkilcommins added the implementor-draft In scope for first version label Apr 26, 2023
@frankkilcommins
Copy link
Collaborator Author

Would recommend to leverage the concept of reference objects

@MikeRalphson
Copy link
Member

possibly trimmed down version of OAS Schema Object

@frankkilcommins what would be the rationale for a cut-down schema object? We have got ourselves into a right state in OAS with subset-superset-sidesets before.

@shaisachs
Copy link
Collaborator

I added reference objects just now. Incorporating them into Steps and Parameters was no problem. However, because the workflowInputs is defined to be a JSON Schema object, it's a little more difficult - we need to embed reference objects inside that JSON Schema. Can we modify workflowInputs to something like an array of JSON Schema or reference object? Something like [JSON Schema | Reference Object].

@MikeRalphson
Copy link
Member

@shaisachs doesnt the schema object allow $refs anyway?

@shaisachs
Copy link
Collaborator

shaisachs commented Apr 28, 2023

I think so... But I guess we need to mention that in the spec and provide some examples.

@frankkilcommins
Copy link
Collaborator Author

possibly trimmed down version of OAS Schema Object

@frankkilcommins what would be the rationale for a cut-down schema object? We have got ourselves into a right state in OAS with subset-superset-sidesets before.

@MikeRalphson my intention was purely in relation to the explanation text. Optimally we'd just support full JSON Schema 2020-12 here.

shaisachs added a commit to shaisachs/sig-workflows that referenced this issue May 18, 2023
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
shaisachs added a commit to shaisachs/sig-workflows that referenced this issue May 19, 2023
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
shaisachs added a commit to shaisachs/sig-workflows that referenced this issue May 20, 2023
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request implementor-draft In scope for first version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants