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 health.proto to add objc prefix #166

Merged
merged 3 commits into from
Jan 23, 2025
Merged

Conversation

charlottetan
Copy link
Contributor

No description provided.

Copy link

linux-foundation-easycla bot commented Jan 18, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@markdroth markdroth requested a review from sampajano January 18, 2025 00:37
@markdroth markdroth self-assigned this Jan 18, 2025
Copy link

@sampajano sampajano left a comment

Choose a reason for hiding this comment

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

@markdroth thanks for cc'ing!

LGTM. But @HannahShiSFB Could you also help take a look please? Thanks!

Copy link

@sampajano sampajano left a comment

Choose a reason for hiding this comment

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

Thanks for the change! I'll approve first :)

@HannahShiSFB if there's any concerns please let me know afterwards :)

@HannahShiSFB
Copy link

I'm not familiar with it, would you clarify why the change and what will be affected?

@charlottetan
Copy link
Contributor Author

charlottetan commented Jan 18, 2025 via email

@markdroth
Copy link
Member

I assume that this change affects the generated code in objc. I just want to make sure this isn't a breaking change and isn't going to cause any problems later. @HannahShiSFB or @sampajano, please confirm that you've verified that that is the case.

@charlottetan
Copy link
Contributor Author

If it helps, I need this to add the objc_grpc_library and objc_proto_library, so that I can send a health check request in my ios test when it starts up

@sampajano
Copy link

@markdroth Thanks for checking! Yes indeed this would affect generated code. And if there are existing users on this proto they'd need to update the callsites AFAIU.

@charlottetan Could you explain what error you'd see without this change? I'm wondering if this is the only / best way to address your issue, and whether there are solutions that might not involve breaking existing callers.. @HannahShiSFB FYI.

@charlottetan
Copy link
Contributor Author

Thanks @sampajano, the error I'm getting is:
error: 'third_party/grpc_proto/grpc/health/v1/health.proto' does not have a required 'option objc_class_prefix'. Target //third_party/grpc_proto:health_objc_grpc failed to build

I get this when I try to do:
blaze build //third_party/grpc_proto:health_objc_grpc

@markdroth
Copy link
Member

If the objc codegen won't work at all without this option, then it seems like it can't break anyone to add it.

Are we sure that this option is required for objc code generation even in OSS?

@charlottetan
Copy link
Contributor Author

It seems that way, I'm happy to validate it a different way or try something else but need help figuring out how

@markdroth
Copy link
Member

My last question was aimed at @sampajano, who is our expert on the objc ecosystem. :)

@ejona86
Copy link
Member

ejona86 commented Jan 22, 2025

The namespace should really be more precise than gRPC. We assume the proto package is the namespace so are free to reuse message names across packages. At the very least, if we had a v2 proto, we'd want to add 2 or v2 to the namespace, and GRPCV2 has a vastly different meaning than grpc.health.v2. (Looking at the googleapis repo, I do see that objc namespaces are typically extremely abbreviated. But they still handle v2.)

@charlottetan
Copy link
Contributor Author

I updated it to GRPCV1, also happy to change it if we prefer a different prefix

@sampajano
Copy link

If the objc codegen won't work at all without this option, then it seems like it can't break anyone to add it.

Are we sure that this option is required for objc code generation even in OSS?

@markdroth Yeah i think you're right.. I believe objc code won't be generated at all without objc_class_prefix being specified.. So i think we won't break any "existing" users :)

The namespace should really be more precise than gRPC. We assume the proto package is the namespace so are free to reuse message names across packages. At the very least, if we had a v2 proto, we'd want to add 2 or v2 to the namespace, and GRPCV2 has a vastly different meaning than grpc.health.v2. (Looking at the googleapis repo, I do see that objc namespaces are typically extremely abbreviated. But they still handle v2.)

@ejona86 Thanks for bringing this up!

It does look like all the other language namespaces are more specific than GRPCV1 :)

Maybe we should name this one GrpcHealthV1 instead?

@charlottetan How does that sound to you?

@charlottetan
Copy link
Contributor Author

charlottetan commented Jan 23, 2025

SGTM, thanks! Updated to GrpcHealthV1

@sampajano
Copy link

@charlottetan Thanks for the QUICK update! :) LGTM :)

@charlottetan
Copy link
Contributor Author

Thanks! I don't have merge permissions, I'll have to rely on someone else to merge it in.

@markdroth markdroth merged commit 483f11e into grpc:master Jan 23, 2025
4 checks passed
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.

5 participants