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

Clients v2 #316

Merged
merged 28 commits into from
Feb 18, 2021
Merged

Clients v2 #316

merged 28 commits into from
Feb 18, 2021

Conversation

mantzas
Copy link

@mantzas mantzas commented Dec 26, 2020

Which problem is this PR solving?

Closes #311.

Short description of the changes

  • Introduced v2 clients
  • Fixed some logging issues
  • Increased code coverage

@codecov
Copy link

codecov bot commented Dec 26, 2020

Codecov Report

Merging #316 (c0335b6) into master (9099ada) will decrease coverage by 1.68%.
The diff coverage is 37.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #316      +/-   ##
==========================================
- Coverage   74.39%   72.71%   -1.69%     
==========================================
  Files          65       71       +6     
  Lines        3691     3859     +168     
==========================================
+ Hits         2746     2806      +60     
- Misses        839      939     +100     
- Partials      106      114       +8     
Impacted Files Coverage Δ
client/amqp/amqp.go 37.73% <ø> (ø)
client/grpc/grpc.go 76.19% <ø> (ø)
client/kafka/async_producer.go 0.00% <ø> (ø)
client/kafka/builder.go 58.42% <ø> (ø)
client/kafka/v2/async_producer.go 0.00% <0.00%> (ø)
client/kafka/v2/sync_producer.go 0.00% <0.00%> (ø)
client/sns/message.go 96.72% <ø> (ø)
client/sns/publisher.go 92.30% <ø> (ø)
client/sqs/message.go 93.10% <ø> (ø)
client/sqs/publisher.go 92.30% <ø> (ø)
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9099ada...0d4408c. Read the comment docs.

@mantzas mantzas marked this pull request as ready for review December 27, 2020 20:47
Copy link

@drakos74 drakos74 left a comment

Choose a reason for hiding this comment

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

looks good overall, just it might be better to split per client (like in #315 ) ?
So that also the review is more structured and easier making it in smaller pieces.
But also happy to go with this bigger one ... given the circumstances and work put into this.

// Close shuts down the producer and waits for any buffered messages to be
// flushed. You must call this function before a producer object passes out of
// scope, as it may otherwise leak memory.
func (ap *AsyncProducer) Close() error {

Choose a reason for hiding this comment

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

maybe we could use defer in this case to make the code more clear
(and return a potential error with a pattern like this pattern like this https://yourbasic.org/golang/defer/#use-func-to-return-a-value ) ?

Copy link
Author

Choose a reason for hiding this comment

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

we might have potentially 2 errors here. the aggregate function merges whose 2 into one. with the mentioned pattern we will only return 1 error which is not what we want here.


prometheus.MustRegister(messageStatus)
}

Choose a reason for hiding this comment

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

are status and deliveryType values limited to a specific number ?
Maybe we could use enums or predefined string properties ?

Copy link
Author

Choose a reason for hiding this comment

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

Done

Copy link
Author

Choose a reason for hiding this comment

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

i had to revert one of the values as it broke the tests. the reason is that they are internals and integration tests do not run inside the same package.

// Close shuts down the producer and waits for any buffered messages to be
// flushed. You must call this function before a producer object passes out of
// scope, as it may otherwise leak memory.
func (p *SyncProducer) Close() error {

Choose a reason for hiding this comment

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

same as above ... to consider

@@ -5,7 +5,7 @@ import (
"io"
"io/ioutil"

"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/proto" //nolint:staticcheck

Choose a reason for hiding this comment

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

it might be a better option to use the golang.org package instead of ignoring the error ?

Copy link
Author

Choose a reason for hiding this comment

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

we have an open ticket for this. Unfortunately it is not straightforward with just an upgrade because it is a breaking change.

drakos74
drakos74 previously approved these changes Dec 30, 2020
tpaschalis
tpaschalis previously approved these changes Jan 5, 2021
tpaschalis
tpaschalis previously approved these changes Jan 22, 2021
drakos74
drakos74 previously approved these changes Feb 14, 2021
Copy link

@tpaschalis tpaschalis left a comment

Choose a reason for hiding this comment

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

🛥️

@mantzas mantzas merged commit 7f52baf into master Feb 18, 2021
@mantzas mantzas deleted the clients-v2 branch February 18, 2021 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clients v2
3 participants