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

Add option continueAndFail on step.onError #8638

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FaniD
Copy link

@FaniD FaniD commented Mar 11, 2025

Feature request

Currently onError for steps can be set to continue or stopAndFail. In some cases, it could be beneficial to allow the taskRun to continue with the rest of the steps, but eventually fail with the exitCode of a specific step. Therefore, I'm introducing the value continueAndFail.

This is already discussed in the comments of issue #4485

Use case

I have a task that runs a test (step 1) and publishes a test report (step 2). I want to publish a test report even if step 1 fails and let the taskRun fail accordingly (step 1 exitCode).
In that case, none of the current values of onError are enough, as continue would make the taskRun succeed and stopAndFail would prevent step 2 from running.

Release Notes

A new value has been added for step.onError:
- `continueAndFail`: declares a failure with a step error after having executed all following steps

@tekton-robot tekton-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Mar 11, 2025
Copy link

linux-foundation-easycla bot commented Mar 11, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: FaniD / name: Fani Dimou (6de8538)

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign jeromeju after the PR has been reviewed.
You can assign the PR to them by writing /assign @jeromeju in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 11, 2025
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/entrypoint/entrypointer.go 88.0% 88.2% 0.1

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 11, 2025
@FaniD
Copy link
Author

FaniD commented Mar 11, 2025

/test check-pr-has-kind-label

@tekton-robot
Copy link
Collaborator

@FaniD: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test check-pr-has-kind-label

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@FaniD FaniD force-pushed the onError_continueAndFail branch 2 times, most recently from cfccfb3 to 9bd73ea Compare March 11, 2025 18:36
@FaniD FaniD force-pushed the onError_continueAndFail branch from 371fd3e to 6de8538 Compare March 11, 2025 18:39
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/entrypoint/entrypointer.go 88.0% 88.2% 0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/entrypoint/entrypointer.go 88.0% 88.2% 0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/entrypoint/entrypointer.go 88.0% 88.2% 0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/entrypoint/entrypointer.go 88.0% 88.2% 0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/entrypoint/entrypointer.go 88.0% 88.2% 0.1

@FaniD
Copy link
Author

FaniD commented Mar 13, 2025

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 13, 2025
@vdemeester
Copy link
Member

SGTM, @FaniD can we also have an e2e tests validating that the Task is indeed failed.

@FaniD
Copy link
Author

FaniD commented Mar 13, 2025

SGTM, @FaniD can we also have an e2e tests validating that the Task is indeed failed.

sure thing. I will work on this soonish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants