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

code fixes to use new grpc api #5335

Closed
wants to merge 5 commits into from
Closed

Conversation

danish9039
Copy link
Contributor

@danish9039 danish9039 commented Apr 6, 2024

Which problem is this PR solving?

Description of the changes

  • fixes code for using new grpc api

How was this change tested?

  • make test
  • make lint

Checklist

dependabot bot and others added 2 commits April 5, 2024 13:42
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.62.1 to 1.63.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.62.1...v1.63.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: danish siddiqui <danishsiddiqui040@gmail.com>
@danish9039 danish9039 requested a review from a team as a code owner April 6, 2024 20:16
@danish9039 danish9039 requested a review from jkowall April 6, 2024 20:16
Copy link

codecov bot commented Apr 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.26%. Comparing base (8a4748c) to head (b498d4e).

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5335       +/-   ##
===========================================
- Coverage   95.24%   45.26%   -49.99%     
===========================================
  Files         340      212      -128     
  Lines       16672    10989     -5683     
===========================================
- Hits        15879     4974    -10905     
- Misses        603     5563     +4960     
- Partials      190      452      +262     
Flag Coverage Δ
badger 11.19% <0.00%> (+<0.01%) ⬆️
cassandra-3.x 19.33% <0.00%> (+<0.01%) ⬆️
cassandra-4.x 19.33% <0.00%> (+<0.01%) ⬆️
elasticsearch-5.x 22.21% <0.00%> (+<0.01%) ⬆️
elasticsearch-6.x 22.21% <0.00%> (+0.01%) ⬆️
elasticsearch-7.x 22.27% <0.00%> (+0.01%) ⬆️
elasticsearch-8.x 22.46% <0.00%> (+0.01%) ⬆️
grpc 11.56% <100.00%> (-0.01%) ⬇️
kafka 10.81% <0.00%> (+<0.01%) ⬆️
opensearch-1.x ?
opensearch-2.x 22.31% <0.00%> (-0.01%) ⬇️
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Signed-off-by: danish siddiqui <danishsiddiqui040@gmail.com>
@@ -81,7 +81,8 @@ func createProcessor(t *testing.T, mFactory metrics.Factory, tFactory thrift.TPr

func initCollectorAndReporter(t *testing.T) (*metricstest.Factory, *testutils.GrpcCollector, reporter.Reporter, *grpc.ClientConn) {
grpcCollector := testutils.StartGRPCCollector(t)
conn, err := grpc.Dial(grpcCollector.Listener().Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(grpcCollector.Listener().Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
grpc.NewClient(grpcCollector.Listener().Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
Copy link
Member

Choose a reason for hiding this comment

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

Twice?

@@ -507,7 +507,7 @@ func (c *samplingManagerClient) GetSamplingStrategy(ctx context.Context, in *Sam
out := new(SamplingStrategyResponse)
err := c.cc.Invoke(ctx, "/jaeger.api_v2.SamplingManager/GetSamplingStrategy", in, out, opts...)
if err != nil {
return nil, err
return nil, fmt.Errorf("Error while dialing: %w",err)
Copy link
Member

Choose a reason for hiding this comment

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

This is autogenerated file, please revert

@@ -149,8 +149,8 @@ func TestGRPCStorageFactory(t *testing.T) {

func TestGRPCStorageFactoryWithConfig(t *testing.T) {
cfg := grpcConfig.Configuration{}
_, err := NewFactoryWithConfig(cfg, metrics.NullFactory, zap.NewNop())
require.ErrorContains(t, err, "grpc-plugin builder failed to create a store: error connecting to remote storage")
Copy link
Member

Choose a reason for hiding this comment

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

Not equivalent change

Signed-off-by: danish siddiqui <danishsiddiqui040@gmail.com>
return s.client.GetSamplingStrategy(ctx, &api_v2.SamplingStrategyParameters{ServiceName: serviceName})
resp, err := s.client.GetSamplingStrategy(ctx, &api_v2.SamplingStrategyParameters{ServiceName: serviceName})
if err != nil {
return nil, fmt.Errorf("our internal message/explanation: %w", err)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return nil, fmt.Errorf("our internal message/explanation: %w", err)
return nil, fmt.Errorf("failed to get sampling strategies: %w", err)

this can be improved

@yurishkuro
Copy link
Member

fixed in #5336

@yurishkuro yurishkuro closed this Apr 26, 2024
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.

Migrate from grpc.Dial to grpc.NewClient
3 participants