Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: batching events and webhook plugin support #1359

Merged
merged 11 commits into from
Jul 7, 2023

Conversation

EnriqueL8
Copy link
Contributor

@EnriqueL8 EnriqueL8 commented Jun 29, 2023

Enable batching for subscriptions

  • Write more robust tests to match coverage
  • Handle the firstData for events and decide what we do there
  • Refactor the webhook plugin to make it more modular instead of copying code across functions

Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2023

Codecov Report

Merging #1359 (be50b97) into main (816463c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##             main    #1359    +/-   ##
========================================
  Coverage   99.98%   99.98%            
========================================
  Files         315      315            
  Lines       21907    22036   +129     
========================================
+ Hits        21903    22032   +129     
  Misses          2        2            
  Partials        2        2            
Impacted Files Coverage Δ
pkg/core/event.go 100.00% <ø> (ø)
pkg/core/subscription.go 100.00% <ø> (ø)
internal/events/event_dispatcher.go 100.00% <100.00%> (ø)
internal/events/event_manager.go 100.00% <100.00%> (ø)
internal/events/subscription_manager.go 100.00% <100.00%> (ø)
internal/events/system/events.go 100.00% <100.00%> (ø)
internal/events/webhooks/webhooks.go 100.00% <100.00%> (ø)
internal/events/websockets/websockets.go 100.00% <100.00%> (ø)
internal/orchestrator/subscriptions.go 100.00% <100.00%> (ø)

@EnriqueL8
Copy link
Contributor Author

PR not ready for review as I need to work on removing the nack I added and test the infinite retry is now working

@EnriqueL8 EnriqueL8 force-pushed the batching_webhooks branch from fe72060 to baccf3f Compare July 6, 2023 13:28
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
EnriqueL8 added 3 commits July 6, 2023 21:13
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
@EnriqueL8 EnriqueL8 marked this pull request as ready for review July 6, 2023 21:46
EnriqueL8 and others added 5 commits July 6, 2023 23:32
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
…ebhooks

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Copy link
Contributor

@peterbroadhurst peterbroadhurst left a comment

Choose a reason for hiding this comment

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

@EnriqueL8 - looked great - I've filled in a couple of commits to simplify a bit of duplicate logic, and found an efficiency in deferring parsing of some data from string to JSON.

Also made the change to prevent creation of subscriptions with batching enabled, for event transports that don't support it.

@peterbroadhurst peterbroadhurst marked this pull request as draft July 7, 2023 14:00
@peterbroadhurst
Copy link
Contributor

Popped back to draft as there's a potential issue with creating subscriptions with the default transport

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@EnriqueL8 EnriqueL8 marked this pull request as ready for review July 7, 2023 16:18
@EnriqueL8
Copy link
Contributor Author

Tested the above fix from Peter and all good you can create a subscription with a transport and it defaults to web hooks

@EnriqueL8 EnriqueL8 merged commit 4f5c029 into hyperledger:main Jul 7, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants