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

access taskRun reason in addition to status in finally task #8127

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

pritidesai
Copy link
Member

@pritidesai pritidesai commented Jul 16, 2024

Changes

A finally task can access both the reason and status of a pipelineTask from the tasks section.

When onError is set to either continue or stopAndFail and the task fails, the status is set to the same value Failed, making it indistinguishable whether the failure was allowed or not. However, when onError is set to continue, the reason is assigned FailureIgnored. This additional information can be used to identify that the checks failed, but the failure can be ignored.

The syntax is $(tasks.<pipelineTask>.reason)

/kind feature

Fixes # #8110

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
  • pre-commit Passed
  • 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

Access reason in addition to the status using $(tasks.<taskName>.reason)

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 16, 2024
@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/pipeline_validation.go 99.3% 99.3% 0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.0% 99.0% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.5% 94.6% -1.9
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.6% 99.6% 0.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/pipeline_validation.go 99.3% 99.3% 0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.0% 99.0% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.5% 94.6% -1.9
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.6% 99.6% 0.0

@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/pipeline_validation.go 99.3% 99.3% 0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.0% 99.0% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.5% 96.4% -0.1
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.6% 99.6% 0.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/pipeline_validation.go 99.3% 99.3% 0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.0% 99.0% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.5% 96.4% -0.1
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.6% 99.6% 0.0

@pritidesai
Copy link
Member Author

/retest

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 16, 2024
@chitrangpatel
Copy link
Contributor

chitrangpatel commented Jul 16, 2024

Does it need to be documented that users can use Reason field?
nvm. I do see it in docs/variables.md 😛

@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/pipeline_validation.go 99.3% 99.3% 0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.0% 99.0% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.5% 96.4% -0.1
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.6% 99.6% 0.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/pipeline_validation.go 99.3% 99.3% 0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.0% 99.0% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.5% 96.4% -0.1
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.6% 99.6% 0.0

@pritidesai
Copy link
Member Author

/retest

Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Thanks for this! It looks good to me, I have a few NITs, but I'd be happy to merge this and resolve them in a separate PR if you prefer
/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afrittoli, chitrangpatel

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:
  • OWNERS [afrittoli,chitrangpatel]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

A finally task can access both the reason and status of a pipelineTask from
the tasks section.

When onError is set to either continue or stopAndFail and the task fails, the
status is set to the same value Failed, making it indistinguishable whether the
failure was allowed or not. However, when onError is set to continue,
the reason is assigned FailureIgnored. This additional information can be used
to identify that the checks failed, but the failure can be ignored.

The syntax is $(tasks.<pipelineTask>.reason)

Signed-off-by: Priti Desai <pdesai@us.ibm.com>
@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/pipeline_validation.go 99.3% 99.3% 0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.0% 99.0% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.5% 96.7% 0.1
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.6% 99.6% 0.0

@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/pipeline_validation.go 99.3% 99.3% 0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.0% 99.0% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.5% 96.7% 0.1
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.6% 99.6% 0.0

@pritidesai
Copy link
Member Author

Thanks @chitrangpatel and @afrittoli for the reviews! I have addressed all the comments. Currently, the CI is failing due to the rate limit.

@pritidesai
Copy link
Member Author

/retest

@chitrangpatel
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 17, 2024
@pritidesai
Copy link
Member Author

/retest

2 similar comments
@pritidesai
Copy link
Member Author

/retest

@pritidesai
Copy link
Member Author

/retest

@pritidesai
Copy link
Member Author

Once again, we are running into the same rate limit issue :(

docker: Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit.

@afrittoli
Copy link
Member

Once again, we are running into the same rate limit issue :(

docker: Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit.

Because we autoscale the cluster nodes up and down, every time we run jobs on a new node it will pull images.
One way around this could be to maintain our downstream copy of the images we use in the kind clusters.
@vdemeester @chitrangpatel wdyt?

@afrittoli
Copy link
Member

/test pull-tekton-pipeline-integration-tests

@afrittoli
Copy link
Member

/test pull-tekton-pipeline-go-coverage-df

@tekton-robot
Copy link
Collaborator

@afrittoli: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-alpha-integration-tests
  • /test pull-tekton-pipeline-beta-integration-tests
  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-integration-tests
  • /test pull-tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage

Use /test all to run all jobs.

In response to this:

/test pull-tekton-pipeline-go-coverage-df

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

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/pipeline_validation.go 99.3% 99.3% 0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.0% 99.0% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.5% 96.7% 0.1
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.6% 99.6% 0.0

@tekton-robot tekton-robot merged commit b787c94 into tektoncd:main Jul 18, 2024
14 checks passed
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/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

4 participants