integreat-io / integreat

Node.js integration layer
Other
14 stars 3 forks source link

Support `postconditions` on job step #323

Closed kjellmorten closed 10 months ago

kjellmorten commented 10 months ago

We may have preconditions on a job step, which defines what is required to run that step. For now, at least, it will just skip the step and continue to the next step when the conditions are not met, unless the conditions are marked with break: true, in which case the job is stopped right there.

The postconditions will behave similarly, except after the step has been run. When a step is done, we'll check the postconditions, and if they pass we'll continue. If they don't pass, we'll return an error, and we should probably break by default.

Since a flow will break if a step returns an error, we may see this as a default post-condition. However, we need to decide whether specifying one or more post-conditions will override the default condition or supplement it.

Another related issue, is that this behaviour, with breaking on an error, is now implemented in the next step, and will be overridden when a pre-condition is defined. Should we change that, and if so, will it be a breaking change or do we need a feature flag?

kjellmorten commented 10 months ago

The questions on how to deal with default conditions will be handled in #330.