Skip to content
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

Promoting onError to beta 🎓 #4251

Merged
merged 1 commit into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ Features currently in "alpha" are:
| [Hermetic Execution Mode](./hermetic.md) | [TEP-0025](https://github.com/tektoncd/community/blob/main/teps/0025-hermekton.md) | [v0.25.0](https://github.com/tektoncd/pipeline/releases/tag/v0.25.0) | |
| [Graceful Termination](./pipelineruns.md#gracefully-cancelling-a-pipelinerun) | [TEP-0058](https://github.com/tektoncd/community/blob/main/teps/0058-graceful-pipeline-run-termination.md) | [v0.25.0](https://github.com/tektoncd/pipeline/releases/tag/v0.25.0) | |
| [`PipelineRun` Timeouts](./pipelineruns.md#configuring-a-failure-timeout) | [TEP-0046](https://github.com/tektoncd/community/blob/main/teps/0046-finallytask-execution-post-timeout.md) | [v0.25.0](https://github.com/tektoncd/pipeline/releases/tag/v0.25.0) | |
| [Specifying `onError` for a `Step`](./tasks.md#specifying-onerror-for-a-step) | [TEP-0040](https://github.com/tektoncd/community/blob/main/teps/0040-ignore-step-errors.md) | [v0.27.0](https://github.com/tektoncd/pipeline/releases/tag/v0.27.0) | |
| [Implicit `Parameters`](./taskruns.md#implicit-parameters) | [TEP-0023](https://github.com/tektoncd/community/blob/main/teps/0023-implicit-mapping.md) | [v0.28.0](https://github.com/tektoncd/pipeline/releases/tag/v0.28.0) | |
| [Windows Scrips](./tasks.md#windows-scripts) | [TEP-0057](https://github.com/tektoncd/community/blob/main/teps/0057-windows-support.md) | [v0.28.0](https://github.com/tektoncd/pipeline/releases/tag/v0.28.0) | |

Expand Down
7 changes: 2 additions & 5 deletions docs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,6 @@ steps:

#### Specifying `onError` for a `step`

This is an alpha feature. The `enable-api-fields` feature flag [must be set to `"alpha"`](./install.md)
to specify `onError` for a `step`.

When a `step` in a `task` results in a failure, the rest of the steps in the `task` are skipped and the `taskRun` is
declared a failure. If you would like to ignore such step errors and continue executing the rest of the steps in
the task, you can specify `onError` for such a `step`.
Expand Down Expand Up @@ -386,8 +383,8 @@ kubectl get tr taskrun-unit-test-t6qcl -o json | jq .status
],
```
For an end-to-end example, see [the taskRun ignoring a step error](../examples/v1beta1/taskruns/alpha/ignore-step-error.yaml)
and [the pipelineRun ignoring a step error](../examples/v1beta1/pipelineruns/alpha/ignore-step-error.yaml).
For an end-to-end example, see [the taskRun ignoring a step error](../examples/v1beta1/taskruns/ignore-step-error.yaml)
and [the pipelineRun ignoring a step error](../examples/v1beta1/pipelineruns/ignore-step-error.yaml).
#### Accessing Step's `exitCode` in subsequent `Steps`
Expand Down
1 change: 0 additions & 1 deletion pkg/apis/pipeline/v1beta1/task_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ func validateStep(ctx context.Context, s Step, names sets.String) (errs *apis.Fi
}

if s.OnError != "" {
errs = errs.Also(ValidateEnabledAPIFields(ctx, "step onError", config.AlphaAPIFields).ViaField("steps"))
if s.OnError != "continue" && s.OnError != "stopAndFail" {
errs = errs.Also(&apis.FieldError{
Message: fmt.Sprintf("invalid value: %v", s.OnError),
Expand Down
20 changes: 1 addition & 19 deletions pkg/apis/pipeline/v1beta1/task_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1178,13 +1178,7 @@ func TestStepOnError(t *testing.T) {
ts := &v1beta1.TaskSpec{
Steps: tt.steps,
}
featureFlags, _ := config.NewFeatureFlagsFromMap(map[string]string{
"enable-api-fields": "alpha",
})
cfg := &config.Config{
FeatureFlags: featureFlags,
}
ctx := config.ToContext(context.Background(), cfg)
ctx := context.Background()
ts.SetDefaults(ctx)
err := ts.Validate(ctx)
if tt.expectedError == nil && err != nil {
Expand Down Expand Up @@ -1241,18 +1235,6 @@ func TestIncompatibleAPIVersions(t *testing.T) {
}},
}},
},
}, {
name: "step onError requires alpha",
requiredVersion: "alpha",
spec: v1beta1.TaskSpec{
Steps: []v1beta1.Step{{
OnError: "continue",
Container: corev1.Container{
Image: "image",
Args: []string{"arg"},
},
}},
},
}, {
name: "windows script support requires alpha",
requiredVersion: "alpha",
Expand Down
2 changes: 1 addition & 1 deletion test/ignore_step_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestMissingResultWhenStepErrorIsIgnored(t *testing.T) {
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
defer cancel()
c, namespace := setup(ctx, t, requireAlphaFeatureFlags)
c, namespace := setup(ctx, t)
knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf)
defer tearDown(ctx, t, c, namespace)

Expand Down