-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[RFC] Label user errors for failed PipelineRun status in user-facing messages #7351
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
This commit labels the user errors for failed PipelineRun status. This aims to communicate explicitly with users of whether the run failed due to a user error or not. This is a step 1 for tektoncd#6859 part of tektoncd#7276
7ec93de
to
f58c9b4
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
@@ -369,11 +375,11 @@ func (c *Reconciler) resolvePipelineState( | |||
} | |||
var nfErr *resources.TaskNotFoundError | |||
if errors.As(err, &nfErr) { | |||
pr.Status.MarkFailed(v1.PipelineRunReasonCouldntGetTask.String(), | |||
pr.Status.MarkFailed(!isUserError, v1.PipelineRunReasonCouldntGetTask.String(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of passing in a boolean at the call site, could we wrap the errs or the reasons into an user error type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Dibyo! There seems to be two questions that needs to be filled in:
- Shall we use bool or wrapping with a new error?
- Set isUserError as a bool flag, and add it to the pipelineRun.MarkFailed() as a parameter. This will force our contributors to explicitly call out whether this is a user error or not when adding to the reconciler logics.
- Introduce a new error "userError". Wrap the error message with it and at pipelineRun.MarkFailed(), label user using regex to check the error message. However, it is hard to tell if the error introduced is used or not.
- Do we want to label on TaskRun/PipelineRun reason or message?
After examining the error messages, we have use cases where a TaskRun/PipelineRun reason has many different error messages i.e. PipelineRunReasonFailedValidation. It might be more precise to label error messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the discussion offline.
I think the way forward should be doing both adding a bool flag so that we can leverage judgement from the author and creating a new error type UserError.
@JeromeJu: PR needs rebase. 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. |
closed in light of #7475 |
Changes
This commit labels the user errors for failed PipelineRun status. This aims to communicate explicitly with users of whether the run failed due to a user error or not.
This is a step 1 for #6859
part of #7276
/kind misc
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes