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

Copy message before passing it to eventtype autocreate handler #7934

Merged
merged 1 commit into from
May 22, 2024

Conversation

creydr
Copy link
Member

@creydr creydr commented May 22, 2024

Currently we see the TestEventTransformationForTriggerV1BrokerV1 e2e test failing, when the eventtype-auto-create FF is enabled. This is because we're not copying the message at the right place.

From the docs:

CopyMessage reads m once and creates an in-memory copy depending on the encoding of m. The returned copy is not dependent on any transport and can be visited many times. When the copy can be forgot, the copied message must be finished with Finish() message to release the memory. transformers can be nil and this function guarantees that they are invoked only once during the encoding process

This means, that m gets read by buffering.CopyMessage() and thus is "used" for further usages.

/cherry-pick release-1.14

@creydr creydr requested review from pierDipi and Cali0707 May 22, 2024 17:17
@knative-prow knative-prow bot requested a review from matzew May 22, 2024 17:17
@knative-prow knative-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 22, 2024
Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 69.51%. Comparing base (7e1c082) to head (92b0dc4).
Report is 55 commits behind head on main.

Files Patch % Lines
pkg/kncloudevents/event_dispatcher.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7934      +/-   ##
==========================================
+ Coverage   69.22%   69.51%   +0.29%     
==========================================
  Files         339      344       +5     
  Lines       19494    15994    -3500     
==========================================
- Hits        13494    11119    -2375     
+ Misses       5337     4189    -1148     
- Partials      663      686      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@creydr
Copy link
Member Author

creydr commented May 22, 2024

/cc @Cali0707

Copy link
Member

@Cali0707 Cali0707 left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks for catching this @creydr !

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label May 22, 2024
Copy link

knative-prow bot commented May 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@knative-prow knative-prow bot merged commit b5f92c2 into knative:main May 22, 2024
35 of 38 checks passed
@creydr
Copy link
Member Author

creydr commented May 22, 2024

/cherry-pick release-1.14

@knative-prow-robot
Copy link
Contributor

@creydr: new pull request created: #7937

In response to this:

/cherry-pick release-1.14

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-sigs/prow repository.

@pierDipi
Copy link
Member

@creydr it would be great to get a regression test for this

@creydr
Copy link
Member Author

creydr commented May 23, 2024

@creydr it would be great to get a regression test for this

I see 2 options:

  1. Adding a dedicated test to the experimental suite which tests one flow (something from the rekt test suite)
  2. Or enabling the eventtype-auto-create FF for the reconciler test suite (not sure if we are "ready" for this yet though)

Objections @pierDipi?

openshift-merge-bot bot pushed a commit to openshift-knative/eventing that referenced this pull request May 23, 2024
@Cali0707
Copy link
Member

Or enabling the eventtype-auto-create FF for the reconciler test suite (not sure if we are "ready" for this yet though)

@creydr we already do this option in EKB, maybe it makes sense here as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants