-
Notifications
You must be signed in to change notification settings - Fork 14
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 -continueOnError flag #94
Conversation
This makes the playbook to be executed until the end even with a failed step
Confirmed! @andremidea has signed the Individual Contributor License Agreement |
Can we do anything to have this PR merged? :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall except for a couple of nits 👍
0.6.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will take care of that ourselves 👍
@@ -25,7 +25,7 @@ import ( | |||
const ( | |||
CLI_NAME = "sql-runner" | |||
CLI_DESCRIPTION = `Run playbooks of SQL scripts in series and parallel on Redshift and Postgres` | |||
CLI_VERSION = "0.5.2" | |||
CLI_VERSION = "0.6.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -65,6 +66,7 @@ func (o *Options) GetFlagSet() *flag.FlagSet { | |||
fs.Var(&(o.variables), "var", "Variables to be passed to the playbook, in the key=value format") | |||
fs.StringVar(&(o.fromStep), "fromStep", "", "Starts from a given step defined in your playbook") | |||
fs.BoolVar(&(o.dryRun), "dryRun", false, "Runs through a playbook without executing any of the SQL") | |||
fs.BoolVar(&(o.continueOnError), "continueOnError", false, "Continues execution even a step fails, the exit code will still be different than 0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even if a step fails
The use case for this flag is the following:
We have a daily job that loads automatically ~500 tables, everything is generated programmatically (we generate DDL based on the Spark's Dataset Schema) and sometimes one of the loads fails, given that, all subsequent steps are skipped, this is not great for us because we have some next steps that must be run.
So the idea here is to add the possibility of continuing the execution of the subsequent steps but still return an error code at the end (and also tell which queries failed)
ps: I signed the CLA