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

Use permanent errors in the pipelinerun reconciler #2798

Merged
merged 1 commit into from
Jun 25, 2020

Conversation

afrittoli
Copy link
Member

Changes

Instead of returning nil on error during reconcile, if the error
is transient return it, so that the key is requeue. If the error
is permanent return a permanent error, so that the key is not
requeued.

Partially addresses #2474

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

/kind cleanup
/cc @bobcatfish @vdemeester @mattmoor

@tekton-robot tekton-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 10, 2020
@tekton-robot
Copy link
Collaborator

This PR cannot be merged: expecting exactly one kind/ label

Available kind/ labels are:

kind/bug: Categorizes issue or PR as related to a bug.
kind/flake: Categorizes issue or PR as related to a flakey test
kind/cleanup: Categorizes issue or PR as related to cleaning up code, process, or technical debt.
kind/design: Categorizes issue or PR as related to design.
kind/documentation: Categorizes issue or PR as related to documentation.
kind/feature: Categorizes issue or PR as related to a new feature.
kind/misc: Categorizes issue or PR as a miscellaneuous one.

@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/reconciler/pipelinerun/pipelinerun.go 81.7% 82.4% 0.7

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/cc @mattmoor

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 10, 2020
Comment on lines 218 to 220
if controller.IsPermanentError(reconcileErr) {
return controller.NewPermanentError(merr)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems funny, does it do anything? 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We collect various errors into a multierror. But if the reconcile error was a permanent one, I want the final error returned to be permanent too, so that the key is not re-queued

@afrittoli afrittoli force-pushed the isssues/2474-pe-pipelinerun branch from 82d0b05 to bad6378 Compare June 10, 2020 16:57
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 10, 2020
@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/reconciler/pipelinerun/pipelinerun.go 82.1% 82.7% 0.7

@afrittoli afrittoli added this to the Pipelines v0.14 milestone Jun 10, 2020
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2020
@afrittoli afrittoli force-pushed the isssues/2474-pe-pipelinerun branch from bad6378 to ae00370 Compare June 11, 2020 14:33
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2020
@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/reconciler/pipelinerun/pipelinerun.go 82.0% 82.6% 0.7

@afrittoli afrittoli force-pushed the isssues/2474-pe-pipelinerun branch from ae00370 to 190ad5f Compare June 23, 2020 11:02
@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/reconciler/pipelinerun/pipelinerun.go 84.2% 84.6% 0.4

@afrittoli afrittoli force-pushed the isssues/2474-pe-pipelinerun branch from 190ad5f to 2d8ed37 Compare June 23, 2020 11:36
@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/reconciler/pipelinerun/pipelinerun.go 84.2% 84.6% 0.4

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/retest

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 23, 2020
@afrittoli
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

1 similar comment
@afrittoli
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@bobcatfish
Copy link
Collaborator

All my feedback is suuuuper minor and I don't think it should block anything.

This is great!!

(side note: the flakiness level of the integration tests is really starting to worry me, im starting to be concerned there might be an actual problem since this is happening so much across so many different tests - ill add something to the productivity working group agenda)

/lgtm
/approve
/meow

@tekton-robot
Copy link
Collaborator

@bobcatfish: cat image

In response to this:

All my feedback is suuuuper minor and I don't think it should block anything.

This is great!!

(side note: the flakiness level of the integration tests is really starting to worry me, im starting to be concerned there might be an actual problem since this is happening so much across so many different tests - ill add something to the productivity working group agenda)

/lgtm
/approve
/meow

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.

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bobcatfish

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2020
Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

somehow i failed to submit my comments, here goes

pkg/reconciler/pipelinerun/pipelinerun_test.go Outdated Show resolved Hide resolved
pkg/reconciler/pipelinerun/pipelinerun.go Show resolved Hide resolved
t.Fatalf("Expected an error to be returned by Reconcile, got nil instead")
}
if controller.IsPermanentError(reconcileError) != tc.permanentError {
t.Fatalf("Expected the error to be permanent: %v but got permanent: %v", tc.permanentError, controller.IsPermanentError(reconcileError))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nittiest nit, since reconcileError == nil fatals, feels like this might be a bit less code:

			if reconcileError := c.Reconciler.Reconcile(context.Background(), getRunName(tc.pipelineRun)); reconcileError != nil {
			    if controller.IsPermanentError(reconcileError) != tc.permanentError {
		    	        	t.Fatalf("Expected the error to be permanent: %v but got perman...")
                              }    
			else {
				t.Fatalf("Expected an error to be returned by Reconcile, got nil instead")
			}

maybe that's less clear tho

im definitely over polishing here!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought in a test it would be more readable the way I wrote it :)

@afrittoli afrittoli force-pushed the isssues/2474-pe-pipelinerun branch from 2d8ed37 to 043bea9 Compare June 24, 2020 14:36
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2020
@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/reconciler/pipelinerun/pipelinerun.go 84.7% 85.1% 0.4

@afrittoli
Copy link
Member Author

/test pull-tekton-pipeline-build-tests

Instead of returning nil on error during reconcile, if the error
is transient return it, so that the key is requeue. If the error
is permanent return a permanent error, so that the key is not
requeued.

Partially addresses tektoncd#2474
@afrittoli afrittoli force-pushed the isssues/2474-pe-pipelinerun branch from 043bea9 to 6760e96 Compare June 24, 2020 20:39
@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/reconciler/pipelinerun/pipelinerun.go 84.7% 85.1% 0.4

@bobcatfish
Copy link
Collaborator

i think something might be really wrong with the integration tests

/test pull-tekton-pipeline-integration-tests

@bobcatfish
Copy link
Collaborator

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2020
@afrittoli
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

1 similar comment
@vdemeester
Copy link
Member

/test pull-tekton-pipeline-integration-tests

@tekton-robot tekton-robot merged commit 44f22a0 into tektoncd:master Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. 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.

5 participants