At the moment, if a playbook has no targets or no steps provided, Run is still called from main.
Since Run returns TargetStatus, missing targets leads to various for loops being skipped, which makes it harder to reason about the return value, and ends up in No queries to run error.
Similarly for steps, which, if missing, []Step is nil, which goes unnoticed till runSteps (after the target client has been created).
Until we get to https://github.com/snowplow/sql-runner/issues/149, we could just fail fast instead, with a more relevant error message.
At the moment, if a playbook has no targets or no steps provided,
Run
is still called frommain
. SinceRun
returnsTargetStatus
, missing targets leads to variousfor
loops being skipped, which makes it harder to reason about the return value, and ends up inNo queries to run
error. Similarly for steps, which, if missing,[]Step
is nil, which goes unnoticed tillrunSteps
(after the target client has been created). Until we get to https://github.com/snowplow/sql-runner/issues/149, we could just fail fast instead, with a more relevant error message.