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

CompletionTime is not set if Succeeded is already True #2741

Closed
mattmoor opened this issue Jun 3, 2020 · 4 comments · Fixed by #2749
Closed

CompletionTime is not set if Succeeded is already True #2741

mattmoor opened this issue Jun 3, 2020 · 4 comments · Fixed by #2749
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.

Comments

@mattmoor
Copy link
Member

mattmoor commented Jun 3, 2020

Expected Behavior

CompletionTime is always updated to reflect the time the task/pipeline was observed to succeed.

Actual Behavior

CompletionTime is only updated when something else in Status is being touched. This is because updateStatus is guarded by an equivalence check, so if nothing else changes, then this doesn't get set.

Steps to Reproduce the Problem

I saw this in a unit test where I set the condition but not CompletionTime, and was surprised it wasn't set.

Additional Info

This is going to be blocking for a transition away from hand-rolled updateStatus to // +genreconciler.

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 3, 2020
@afrittoli
Copy link
Member

Interesting.
I suppose we never want to have the case where we set the status "True" is set on the "Succeeded" Condition, and the CompletionTime is not set.
Would the +genreconciler require that separation?

@mattmoor
Copy link
Member Author

mattmoor commented Jun 3, 2020

Well updateStatus is now generated, and doesn't do this 😅

The way we manage this in Knative is to have higher-level functions for manipulating status conditions. The equivalent here would be to have the function(s) that put Succeeded into a terminal state also update CompletionTime.

I haven't poked around to see how this is set throughout the reconcilers today, but would be happy to advice if someone wants to look 😇

/good-first-issue

@tekton-robot
Copy link
Collaborator

@mattmoor:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

Well updateStatus is now generated, and doesn't do this 😅

The way we manage this in Knative is to have higher-level functions for manipulating status conditions. The equivalent here would be to have the function(s) that put Succeeded into a terminal state also update CompletionTime.

I haven't poked around to see how this is set throughout the reconcilers today, but would be happy to advice if someone wants to look 😇

/good-first-issue

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 tekton-robot added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jun 3, 2020
@mattmoor
Copy link
Member Author

mattmoor commented Jun 3, 2020

I may take a look at this next. It's all over and I think it'll clean things up a bit.

mattmoor added a commit to mattmoor/pipeline that referenced this issue Jun 4, 2020
These helpers reduce a lot of the boilerplate and give us hooks
where we can eagerly set the CompletionTime field rather than waiting
for `updateStatus`.

Fixes: tektoncd#2741
tekton-robot pushed a commit that referenced this issue Jun 4, 2020
These helpers reduce a lot of the boilerplate and give us hooks
where we can eagerly set the CompletionTime field rather than waiting
for `updateStatus`.

Fixes: #2741
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants