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

Promote onerror Tasks to beta #8090

Merged
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
4 changes: 2 additions & 2 deletions docs/additional-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ Features currently in "alpha" are:
| [keep pod on cancel](./taskruns.md#cancelling-a-taskrun) | N/A | [v0.52.0](https://github.com/tektoncd/pipeline/releases/tag/v0.52.0) | `keep-pod-on-cancel` |
| [CEL in WhenExpression](./pipelines.md#use-cel-expression-in-whenexpression) | [TEP-0145](https://github.com/tektoncd/community/blob/main/teps/0145-cel-in-whenexpression.md) | [v0.53.0](https://github.com/tektoncd/pipeline/releases/tag/v0.53.0) | `enable-cel-in-whenexpression` |
| [Param Enum](./taskruns.md#parameter-enums) | [TEP-0144](https://github.com/tektoncd/community/blob/main/teps/0144-param-enum.md) | [v0.54.0](https://github.com/tektoncd/pipeline/releases/tag/v0.54.0) | `enable-param-enum` |
| [Ignore Task Failure](./pipelines.md#using-the-onerror-field) | [TEP-0050](https://github.com/tektoncd/community/blob/main/teps/0050-ignore-task-failures.md) | N/A | |

### Beta Features

Expand All @@ -402,7 +401,8 @@ Features currently in "beta" are:
| [Task-level Resource Requirements](compute-resources.md#task-level-compute-resources-configuration) | [TEP-0104](https://github.com/tektoncd/community/blob/main/teps/0104-tasklevel-resource-requirements.md) | [v0.39.0](https://github.com/tektoncd/pipeline/releases/tag/v0.39.0) | [v0.53.0](https://github.com/tektoncd/pipeline/releases/tag/v0.53.0) | |
| [Reusable Steps via StepActions](./stepactions.md) | [TEP-0142](https://github.com/tektoncd/community/blob/main/teps/0142-enable-step-reusability.md) | [v0.54.0](https://github.com/tektoncd/pipeline/releases/tag/v0.54.0) | `enable-step-actions` |
| [Larger Results via Sidecar Logs](#enabling-larger-results-using-sidecar-logs) | [TEP-0127](https://github.com/tektoncd/community/blob/main/teps/0127-larger-results-via-sidecar-logs.md) | [v0.43.0](https://github.com/tektoncd/pipeline/releases/tag/v0.43.0) | [v0.61.0](https://github.com/tektoncd/pipeline/releases/tag/v0.61.0) | `results-from` |
| [Step and Sidecar Overrides](./taskruns.md#overriding-task-steps-and-sidecars) | [TEP-0094](https://github.com/tektoncd/community/blob/main/teps/0094-specifying-resource-requirements-at-runtime.md) | [v0.34.0](https://github.com/tektoncd/pipeline/releases/tag/v0.34.0) | | [v0.61.0](https://github.com/tektoncd/pipeline/releases/tag/v0.61.0) |
| [Step and Sidecar Overrides](./taskruns.md#overriding-task-steps-and-sidecars) | [TEP-0094](https://github.com/tektoncd/community/blob/main/teps/0094-specifying-resource-requirements-at-runtime.md) | [v0.34.0](https://github.com/tektoncd/pipeline/releases/tag/v0.34.0) | | [v0.61.0](https://github.com/tektoncd/pipeline/releases/tag/v0.61.0) | |
| [Ignore Task Failure](./pipelines.md#using-the-onerror-field) | [TEP-0050](https://github.com/tektoncd/community/blob/main/teps/0050-ignore-task-failures.md) | [v0.55.0](https://github.com/tektoncd/pipeline/releases/tag/v0.55.0) | [v0.62.0](https://github.com/tektoncd/pipeline/releases/tag/v0.62.0) | N/A |

## Enabling larger results using sidecar logs

Expand Down
19 changes: 5 additions & 14 deletions pkg/apis/pipeline/v1/pipeline_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ func TestPipelineTask_OnError(t *testing.T) {
OnError: PipelineTaskContinue,
TaskRef: &TaskRef{Name: "foo"},
},
wc: cfgtesting.EnableAlphaAPIFields,
wc: cfgtesting.EnableBetaAPIFields,
}, {
name: "valid PipelineTask with onError:stopAndFail",
p: PipelineTask{
Name: "foo",
OnError: PipelineTaskStopAndFail,
TaskRef: &TaskRef{Name: "foo"},
},
wc: cfgtesting.EnableAlphaAPIFields,
wc: cfgtesting.EnableBetaAPIFields,
}, {
name: "invalid OnError value",
p: PipelineTask{
Expand All @@ -103,7 +103,7 @@ func TestPipelineTask_OnError(t *testing.T) {
TaskRef: &TaskRef{Name: "foo"},
},
expectedError: apis.ErrInvalidValue("invalid-val", "OnError", "PipelineTask OnError must be either \"continue\" or \"stopAndFail\""),
wc: cfgtesting.EnableAlphaAPIFields,
wc: cfgtesting.EnableBetaAPIFields,
}, {
name: "OnError:stopAndFail and retries coexist - success",
p: PipelineTask{
Expand All @@ -112,7 +112,7 @@ func TestPipelineTask_OnError(t *testing.T) {
Retries: 1,
TaskRef: &TaskRef{Name: "foo"},
},
wc: cfgtesting.EnableAlphaAPIFields,
wc: cfgtesting.EnableBetaAPIFields,
}, {
name: "OnError:continue and retries coexists - failure",
p: PipelineTask{
Expand All @@ -122,15 +122,6 @@ func TestPipelineTask_OnError(t *testing.T) {
TaskRef: &TaskRef{Name: "foo"},
},
expectedError: apis.ErrGeneric("PipelineTask OnError cannot be set to \"continue\" when Retries is greater than 0"),
wc: cfgtesting.EnableAlphaAPIFields,
}, {
name: "setting OnError in beta API version - failure",
p: PipelineTask{
Name: "foo",
OnError: PipelineTaskContinue,
TaskRef: &TaskRef{Name: "foo"},
},
expectedError: apis.ErrGeneric("OnError requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"beta\""),
wc: cfgtesting.EnableBetaAPIFields,
}, {
name: "setting OnError in stable API version - failure",
Expand All @@ -139,7 +130,7 @@ func TestPipelineTask_OnError(t *testing.T) {
OnError: PipelineTaskContinue,
TaskRef: &TaskRef{Name: "foo"},
},
expectedError: apis.ErrGeneric("OnError requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""),
expectedError: apis.ErrGeneric("OnError requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\""),
wc: cfgtesting.EnableStableAPIFields,
}}
for _, tt := range tests {
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1/pipeline_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (pt PipelineTask) Validate(ctx context.Context) (errs *apis.FieldError) {
}

if pt.OnError != "" {
errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "OnError", config.AlphaAPIFields))
errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "OnError", config.BetaAPIFields))
if pt.OnError != PipelineTaskContinue && pt.OnError != PipelineTaskStopAndFail {
errs = errs.Also(apis.ErrInvalidValue(pt.OnError, "OnError", "PipelineTask OnError must be either \"continue\" or \"stopAndFail\""))
}
Expand Down
19 changes: 5 additions & 14 deletions pkg/apis/pipeline/v1beta1/pipeline_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ func TestPipelineTask_OnError(t *testing.T) {
OnError: PipelineTaskContinue,
TaskRef: &TaskRef{Name: "foo"},
},
wc: cfgtesting.EnableAlphaAPIFields,
wc: cfgtesting.EnableBetaAPIFields,
}, {
name: "valid PipelineTask with onError:stopAndFail",
p: PipelineTask{
Name: "foo",
OnError: PipelineTaskStopAndFail,
TaskRef: &TaskRef{Name: "foo"},
},
wc: cfgtesting.EnableAlphaAPIFields,
wc: cfgtesting.EnableBetaAPIFields,
}, {
name: "invalid OnError value",
p: PipelineTask{
Expand All @@ -103,7 +103,7 @@ func TestPipelineTask_OnError(t *testing.T) {
TaskRef: &TaskRef{Name: "foo"},
},
expectedError: apis.ErrInvalidValue("invalid-val", "OnError", "PipelineTask OnError must be either \"continue\" or \"stopAndFail\""),
wc: cfgtesting.EnableAlphaAPIFields,
wc: cfgtesting.EnableBetaAPIFields,
}, {
name: "OnError:stopAndFail and retries coexist - success",
p: PipelineTask{
Expand All @@ -112,7 +112,7 @@ func TestPipelineTask_OnError(t *testing.T) {
Retries: 1,
TaskRef: &TaskRef{Name: "foo"},
},
wc: cfgtesting.EnableAlphaAPIFields,
wc: cfgtesting.EnableBetaAPIFields,
}, {
name: "OnError:continue and retries coexists - failure",
p: PipelineTask{
Expand All @@ -122,15 +122,6 @@ func TestPipelineTask_OnError(t *testing.T) {
TaskRef: &TaskRef{Name: "foo"},
},
expectedError: apis.ErrGeneric("PipelineTask OnError cannot be set to \"continue\" when Retries is greater than 0"),
wc: cfgtesting.EnableAlphaAPIFields,
}, {
name: "setting OnError in beta API version - failure",
p: PipelineTask{
Name: "foo",
OnError: PipelineTaskContinue,
TaskRef: &TaskRef{Name: "foo"},
},
expectedError: apis.ErrGeneric("OnError requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"beta\""),
wc: cfgtesting.EnableBetaAPIFields,
}, {
name: "setting OnError in stable API version - failure",
Expand All @@ -139,7 +130,7 @@ func TestPipelineTask_OnError(t *testing.T) {
OnError: PipelineTaskContinue,
TaskRef: &TaskRef{Name: "foo"},
},
expectedError: apis.ErrGeneric("OnError requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""),
expectedError: apis.ErrGeneric("OnError requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\""),
wc: cfgtesting.EnableStableAPIFields,
}}
for _, tt := range tests {
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1beta1/pipeline_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (pt PipelineTask) Validate(ctx context.Context) (errs *apis.FieldError) {
}

if pt.OnError != "" {
errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "OnError", config.AlphaAPIFields))
errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "OnError", config.BetaAPIFields))
if pt.OnError != PipelineTaskContinue && pt.OnError != PipelineTaskStopAndFail {
errs = errs.Also(apis.ErrInvalidValue(pt.OnError, "OnError", "PipelineTask OnError must be either \"continue\" or \"stopAndFail\""))
}
Expand Down
2 changes: 1 addition & 1 deletion test/ignore_task_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestFailingPipelineTaskOnContinue(t *testing.T) {
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
defer cancel()
c, namespace := setup(ctx, t, requireAnyGate(map[string]string{"enable-api-fields": "alpha"}))
c, namespace := setup(ctx, t, requireAnyGate(map[string]string{"enable-api-fields": "beta"}))
knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf)
defer tearDown(ctx, t, c, namespace)

Expand Down