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

added event format to dispatcher #8096

Merged
merged 7 commits into from
Aug 12, 2024
Merged

Conversation

EraKin575
Copy link
Contributor

@EraKin575 EraKin575 commented Jul 10, 2024

added event format in event dispatcher
Fixes #8074

Proposed Changes

Pre-review Checklist

  • 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


Docs

Copy link

knative-prow bot commented Jul 10, 2024

Hi @EraKin575. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 10, 2024
@knative-prow knative-prow bot requested review from aliok and Cali0707 July 10, 2024 20:47
Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.92%. Comparing base (1e4183f) to head (f129b65).
Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8096      +/-   ##
==========================================
+ Coverage   67.87%   67.92%   +0.05%     
==========================================
  Files         368      368              
  Lines       17554    17564      +10     
==========================================
+ Hits        11915    11931      +16     
+ Misses       4894     4887       -7     
- Partials      745      746       +1     

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

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.

Nice start @EraKin575 - I left some feedback

@EraKin575
Copy link
Contributor Author

@Cali0707 thanks for your review. I have a question though. How can I check for binary format in unit tests

Signed-off-by: EraKin575 <[email protected]>
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 11, 2024
@EraKin575 EraKin575 requested a review from Cali0707 July 11, 2024 18:26
@Cali0707
Copy link
Member

How can I check for binary format in unit tests

In the http receiver handler function, you will be able to:

  1. convert the request to a cloudevent message type
  2. Read the encoding from the message with m.ReadEncoding()
  3. Compare this with the constants from the cloudevents binding package for the type Encoding
    Hope that helps!

@EraKin575
Copy link
Contributor Author

How can I check for binary format in unit tests

In the http receiver handler function, you will be able to:

  1. convert the request to a cloudevent message type
  2. Read the encoding from the message with m.ReadEncoding()
  3. Compare this with the constants from the cloudevents binding package for the type Encoding
    Hope that helps!

Thanks! Will try this

@Cali0707
Copy link
Member

Hey @EraKin575 any updates here? Anything we can help you with?

@EraKin575
Copy link
Contributor Author

Hey @EraKin575 any updates here? Anything we can help you with?

got busy with some stuff. I will finish this issue ASAP

@EraKin575
Copy link
Contributor Author

@Cali0707 , I can't quite get the http receiver part, can you please explain it in a bit more detail?

@Cali0707
Copy link
Member

@Cali0707 , I can't quite get the http receiver part, can you please explain it in a bit more detail?

Yeah, in the StartServer code for the tests, you provide a handler function that handles the http request. You can add the logic you need in there

@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 23, 2024
@EraKin575
Copy link
Contributor Author

@Cali0707 , I can't quite get the http receiver part, can you please explain it in a bit more detail?

Yeah, in the StartServer code for the tests, you provide a handler function that handles the http request. You can add the logic you need in there

thanks @Cali0707 ! I have done another commit. Please review it and advise me for any further changes

Signed-off-by: EraKin575 <[email protected]>
@Cali0707
Copy link
Member

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 23, 2024
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.

Nice work @EraKin575 - just a few changes and then this should be good to merge :)

Signed-off-by: EraKin575 <[email protected]>
Signed-off-by: EraKin575 <[email protected]>
@EraKin575 EraKin575 requested a review from Cali0707 July 24, 2024 03:52
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

/cc @pierDipi

Could you provide a second review here?

@knative-prow knative-prow bot requested a review from pierDipi July 24, 2024 16:41
@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2024
@Cali0707
Copy link
Member

/approve

Copy link

knative-prow bot commented Aug 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 12, 2024
@knative-prow knative-prow bot merged commit a4e5a0e into knative:main Aug 12, 2024
36 checks passed
@EraKin575 EraKin575 deleted the dispatcher branch August 16, 2024 17:40
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delivery Format: support specifying the event format in the kncloudevents dispatcher
2 participants