Skip to content

feat: override task timeouts in pipelineruns#8636

Merged
tekton-robot merged 1 commit intotektoncd:mainfrom
waveywaves:override-task-timeout
Aug 15, 2025
Merged

feat: override task timeouts in pipelineruns#8636
tekton-robot merged 1 commit intotektoncd:mainfrom
waveywaves:override-task-timeout

Conversation

@waveywaves
Copy link
Member

@waveywaves waveywaves commented Mar 11, 2025

Changes

/fixes #7752

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

feature: PipelineRun can now override individual task timeouts with spec.taskRunSpecs[].timeout 

@tekton-robot tekton-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 11, 2025
@waveywaves
Copy link
Member Author

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 11, 2025
@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 92.5% 92.5% 0.1
pkg/apis/pipeline/v1/pipelinerun_validation.go 94.7% 93.8% -0.9

@waveywaves waveywaves force-pushed the override-task-timeout branch from 41cbb8b to 1cb87f9 Compare March 11, 2025 15:12
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 11, 2025
@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 92.5% 92.5% 0.1
pkg/apis/pipeline/v1/pipelinerun_validation.go 94.7% 93.8% -0.9

@waveywaves waveywaves force-pushed the override-task-timeout branch from 1cb87f9 to d5ca69c Compare March 28, 2025 23:47
@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 92.5% 92.5% 0.1
pkg/apis/pipeline/v1/pipelinerun_validation.go 94.7% 93.8% -0.9

@waveywaves waveywaves force-pushed the override-task-timeout branch from d5ca69c to 0418ce7 Compare March 29, 2025 00:20
@waveywaves waveywaves closed this Mar 29, 2025
@waveywaves waveywaves force-pushed the override-task-timeout branch from 0418ce7 to 5b082b1 Compare March 29, 2025 00:27
@tekton-robot tekton-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 29, 2025
@waveywaves waveywaves reopened this Mar 29, 2025
@github-project-automation github-project-automation bot moved this from Done to In Progress in Tekton Community Roadmap Mar 29, 2025
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 29, 2025
@waveywaves waveywaves marked this pull request as ready for review March 29, 2025 00:31
@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 Mar 29, 2025
@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 92.5% 92.5% 0.1
pkg/apis/pipeline/v1/pipelinerun_validation.go 94.7% 95.1% 0.4
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% -0.0
pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go 95.7% 95.8% 0.0
pkg/apis/pipeline/v1beta1/pipelinerun_types.go 89.7% 89.8% 0.1
pkg/apis/pipeline/v1beta1/pipelinerun_validation.go 97.2% 96.6% -0.5
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 98.1% 0.6
pkg/reconciler/pipelinerun/pipelinerun.go 91.9% 92.1% 0.2

@waveywaves waveywaves force-pushed the override-task-timeout branch from f1a4a4a to b10c867 Compare August 14, 2025 11:15
@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 92.5% 92.5% 0.1
pkg/apis/pipeline/v1/pipelinerun_validation.go 94.7% 95.1% 0.4
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% -0.0
pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go 95.7% 95.8% 0.0
pkg/apis/pipeline/v1beta1/pipelinerun_types.go 89.7% 89.8% 0.1
pkg/apis/pipeline/v1beta1/pipelinerun_validation.go 97.2% 96.6% -0.5
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 98.1% 0.6
pkg/reconciler/pipelinerun/pipelinerun.go 91.9% 92.1% 0.2

@waveywaves
Copy link
Member Author

/retest

Copy link
Member

@aThorp96 aThorp96 left a comment

Choose a reason for hiding this comment

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

/lgtm

One documentation suggestion to clarify the timeout assignment vs timeout enforcement behavior between TaskRuns and PipelineRuns. Otherwise this looks great. Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Agreed, thanks for creating the followup issue as well! What you've added to that section looks good for the scope of this PR 🙏🏼

@tekton-robot
Copy link
Collaborator

@aThorp96: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

One documentation suggestion to clarify the timeout assignment vs timeout enforcement behavior between TaskRuns and PipelineRuns. Otherwise this looks great. Thanks!

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/pipelinerun_types.go 92.5% 92.5% 0.1
pkg/apis/pipeline/v1/pipelinerun_validation.go 94.7% 95.1% 0.4
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% -0.0
pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go 95.7% 95.8% 0.0
pkg/apis/pipeline/v1beta1/pipelinerun_types.go 89.7% 89.8% 0.1
pkg/apis/pipeline/v1beta1/pipelinerun_validation.go 97.2% 96.6% -0.5
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 98.1% 0.6
pkg/reconciler/pipelinerun/pipelinerun.go 91.9% 92.1% 0.2

Copy link
Member

@twoGiants twoGiants left a comment

Choose a reason for hiding this comment

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

Looks great! The tests are very good. Thank you for the documentation update, it clarifies a lot. 😸 👍

I have found temporal coupling in the code. See my big comment below.

But all in all its good to go, it just needs some minor changes for a quick solution so it can be merged.

You could add a refactoring issue to centralize timeout validation for the community to pick up but its not a must.

Comment on lines 381 to 383
errs = errs.Also(apis.ErrInvalidValue(
fmt.Sprintf("%s should be <= %s %s", taskRunTimeout.Duration, timeoutSource, maxTimeout.Duration),
"timeout"))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
errs = errs.Also(apis.ErrInvalidValue(
fmt.Sprintf("%s should be <= %s %s", taskRunTimeout.Duration, timeoutSource, maxTimeout.Duration),
"timeout"))
return apis.ErrInvalidValue(
fmt.Sprintf("%s should be <= %s %s", taskRunTimeout.Duration, timeoutSource, maxTimeout.Duration),
"timeout")

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

@waveywaves waveywaves force-pushed the override-task-timeout branch 3 times, most recently from c45c5af to 8aab142 Compare August 15, 2025 12:33
@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/v1beta1/pipelinerun_conversion.go 95.7% 95.8% 0.0
pkg/apis/pipeline/v1beta1/pipelinerun_types.go 89.7% 89.8% 0.1
pkg/apis/pipeline/v1beta1/pipelinerun_validation.go 97.2% 96.6% -0.5
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 98.1% 0.6
pkg/reconciler/pipelinerun/pipelinerun.go 91.9% 92.1% 0.2

@waveywaves waveywaves force-pushed the override-task-timeout branch from 8aab142 to 075e4b6 Compare August 15, 2025 12:43
@waveywaves waveywaves force-pushed the override-task-timeout branch from 075e4b6 to 8679149 Compare August 15, 2025 12:47
@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/v1beta1/pipelinerun_conversion.go 95.7% 95.8% 0.0
pkg/apis/pipeline/v1beta1/pipelinerun_types.go 89.7% 89.8% 0.1
pkg/apis/pipeline/v1beta1/pipelinerun_validation.go 97.2% 96.6% -0.5
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 98.1% 0.6
pkg/reconciler/pipelinerun/pipelinerun.go 91.9% 92.1% 0.2

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aThorp96, twoGiants, vdemeester

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

The pull request process is described here

Details 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
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 92.5% 92.5% 0.1
pkg/apis/pipeline/v1/pipelinerun_validation.go 94.7% 94.9% 0.2
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% -0.0
pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go 95.7% 95.8% 0.0
pkg/apis/pipeline/v1beta1/pipelinerun_types.go 89.7% 89.8% 0.1
pkg/apis/pipeline/v1beta1/pipelinerun_validation.go 97.2% 96.6% -0.5
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 98.1% 0.6
pkg/reconciler/pipelinerun/pipelinerun.go 91.9% 92.1% 0.2

@twoGiants
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 15, 2025
@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 92.5% 92.5% 0.1
pkg/apis/pipeline/v1/pipelinerun_validation.go 94.7% 93.9% -0.8
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% -0.0
pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go 95.7% 95.8% 0.0
pkg/apis/pipeline/v1beta1/pipelinerun_types.go 89.7% 89.8% 0.1
pkg/apis/pipeline/v1beta1/pipelinerun_validation.go 97.2% 95.7% -1.4
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 98.1% 0.6
pkg/reconciler/pipelinerun/pipelinerun.go 91.9% 92.1% 0.2

@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 92.5% 92.5% 0.1
pkg/apis/pipeline/v1/pipelinerun_validation.go 94.7% 93.8% -0.8
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% -0.0
pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go 95.7% 95.8% 0.0
pkg/apis/pipeline/v1beta1/pipelinerun_types.go 89.7% 89.8% 0.1
pkg/apis/pipeline/v1beta1/pipelinerun_validation.go 97.2% 95.7% -1.5
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 98.1% 0.6
pkg/reconciler/pipelinerun/pipelinerun.go 91.9% 92.1% 0.2

@waveywaves
Copy link
Member Author

/retest

2 similar comments
@waveywaves
Copy link
Member Author

/retest

@waveywaves
Copy link
Member Author

/retest

@waveywaves
Copy link
Member Author

cornflakes > testflakes

@tekton-robot tekton-robot merged commit 665a03b into tektoncd:main Aug 15, 2025
87 of 92 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Tekton Community Roadmap Aug 15, 2025
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add the ability to override the timeout value for individual pipeline tasks via taskRunSpecs in a pipelineRun

7 participants