Skip to content

Conversation

Jozott00
Copy link
Collaborator

Subsystem
gRPC

Problem Description
Currently the generated gRPC service name in the descriptor is just the simple names of the Kotlin interface. However, in gRPC a service name is structured as <proto-package>.<name>.
Additionally, the stub generator had no information about the proto-package set in the proto file, which is required to generate the correct service name.

Solution
This PR adds the protoPackage argument to the @Grpc annotation. The service interface generator will set it if the package property is set in the proto file.
This argument is then used by the service stub generator to obtain the proto package name.
To test this, the JavaPackageOptionTest was added, as well as an additional service interface in the compiler plugin tests.

Additionally, this PR moves the CoreClientTest into commonTest and provides service implementations that are required to run the tests. While it is not yet possible to automatically execute those tests, it got easier.

@Jozott00 Jozott00 requested a review from Mr3zee August 20, 2025 16:09
@Jozott00 Jozott00 self-assigned this Aug 20, 2025
@Jozott00 Jozott00 added the bug Something isn't working label Aug 20, 2025
@Jozott00 Jozott00 force-pushed the grpc/fix-service-identifier branch from 51f1ed4 to a610c49 Compare August 20, 2025 16:11
Copy link
Member

@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.

Thanks for fixing the issue!
Please address the comments and check that ./gradlew krpc:krpc-test:allTests works

Signed-off-by: Johannes Zottele <official@johannes-zottele.at>
Signed-off-by: Johannes Zottele <official@johannes-zottele.at>
…ackage` option for the service name.

Signed-off-by: Johannes Zottele <official@johannes-zottele.at>
Signed-off-by: Johannes Zottele <official@johannes-zottele.at>
Signed-off-by: Johannes Zottele <official@johannes-zottele.at>
@Jozott00 Jozott00 force-pushed the grpc/fix-service-identifier branch from d6b38c0 to 45edf31 Compare August 21, 2025 10:07
@Jozott00 Jozott00 requested a review from Mr3zee August 21, 2025 10:24
Signed-off-by: Johannes Zottele <official@johannes-zottele.at>
@Jozott00 Jozott00 requested a review from Mr3zee August 21, 2025 10:32
@Jozott00 Jozott00 merged commit 8ac469e into grpc-common Aug 21, 2025
4 of 5 checks passed
@Jozott00 Jozott00 deleted the grpc/fix-service-identifier branch September 2, 2025 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants