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

Added optional expression tags #212

Merged
merged 4 commits into from
Sep 20, 2024
Merged

Added optional expression tags #212

merged 4 commits into from
Sep 20, 2024

Conversation

jaredoconnell
Copy link
Contributor

Changes introduced with this PR

This PR adds two more ways of specifying inferred inputs/outputs:

  • !wait-optional - Creates a completion dependency that still resolves if the referenced expression fails, but it will wait until either it resolves or it is marked unresolvable. This is the one intended for most use cases. For example, if you don't care if a step succeeds or crashes, !wait-optional is the best one for that use case. But if you want the output to only resolve when the step is disabled or succeeds, but not if it crashes, you must use !ordisabled.
  • !soft-optional - Creates an optional dependency that does not effect resolution of the object. There are no order guarantees, so this field is only intended for things that really do not matter strongly for the output.

These expressions may only be used as fields properties within an object. The fields will be marked as optional.


By contributing to this repository, I agree to the contribution guidelines.

workflow/workflow_test.go Show resolved Hide resolved
@mfleader
Copy link
Member

Are there any edge cases that you know of that are intentionally left uncovered by these tests?

@jaredoconnell
Copy link
Contributor Author

Are there any edge cases that you know of that are intentionally left uncovered by these tests?

Theoretically a soft-optional dependency could be included in more test cases, including alongside ORs, but that feature is, by design, not as reliable, and I didn't want to make the tests too fragile.

Copy link

@dbutenhof dbutenhof left a comment

Choose a reason for hiding this comment

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

Some comments, mostly comment meta-comments.

workflow/executor.go Outdated Show resolved Hide resolved
workflow/executor.go Outdated Show resolved Hide resolved
workflow/workflow.go Show resolved Hide resolved
workflow/yaml_test.go Outdated Show resolved Hide resolved
@jaredoconnell jaredoconnell merged commit 62797d2 into main Sep 20, 2024
5 checks passed
@jaredoconnell jaredoconnell deleted the optional-expr-tag branch September 20, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants