dagucloud / dagucloud/dagu

Intentionally Fail a DAG

Open
#455 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
4k
Forks
332
Avg merge
19h 9m
Merged PRs (30d)
137

Description

Maybe I'm just missing something in the documentation, but my use case is that I want there to be a check in my DAG for a specific condition and if that condition fails, for the whole DAG to be marked as a failure. The `preconditions` attribute on the steps helps with the first part of only executing when a condition is satisfied, but I'm having trouble figuring out how to then mark the DAG as a failure. If I simply check for the positive condition and it comes back as negative, the rest of the steps don't execute, but the DAG is marked as finished successfully. I tried adding a branch for the negative condition, but I can't figure out how to make the DAG show as failed. I thought setting the `signalOnStop` for the negative condition step to something like "SIGQUIT" would do it, but it still comes through as "finished".
A simple DAG to reproduce looks like this.
```yaml
params: foo
steps:
- name: step1
command: "echo $1"
- name: positive case
depends:
- step1
preconditions:
- condition: "$1"
expected: "foo"
command: "echo 'Success'"
- name: negative case
depends:
- step1
preconditions:
- condition: "$1"
expected: "bar"
command: "echo 'Failure'"
signalOnStop: "SIGQUIT"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.