tektoncd / triggers

Event triggering with Tekton!
Apache License 2.0
556 stars 418 forks source link

Add SetType and SetSubject to CE sink response #1600

Closed khrm closed 1 year ago

khrm commented 1 year ago

Changes

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

Release Notes

NONE
khrm commented 1 year ago

Fixes #1599

tekton-robot commented 1 year ago

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

File Old Coverage New Coverage Delta
pkg/sink/sink.go 70.8% 71.1% 0.2
matejvasek commented 1 year ago

It looks like the events.TriggerProcessingDoneV1 event may be also produced asynchronously if CloudEventURI is set.

See: https://github.com/tektoncd/triggers/blob/76f51dafe6453a37e6c6de35859692306d174666/pkg/sink/cloudevent/cloudevent.go#L49-L60

The event produced asynchronously and the one produced via HTTP response should be identical (at least id and source should be the same).

Another idea: when CloudEventURI is set couldn't we just return empty body with 202 since we know the even will be emitted asynchronously?

tekton-robot commented 1 year ago

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

File Old Coverage New Coverage Delta
pkg/sink/sink.go 70.8% 71.1% 0.2
savitaashture commented 1 year ago

/lgtm

tekton-robot commented 1 year ago

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

File Old Coverage New Coverage Delta
pkg/sink/sink.go 70.8% 71.1% 0.2
tekton-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: savitaashture

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](https://github.com/tektoncd/triggers/blob/main/OWNERS)~~ [savitaashture] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
khrm commented 1 year ago

/cherry-pick release-v0.24.x

tekton-robot commented 1 year ago

@khrm: new pull request created: #1605

In response to [this](https://github.com/tektoncd/triggers/pull/1600#issuecomment-1578155287): >/cherry-pick release-v0.24.x Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.