Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-v1.11] Backport kncloudevents package improvements #492

Conversation

pierDipi
Copy link
Member

This will allow an easier backport for the trust-manager integration, see individual commits and references for details.

g1rjeevan and others added 4 commits January 17, 2024 10:28
## Proposed Changes
Removed the legacy http client go, message sender go and respective test
files, Since the functionality are handled in http client new and
message sender new go

Issue related : knative#6995
 
- 🗑️ Remove feature or internal logic

-
-
-

### Pre-review Checklist

- [x] **At least 80% unit test coverage**
- [ ] **E2E tests** for any new behavior
- [ ] **Docs PR** for any user-facing impact
- [ ] **Spec PR** for any new API feature
- [ ] **Conformance test** for any change to the spec

**Release Note**
 
```release-note

```


**Docs**
 
📖 knative#6995

---------

Co-authored-by: Christoph Stäbler <[email protected]>
Adds a function (`SendEvent`) to the kncloudevents package to Send
events. This function:
* configures the client (e.g. for TLS)
* has option to send replies
* has option to send to a DLS
* has option to add additional transformers

This allows e.g. for use cases like the following:
```
kncloudevents.SendEvent(ctx, event, sub.Subscriber,
	kncloudevents.WithHeader(additionalHeaders),
	kncloudevents.WithReply(sub.Reply),
	kncloudevents.WithDeadLetterSink(sub.DeadLetter),
	kncloudevents.WithRetryConfig(sub.RetryConfig))
```

The `SendMessage` function is provided to make integration with existing
packages easier (e.g. in dependent projects).

Also migrated the usages of kncloudevents.NewCloudEventRequest() to the
new SendEvent() function (mt-broker-filter and mt-broker-ingress):
* 74c1552
* 9728713
* 958722d
* Remove kncloudevents.CloudEventsRequest

* Run hack/update-codegen.sh

* Add unit tests for generateBackoffFn()
Fix dispatcher data race

Signed-off-by: Pierangelo Di Pilato <[email protected]>
@pierDipi
Copy link
Member Author

/assign @creydr

@pierDipi pierDipi changed the title [release-v1.11] [WIP] Backport kncloudevents package improvements [release-v1.11] Backport kncloudevents package improvements Jan 17, 2024
Copy link
Member

@creydr creydr left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jan 17, 2024
Copy link

openshift-ci bot commented Jan 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: creydr, pierDipi

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

@pierDipi
Copy link
Member Author

/cherry-pick release-v1.12

@openshift-cherrypick-robot

@pierDipi: once the present PR merges, I will cherry-pick it on top of release-v1.12 in a new PR and assign it to you.

In response to this:

/cherry-pick release-v1.12

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.

@openshift-merge-bot openshift-merge-bot bot merged commit 2d2c4d5 into openshift-knative:release-v1.11 Jan 17, 2024
11 checks passed
@openshift-cherrypick-robot

@pierDipi: #492 failed to apply on top of branch "release-v1.12":

Applying: Remove deprecated httpclient msgsender (#7018)
Using index info to reconstruct a base tree...
A	pkg/inmemorychannel/message_dispatcher_benchmark_test.go
A	pkg/inmemorychannel/message_dispatcher_test.go
M	pkg/kncloudevents/http_client.go
A	pkg/kncloudevents/http_client_new.go
A	pkg/kncloudevents/http_client_new_test.go
M	pkg/kncloudevents/http_client_test.go
A	pkg/kncloudevents/message_sender.go
A	pkg/kncloudevents/message_sender_test.go
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): pkg/kncloudevents/http_client_test.go deleted in Remove deprecated httpclient msgsender (#7018) and modified in HEAD. Version HEAD of pkg/kncloudevents/http_client_test.go left in tree.
CONFLICT (modify/delete): pkg/kncloudevents/http_client_new_test.go deleted in HEAD and modified in Remove deprecated httpclient msgsender (#7018). Version Remove deprecated httpclient msgsender (#7018) of pkg/kncloudevents/http_client_new_test.go left in tree.
CONFLICT (modify/delete): pkg/kncloudevents/http_client_new.go deleted in HEAD and modified in Remove deprecated httpclient msgsender (#7018). Version Remove deprecated httpclient msgsender (#7018) of pkg/kncloudevents/http_client_new.go left in tree.
CONFLICT (modify/delete): pkg/kncloudevents/http_client.go deleted in Remove deprecated httpclient msgsender (#7018) and modified in HEAD. Version HEAD of pkg/kncloudevents/http_client.go left in tree.
Auto-merging pkg/inmemorychannel/event_dispatcher_test.go
CONFLICT (content): Merge conflict in pkg/inmemorychannel/event_dispatcher_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Remove deprecated httpclient msgsender (#7018)
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-v1.12

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants