Skip to content

protoc-plugin: Refactoring of intermediate model #418

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

Merged
merged 11 commits into from
Aug 1, 2025

Conversation

Jozott00
Copy link
Collaborator

@Jozott00 Jozott00 commented Jul 31, 2025

Subsystem
Protoc Kotlin Common Plugin

Problem Description
Previously we created a Model directly from the DescriptorProtos.* objects. The problem with this approach is, that handling the semantics of multiple protobuf versions is hard.

Solution
Now, the model is build from the Descriptor.* objects, which provide an abstraction over the raw proto descriptors. This allows us to generate protobuf version agnostic code. Additionally, message resolving is done by the descriptor, reducing the code logic on our side.

This PR also removes the Kotlin JVM target of the protoc plugin and only generates Kotlin Common code.

@Jozott00 Jozott00 self-assigned this Jul 31, 2025
@Jozott00 Jozott00 added the housekeeping Some miscellaneous code base changes, tests, etc. label Jul 31, 2025
@Jozott00 Jozott00 requested a review from Mr3zee July 31, 2025 17:04
Copy link
Collaborator

@Mr3zee Mr3zee left a comment

Choose a reason for hiding this comment

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

Amazing! Please fix the imports (at least as they were before) and bring back the tests

Signed-off-by: Johannes Zottele <[email protected]>
The GRPC services are not getting generated on this branch, so I had to comment them out.

Signed-off-by: Johannes Zottele <[email protected]>
@Jozott00
Copy link
Collaborator Author

Jozott00 commented Aug 1, 2025

@Mr3zee I moved the gRPC.core tests to commonTest and commented them out.

@Mr3zee Mr3zee merged commit 4d7911e into grpc-common Aug 1, 2025
2 of 3 checks passed
@Mr3zee Mr3zee deleted the grpc/protoc-model-refactor branch August 1, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Some miscellaneous code base changes, tests, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants