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

Stop marshalling any.Any types unnecessarily. #577

Merged
merged 1 commit into from
Jun 22, 2018

Conversation

johanbrandhorst
Copy link
Collaborator

Fixes #576.

@johanbrandhorst
Copy link
Collaborator Author

@achew22 this should be a harmless change, could you take a quick look please?

@achew22
Copy link
Collaborator

achew22 commented Mar 28, 2018

My understanding of the proto registry is unfortunately lacking WRT this topic. My expectation is that the proto on the wire wouldn't contain enough information to serialize it down to json. Does the any proto contain a field => name mapping in the wire format for it or something?

Could you also add a test to ensure this behavior doesn't regress?

@johanbrandhorst
Copy link
Collaborator Author

This changes just removes a no-op that was there from when this was first added, probably because the original implementation was confused as to whether this would be necessary or not. This kind of marshalling is already done in several other places:

buf, merr := marshaler.Marshal(s.Proto())

grpcDetails = s.Proto().GetDetails()

I will look at adding some tests.

@johanbrandhorst
Copy link
Collaborator Author

Added a test for marshalling with details.

@tmc
Copy link
Collaborator

tmc commented Apr 24, 2018

@johanbrandhorst thanks for this, can you rebase and resolve that test conflict?

@johanbrandhorst
Copy link
Collaborator Author

@tmc rebase completed!

@johanbrandhorst
Copy link
Collaborator Author

@tmc Is that test failure due to my change? It seems unrelated.

@tmc
Copy link
Collaborator

tmc commented Jun 19, 2018

Sorry I missed your comment. The failure does appear to have been unrelated. Please resolve the conflicts here and let's get this in!

@johanbrandhorst
Copy link
Collaborator Author

Rebased :)

@johanbrandhorst
Copy link
Collaborator Author

johanbrandhorst commented Jun 19, 2018

Think I've hit a flaky test, could I have a rerun please? @tmc

@achew22
Copy link
Collaborator

achew22 commented Jun 19, 2018

Retriggered

@johanbrandhorst
Copy link
Collaborator Author

Looking good on my end, happy to merge?

@johanbrandhorst
Copy link
Collaborator Author

Not entirely sure why it's required me to regenerate the protofiles though 🤔

Copy link
Collaborator

@tmc tmc left a comment

Choose a reason for hiding this comment

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

LGTM

@tmc
Copy link
Collaborator

tmc commented Jun 19, 2018

To add ,proto3

@tmc
Copy link
Collaborator

tmc commented Jun 19, 2018

@achew22 I'll let you complete review and merge

@achew22
Copy link
Collaborator

achew22 commented Jun 22, 2018

LGTM. Looks like there is a merge conflict. It isn't trivial to do from the web interface and I'm at work, but @tmc feel free to merge if you can get it to have no conflicts

@johanbrandhorst
Copy link
Collaborator Author

Curses! I'll fix it.

Fixes grpc-ecosystem#576. Adds a test case for marshalling of details as well.
@johanbrandhorst
Copy link
Collaborator Author

Alright that should've done it. I had to pull and push over HTTPS as this airport WiFi must be blocking port 22 🤔.

@codecov-io
Copy link

Codecov Report

Merging #577 into master will increase coverage by 1.51%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #577      +/-   ##
==========================================
+ Coverage   56.43%   57.95%   +1.51%     
==========================================
  Files          30       30              
  Lines        3005     2918      -87     
==========================================
- Hits         1696     1691       -5     
+ Misses       1145     1064      -81     
+ Partials      164      163       -1
Impacted Files Coverage Δ
runtime/errors.go 45.07% <100%> (+7.4%) ⬆️
runtime/marshal_json.go 66.66% <0%> (-16.67%) ⬇️
protoc-gen-swagger/genswagger/template.go 42.1% <0%> (+3.58%) ⬆️

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 9b9677c...1665baf. Read the comment docs.

@achew22 achew22 merged commit ffaaaf2 into grpc-ecosystem:master Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants