results icon indicating copy to clipboard operation
results copied to clipboard

Enable storing of Run Events as Record

Open khrm opened this issue 10 months ago • 7 comments

All Events related to taskrun or PipelineRun are stored when we are done with Runs and in a single List. This can be controlled by a flag passed to the watcher: "store-event". Setting it to false disables the storing of Events. The record Name of EventList is stored as results.tekton.dev/eventlist in TaskRun and PipelineRun.

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you review them:

  • [ ] Has Docs included if any changes are user facing
  • [x] Has Tests included if any functionality added or changed
  • [x] Tested your changes locally (if this is a code change)
  • [x] Follows the commit message standard
  • [x] Meets the Tekton contributor standards (including functionality, content, code)
  • [x] Has a kind label. You can add 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)
  • [ ] Release notes contain the string "action required" if the change requires additional action from users switching to the new release

Release Notes

All Events related to taskrun or PipelineRun are stored when we are done with Runs and in a single List.
This can be controlled by a flag passed to the watcher: "store-event". Setting it to false 
disables the storing of Events. 
The record Name of EventList is stored as `results.tekton.dev/eventlist` in TaskRun and PipelineRun.

khrm avatar Apr 18 '24 11:04 khrm

The following is the coverage report on the affected files. Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/v1alpha2/types.go Do not exist 28.6%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 55.3% 53.6% -1.7
pkg/watcher/results/eventlist.go Do not exist 0.0%

tekton-robot avatar Apr 18 '24 12:04 tekton-robot

/test pull-tekton-results-build-tests

khrm avatar Apr 18 '24 12:04 khrm

The following is the coverage report on the affected files. Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/v1alpha2/types.go Do not exist 28.6%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 55.3% 53.1% -2.2
pkg/watcher/results/eventlist.go Do not exist 0.0%

tekton-robot avatar Apr 18 '24 12:04 tekton-robot

The following is the coverage report on the affected files. Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/v1alpha2/types.go Do not exist 28.6%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 55.3% 56.5% 1.2
pkg/watcher/results/eventlist.go Do not exist 0.0%

tekton-robot avatar Apr 18 '24 14:04 tekton-robot

/test pull-tekton-results-build-tests

khrm avatar Apr 18 '24 15:04 khrm

The following is the coverage report on the affected files. Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/v1alpha2/types.go Do not exist 28.6%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 55.3% 56.5% 1.2
pkg/watcher/results/eventlist.go Do not exist 0.0%

tekton-robot avatar Apr 18 '24 15:04 tekton-robot

I'll take a look over the next day or two @khrm - thanks

gabemontero avatar May 08 '24 12:05 gabemontero

/test pull-tekton-results-integration-tests

khrm avatar Jul 02 '24 18:07 khrm

/test pull-tekton-results-integration-tests

khrm avatar Jul 02 '24 18:07 khrm

/test pull-tekton-results-integration-tests

khrm avatar Jul 02 '24 18:07 khrm

The following is the coverage report on the affected files. Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/v1alpha3/types.go 100.0% 0.0% -100.0
pkg/apis/v1alpha3/types.go Do not exist 20.0%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 50.0%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/watcher/reconciler/dynamic/dynamic.go 54.5% 55.7% 1.3
pkg/watcher/results/eventlist.go Do not exist 0.0%

tekton-robot avatar Jul 02 '24 19:07 tekton-robot

Apart from changing the default value of event_store to false. I have added a filter for values being stored. We don't store labels now. https://github.com/tektoncd/results/compare/ddf215448b8da116cff81ecb3f9a3d34239e1745..e1511ddb41d8a24f293d5d612b6f0575ffeb19fb

khrm avatar Jul 02 '24 20:07 khrm

/test pull-tekton-results-integration-tests

khrm avatar Jul 02 '24 20:07 khrm

The following is the coverage report on the affected files. Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/v1alpha3/types.go Do not exist 20.0%
pkg/apis/v1alpha3/types.go Do not exist 66.7%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 54.5% 55.8% 1.3
pkg/watcher/results/eventlist.go Do not exist 0.0%

tekton-robot avatar Jul 02 '24 20:07 tekton-robot

The following is the coverage report on the affected files. Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/v1alpha3/types.go Do not exist 28.6%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 54.5% 55.6% 1.1
pkg/watcher/results/eventlist.go Do not exist 0.0%

tekton-robot avatar Jul 02 '24 23:07 tekton-robot

/test pull-tekton-results-integration-tests

khrm avatar Jul 02 '24 23:07 khrm

/test pull-tekton-results-integration-tests

khrm avatar Jul 03 '24 00:07 khrm

The following is the coverage report on the affected files. Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/v1alpha3/types.go Do not exist 16.7%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 54.5% 55.6% 1.1
pkg/watcher/results/eventlist.go Do not exist 0.0%

tekton-robot avatar Jul 03 '24 00:07 tekton-robot

/test pull-tekton-results-integration-tests

khrm avatar Jul 03 '24 00:07 khrm

/test pull-tekton-results-integration-tests

khrm avatar Jul 03 '24 00:07 khrm

@avinal We don't need a separate API. Events are stored as a record with a different type. If someone wants to query them, they can query based on Type.

khrm avatar Jul 03 '24 00:07 khrm

The following is the coverage report on the affected files. Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/v1alpha3/types.go Do not exist 16.7%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 54.5% 56.0% 1.6
pkg/watcher/results/eventlist.go Do not exist 0.0%

tekton-robot avatar Jul 03 '24 00:07 tekton-robot

/test pull-tekton-results-integration-tests

khrm avatar Jul 03 '24 00:07 khrm

The following is the coverage report on the affected files. Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/v1alpha3/types.go Do not exist 28.6%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 54.5% 56.0% 1.6
pkg/watcher/results/eventlist.go Do not exist 0.0%

tekton-robot avatar Jul 03 '24 01:07 tekton-robot

/test pull-tekton-results-build-tests

khrm avatar Jul 03 '24 01:07 khrm

The following is the coverage report on the affected files. Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/v1alpha3/types.go Do not exist 16.7%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 100.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/apis/v1alpha3/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 54.5% 56.2% 1.7
pkg/watcher/results/eventlist.go Do not exist 0.0%

tekton-robot avatar Jul 03 '24 01:07 tekton-robot

The change is lgtm. One question, is it safe and have you tested switching that option back and forth, including reading the data? What I mean is start with the default (disabled), store some data, switch to enabled, store and read some data, switch to disabled, store and read some data (assuming keeping the storage and data).

enarha avatar Jul 03 '24 09:07 enarha

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: avinal, 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:
  • ~~OWNERS~~ [avinal,vdemeester]

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 Jul 03 '24 09:07 tekton-robot

@enarha I tested this by enabling and disabling it. It works in both cases. Older data works.

khrm avatar Jul 03 '24 11:07 khrm

@avinal We need lgtm here. And then we can merge it.

khrm avatar Jul 03 '24 11:07 khrm