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

Update proto for marshal issue #108

Conversation

rim99
Copy link

@rim99 rim99 commented Nov 4, 2024

Which problem is this PR solving?

Resolves #4150

Description of the changes

  • Make sure time fields works normally in generated go file

How was this change tested?

Checklist

@rim99 rim99 force-pushed the optinal-time-window-when-fetching-trace-by-id branch from 7ba0fde to 5f4ef40 Compare November 4, 2024 13:21
@rim99 rim99 marked this pull request as ready for review November 4, 2024 14:00
@yurishkuro
Copy link
Member

What does "works normally" mean? What wasn't working?

@rim99
Copy link
Author

rim99 commented Nov 4, 2024

@yurishkuro Before this change, this test would fail
https://github.com/rim99/jaeger/blob/d00b4d3888475cb86668849b75246616fe3cb389/cmd/query/app/apiv3/grpc_handler_test.go#L81

It seems, server side cannot receive time values in request, and initialized these as 0001-01-01T00:00:00Z

@yurishkuro
Copy link
Member

yurishkuro commented Nov 5, 2024

Before this change, this test would fail

I don't follow. The test is passing in the main repo, against the official proto. What specifically makes it fail?

@rim99
Copy link
Author

rim99 commented Nov 5, 2024

The test in main repo doesn't test these 2 time fields. https://github.com/jaegertracing/jaeger/blob/main/cmd/query/app/apiv3/grpc_handler_test.go#L92-L94

In this proto file, tested time fields are here: https://github.com/jaegertracing/jaeger-idl/blob/main/proto/api_v3/query_service.proto#L60

I think we can either add more gogoproto extensions like current way, or remove these 2 existing gogoproto extension lines

(gogoproto.stdtime) = true

https://github.com/jaegertracing/jaeger-idl/blob/main/proto/api_v3/query_service.proto#L33-L37

@rim99
Copy link
Author

rim99 commented Nov 10, 2024

@yurishkuro Removed gogoproto lines in proto file. Kind feel this should be the correct direction to move, since gogoproto project is already deprecated. And also to keep align with rest of lines.

@rim99 rim99 force-pushed the optinal-time-window-when-fetching-trace-by-id branch from c06731f to 08204be Compare November 10, 2024 09:14
@yurishkuro
Copy link
Member

Removing gogo from time params is incorrect, it will prevent the generated fields in the struct from being time.Time

@yurishkuro
Copy link
Member

@rim99
Copy link
Author

rim99 commented Nov 18, 2024

Tried with your latest merge. The go test would still fail

Running tool: /usr/bin/go test -timeout 30s -run ^TestGetTraceWithTimeWindow$ github.com/jaegertracing/jaeger/cmd/query/app/apiv3

=== RUN   TestGetTraceWithTimeWindow
    /home/xxx/projects/go/jaeger/cmd/query/app/apiv3/grpc_handler_test.go:140:
                Error Trace:    /home/xxx/projects/go/jaeger/cmd/query/app/apiv3/grpc_handler_test.go:140
                Error:          Received unexpected error:
                                rpc error: code = Internal desc = grpc: error while marshaling: proto: time.Time does not implement Marshal
                Test:           TestGetTraceWithTimeWindow
--- FAIL: TestGetTraceWithTimeWindow (0.00s)
FAIL
FAIL    github.com/jaegertracing/jaeger/cmd/query/app/apiv3     0.008s

@rim99
Copy link
Author

rim99 commented Nov 18, 2024

BTW, why time field type matters here?

As I see the project: gogoproto, https://github.com/gogo/protobuf, it's deprecated. Last commit of this project is 2 years ago. No one maintains it actively.

I think before these time fields of request are widely referred, it's an opportunity to get rid of the deprecated extension. Since these 2 fields are the only things rely on gogproto

@yurishkuro
Copy link
Member

Running tool: /usr/bin/go test -timeout 30s -run ^TestGetTraceWithTimeWindow$ github.com/jaegertracing/jaeger/cmd/query/app/apiv3

Please create a PR that demonstrates the test failure (without any other change)

@rim99
Copy link
Author

rim99 commented Nov 20, 2024

Running tool: /usr/bin/go test -timeout 30s -run ^TestGetTraceWithTimeWindow$ github.com/jaegertracing/jaeger/cmd/query/app/apiv3

Please create a PR that demonstrates the test failure (without any other change)

Please check this draft PR: jaegertracing/jaeger#6228

@rim99
Copy link
Author

rim99 commented Nov 21, 2024

No change

@rim99 rim99 closed this Nov 21, 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.

2 participants