pipeline
pipeline copied to clipboard
feat: support passing clock during RunStatus initialization
Changes
Currently, the TaskRunStatus/CustomRunStatus implementation did not allow passing a clock when initializing conditions, making it difficult to test and set arbitrary time values.
This commit updates the InitializeConditions method of TaskRunStatus/CustomRunStatus to accept a clock as an argument, allowing the start time to be set using the provided clock.
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
- [x] Has Tests included if any functionality added or changed
- [x] pre-commit Passed
- [x] Follows the commit message standard
- [x] Meets the Tekton contributor standards (including functionality, content, code)
- [x] 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 - [x] 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.
- [x] Release notes contains the string "action required" if the change requires additional action from users switching to the new release
Release Notes
action required: The `InitializeConditions` method for `CustomRun` and `TaskRun` conditions now requires a `clock.PassiveClock` as an argument. If you are implementing a `CustomTask` controller, ensure that you pass a `clock` when invoking `InitializeConditions` for `CustomRun`.
/kind misc
/assign @wlynch
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/run/v1beta1/customrunstatus_types.go | 17.6% | 55.9% | 38.2 |
/retest
/retest
@devholic I am going to retest again there seems something wrong with the git resolver API test so I feel like it "might" be a flake but I also see some clock updates in the test, which might be completely unrelated. do check if this is something that needs to be fixed from your side.
/retest
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: vdemeester
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [vdemeester]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/retest
/retest
/retest
/retest
/retest
/retest
/retest
@devholic can you see what's failing and fix the test, seems like these aren't really flakes
/retest
@devholic: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
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.
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/run/v1beta1/customrunstatus_types.go | 17.6% | 55.9% | 38.2 |
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/run/v1beta1/customrunstatus_types.go | 17.6% | 55.9% | 38.2 |
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/run/v1beta1/customrunstatus_types.go | 17.6% | 55.9% | 38.2 |
/retest