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

Issue 206: Conditional execution in saga #222

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

krasimirr
Copy link
Contributor

@krasimirr krasimirr commented Jan 15, 2024

Description

Currently, there are cases when tasks/workflows need to be executed only if a condition is matched based on a saga state value. This feature implements that requirement.

Checklist

  • Lint and unit tests pass locally with my changes
  • I have added relevant error handling and logging messages to help troubleshooting
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have updated CHANGELOG.md with a short summary of the changes introduced
  • I have tested against live environment, if applicable
  • I have added relevant usage information (As-built)
  • Any structure and/or content vRA-NG improvements are synchronized with vra-ng and ts-vra-ng archetypes
  • Every new or updated Installer property is documented in docs/archive/doc/markdown/use-bundle-installer.md
  • Dependencies in pom.xml are up-to-date
  • My changes have been rebased and squashed to the minimal number of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixed #XXX - or Closed #XXX - prefix to auto-close the issue

Testing

YAML:
Screenshot 2024-01-18 at 18 32 06

Workflow:
Screenshot 2024-01-18 at 18 37 38

Action:
Screenshot 2024-01-18 at 18 22 22

Release Notes

This feature enables the conditional execution of tasks/workflows based on a conditional variable (saga state value).

tasks:
  TestOne:
    execute: testSagaTask
    if: conditionalVariable # Newly introduced variable
  TestTwo:
    workflow: workflowId
    if: conditionalVariable # Newly introduced variable

Related issues and PRs

@krasimirr krasimirr requested a review from a team as a code owner January 15, 2024 16:15
@vmwclabot
Copy link
Member

@krasimirr, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

1 similar comment
@vmwclabot
Copy link
Member

@krasimirr, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot
Copy link
Member

@krasimirr, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

1 similar comment
@vmwclabot
Copy link
Member

@krasimirr, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Signed-off-by: Krasimir Rusev <rkrasimir@vmware.com>
@krasimirr krasimirr force-pushed the feature/206_conditional_execution_saga branch from 4ea5fac to 6e7a955 Compare January 15, 2024 16:42
Signed-off-by: Krasimir Rusev <rkrasimir@vmware.com>
Copy link
Collaborator

@Michaelpalacce Michaelpalacce left a comment

Choose a reason for hiding this comment

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

Nice job :) a few comments only

.github/workflows/super-linter.yml Show resolved Hide resolved
conditionalVar:
type: boolean

tasks:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be good to add test for workflows as well, ideally separately, so we can figure out where the error is if it happens faster

Signed-off-by: Krasimir Rusev <rkrasimir@vmware.com>
Copy link
Collaborator

@Michaelpalacce Michaelpalacce left a comment

Choose a reason for hiding this comment

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

Lgtm

@krasimirr krasimirr merged commit 63d70b6 into main Jan 22, 2024
12 checks passed
@krasimirr krasimirr deleted the feature/206_conditional_execution_saga branch January 22, 2024 08:44
@krasimirr krasimirr restored the feature/206_conditional_execution_saga branch January 22, 2024 08:46
@krasimirr krasimirr deleted the feature/206_conditional_execution_saga branch January 22, 2024 08:52
@krasimirr krasimirr linked an issue Jan 26, 2024 that may be closed by this pull request
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.

Conditional Execution in Saga
3 participants