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

[RFC] Label user errors for failed PipelineRun status in user-facing messages #7351

Closed
wants to merge 1 commit into from

Conversation

JeromeJu
Copy link
Member

@JeromeJu JeromeJu commented Nov 13, 2023

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:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/misc Categorizes issue or PR as a miscellaneuous one. labels Nov 13, 2023
@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 pritidesai after the PR has been reviewed.
You can assign the PR to them by writing /assign @pritidesai 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 Nov 13, 2023
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipelinerun_types.go 89.5% 87.9% -1.7

@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/apis/pipeline/v1/pipelinerun_types.go 89.5% 87.9% -1.7

@JeromeJu JeromeJu marked this pull request as draft November 13, 2023 21:33
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 13, 2023
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
@JeromeJu JeromeJu force-pushed the 7276-error-wrapping branch from 7ec93de to f58c9b4 Compare November 13, 2023 22:29
@JeromeJu JeromeJu marked this pull request as ready for review November 13, 2023 22:29
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 13, 2023
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipelinerun_types.go 89.5% 92.5% 3.0

@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/apis/pipeline/v1/pipelinerun_types.go 89.5% 92.5% 3.0

@JeromeJu JeromeJu changed the title [RFC] Label user errors for failed PipelineRun status [RFC] Label user errors for failed PipelineRun status in user-facing messages Nov 15, 2023
@@ -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(),
Copy link
Member

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?

Copy link
Member Author

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:

  1. 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.
  1. 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.

Copy link
Member Author

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 JeromeJu marked this pull request as draft November 20, 2023 13:23
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 20, 2023
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 6, 2023
@tekton-robot
Copy link
Collaborator

@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.

@JeromeJu
Copy link
Member Author

closed in light of #7475

@JeromeJu JeromeJu closed this Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/misc Categorizes issue or PR as a miscellaneuous one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants