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

Conditional step execution #3125

Open
3 tasks done
muenchdo opened this issue Dec 12, 2024 · 1 comment
Open
3 tasks done

Conditional step execution #3125

muenchdo opened this issue Dec 12, 2024 · 1 comment

Comments

@muenchdo
Copy link
Contributor

Checklist

  • I've searched the issue queue to verify this is not a duplicate feature request.
  • I've pasted the output of kargo version, if applicable.
  • I've pasted logs, if applicable.

Proposed Feature

Add the possibility to add conditions for promotion step executions, similar to what is available in GitHub Actions. The expressions added with v1.1 would make this very useful.

Motivation

Right now the main use case I have in mind is being able to run something like a "finalizer" to send a Slack notification when the promotion fails, but I feel like this would be useful in more cases.

Suggested Implementation

GitHub Actions seems to be a good inspiration here.

steps:
- uses: foo
  alias: fooStep
  config:
    option1: value1
    option2: value2
- uses: bar
  if: ${{ len(outputs.fooStep.someOutput) > 0 }}
  config:
    option1: value1
    option2: value2

For my finalizer use case, we would need some special expressions such as $always().

Looking at #3124, it seems there are technical limitations that make this difficult, but I do think this (especially the finalizer use case) is less of an edge case than loops.

@krancour
Copy link
Member

You're on the same page as me. I think if is fairly easy to do. As for "always," I think we could potentially add something like a "failure policy" that can be configured to allow a process (or designated steps of a process) to continue after a failure. This bit is harder and would require some design work. If we split "always" into a separate issue, "if" on its own can probably get done faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants