Skip to content
Permalink
Browse files
unexpected http response code must fail pipeline
  • Loading branch information
bradrydzewski committed Oct 8, 2020
1 parent 3b4667a commit 179a2f65e8b2161a1ad91eace9bf356d1f51e475
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- panic when registry uri parsing errors
- do not mask single-character secrets
- capture stage duration on failure
- capture dag errors
- capture oom kill and exit code
- cancel step on semaphore deadline exceeded

### Added
- support for running a single pipeline on-demand
@@ -116,6 +116,13 @@ func (e *Execer) Exec(ctx context.Context, spec Spec, state *pipeline.State) err
log.Error(err)
}
result = multierror.Append(result, err)

// if the pipeline is not in a failing state,
// returning an unexpected error must place the
// pipeline in a failing state.
if !state.Failed() {
state.FailAll(err)
}
}

// once pipeline execution completes, notify the state
@@ -258,6 +265,7 @@ func (e *Execer) exec(ctx context.Context, state *pipeline.State, spec Spec, ste
}
err := e.reporter.ReportStep(noContext, state, step.GetName())
if err != nil {
log.Warnln("cannot report step status.")
result = multierror.Append(result, err)
}
// if the exit code is 78 the system will skip all
@@ -280,6 +288,7 @@ func (e *Execer) exec(ctx context.Context, state *pipeline.State, spec Spec, ste
state.Fail(step.GetName(), err)
err = e.reporter.ReportStep(noContext, state, step.GetName())
if err != nil {
log.Warnln("cannot report step failure.")
result = multierror.Append(result, err)
}
return result

0 comments on commit 179a2f6

Please sign in to comment.