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

Refining status when Condition failed #1696

Merged
merged 1 commit into from
Feb 19, 2020

Conversation

vincent-pli
Copy link
Member

@vincent-pli vincent-pli commented Dec 6, 2019

Introduce new state: SucceededWithConditionCheckFailed, indicates the scenario pipeline succeeded but with Condition checking failed.
fix issue: #1692

Changes

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.

Release Notes

Status messages for completed and running PipelineRuns have been updated to include the count of succeeded, skipped, and incomplete Tasks. Additionally a new status Reason, "Completed", has been introduced for finished PipelineRuns that have skipped Tasks due to Condition check failures.

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Dec 6, 2019
@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 6, 2019
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 94.7% 94.9% 0.2

@vincent-pli
Copy link
Member Author

/retest

@afrittoli
Copy link
Member

Thank you for this patch, and sorry I'm a bit late in the discussion.
While it could be interesting to signal that a pipeline did not execute any task, I think SucceededWithConditionCheckFailed does not express this information. I could have a pipeline with several conditions, some passed, some failed, which could be successful or failed. Perhaps SucceededWithNoTaskRuns would represent better the situation?
Note that it is already possible to know that no TaskRun was executed, so this would only make it slightly easier to discover. I'm not entirely convinced it is needed though. Do you have specific use cases in mind to explain why this is required?

@vincent-pli
Copy link
Member Author

@afrittoli thanks for comments :)
The SucceededWithConditionCheckFailed indicate that there is at least one condition checking failed in the whole pipelinerun. Just a reminder for user to hint there is something abnormal occurred to avoid misleading.

SucceededWithNoTaskRuns express there is no task really executed since condition checking failed.
I think just a reminder is enough for end user.

@dibyom
Copy link
Member

dibyom commented Dec 6, 2019

So, we have a Reason and a Message field. I think what could be confusing for the user is the Message saying All Tasks have completed executing when no tasks have been executed. So, my two cents would be to use a different message like No Tasks left to execute or something and keep the Reason the same as before.

@imjasonh
Copy link
Member

imjasonh commented Dec 6, 2019

I think @dibyom is right that we can/should use the Message field better, whether or not these different states end up having different Reasons.

I like the Reason being no more tasks to run because that's both true, and meaningfully vague. 😄

The Message then could be completed 10 tasks, 3 were not executed due to conditions (or something along those lines). This could even be useful when the PipelineRun is ongoing (completed 6 tasks, running 2 tasks, 1 skipped due to conditions). This of course is something a user should also be able to determine from taskrun statuses, but it's nice to have a human-readable summary, and it should be fairly straightforward to generate it.

@vincent-pli
Copy link
Member Author

Could we just use Completed for reason rather than Succeeded
then we have message for both Complete and Running:
Completed 6 tasks, not start/running 2 tasks, skipped 1 tasks
@afrittoli @dibyom @imjasonh

@dibyom
Copy link
Member

dibyom commented Dec 11, 2019

Could we just use Completed for reason rather than Succeeded

SGTM especially since condition.type: Succeeded already. What do others think -- @imjasonh @vdemeester @bobcatfish ?

@ghost
Copy link

ghost commented Feb 7, 2020

Hey @vincent-pli do you intend to continue working on this or should we close for now? For what it's worth it sounds like we have consensus on the desired implementation:

Could we just use Completed for reason rather than Succeeded
then we have message for both Complete and Running:
Completed 6 tasks, not start/running 2 tasks, skipped 1 tasks

SGTM2

@vincent-pli
Copy link
Member Author

@sbwsg
Sure, I will work on it soon.

@vincent-pli
Copy link
Member Author

/assign @sbwsg

@tekton-robot tekton-robot assigned ghost Feb 14, 2020
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

This looks good to me. I've made a suggestion to make the format strings more uniform. Let me know what you think. But otherwise I think this is ready.

Is this a backwards compatibility change? Do we need to give it extra highlight in release notes?

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 14, 2020
Introduce new state: `ReasonSucceededWithConditionCheckFailed`, indicates the scenario `pipeline` succeeded but with `Condition` checking failed.
@vincent-pli
Copy link
Member Author

@sbwsg For the release, I think I agree with you.

@ghost
Copy link

ghost commented Feb 18, 2020

For the release, I think I agree with you.

OK cool, I suggest updating the Release Notes on this PR's description to be something like:

Status messages for completed and running PipelineRuns have been updated to include the count of succeeded, skipped, and incomplete Tasks. Additionally a new status Reason, "Completed", has been introduced for finished PipelineRuns that have skipped Tasks due to Condition check failures.

Then I think this is ready to merge!

@vincent-pli
Copy link
Member Author

@sbwsg
Done, thanks

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 Feb 19, 2020
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbwsg, vdemeester

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 merged commit 837fe54 into tektoncd:master Feb 19, 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. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants