pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

feat: support passing clock during RunStatus initialization

Open devholic opened this issue 8 months ago • 8 comments
trafficstars

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`.

devholic avatar Mar 18 '25 08:03 devholic

/kind misc

devholic avatar Mar 18 '25 08:03 devholic

/assign @wlynch

devholic avatar Mar 18 '25 08:03 devholic

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

tekton-robot avatar Mar 18 '25 08:03 tekton-robot

/retest

waveywaves avatar May 13 '25 06:05 waveywaves

/retest

waveywaves avatar May 20 '25 09:05 waveywaves

@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

waveywaves avatar May 21 '25 07:05 waveywaves

[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

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 avatar May 21 '25 09:05 tekton-robot

/retest

vdemeester avatar Jun 11 '25 13:06 vdemeester

/retest

waveywaves avatar Jun 27 '25 14:06 waveywaves

/retest

waveywaves avatar Jul 29 '25 18:07 waveywaves

/retest

waveywaves avatar Jul 30 '25 11:07 waveywaves

/retest

waveywaves avatar Aug 14 '25 10:08 waveywaves

/retest

waveywaves avatar Aug 19 '25 16:08 waveywaves

/retest

waveywaves avatar Aug 19 '25 19:08 waveywaves

@devholic can you see what's failing and fix the test, seems like these aren't really flakes

waveywaves avatar Aug 29 '25 21:08 waveywaves

/retest

devholic avatar Aug 31 '25 14:08 devholic

@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.

tekton-robot avatar Aug 31 '25 14:08 tekton-robot

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

tekton-robot avatar Aug 31 '25 14:08 tekton-robot

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

tekton-robot avatar Aug 31 '25 15:08 tekton-robot

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

tekton-robot avatar Sep 01 '25 02:09 tekton-robot

/retest

waveywaves avatar Nov 10 '25 13:11 waveywaves