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

Ability to generate gRPC descriptor set #36930

Merged
merged 1 commit into from
Nov 12, 2023

Conversation

edeandrea
Copy link
Contributor

Ability to generate gRPC descriptor sets.

@cescoffier please take a look. In the code gen I needed a way to get access to the project root directory so that the user could specify an output directory relative to that. I modified the Maven & Gradle plugins to provide that info into the generation. I also added a bunch of tests to both plugins.

Fixes #36897

@quarkus-bot quarkus-bot bot added area/core area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/documentation area/gradle Gradle area/grpc gRPC area/maven labels Nov 7, 2023
@quarkus-bot quarkus-bot bot added this to To do in Quarkus Documentation Nov 7, 2023
@edeandrea
Copy link
Contributor Author

The majority of the 50 changed files are new integration tests that I added.

@edeandrea edeandrea force-pushed the grpc-descriptor-sets branch 2 times, most recently from f1df49b to 1fb9e23 Compare November 7, 2023 21:13
Copy link

github-actions bot commented Nov 7, 2023

🙈 The PR is closed and the preview is expired.

@quarkus-bot

This comment has been minimized.

Copy link
Member

@cescoffier cescoffier left a comment

Choose a reason for hiding this comment

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

There is a * import to fix. The rest looks good. I've asked Aleš and Alexei to have a look for the gRPPC protoc part and maven/gradle part.

Quarkus Documentation automation moved this from To do to Reviewer approved Nov 8, 2023
@quarkus-bot

This comment has been minimized.

@quarkus-bot
Copy link

quarkus-bot bot commented Nov 10, 2023

Failing Jobs - Building 43b7e08

Status Name Step Failures Logs Raw logs Build scan
✔️ Gradle Tests - JDK 11
Gradle Tests - JDK 11 Windows Build Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ Gradle Tests - JDK 11 Windows #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.CustomManifestArgumentsTest.shouldContainsSpecificManifestProperty line 37 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual not to be null

@edeandrea
Copy link
Contributor Author

@gsmet I'm not sure whats up with that Gradle integration test. I see it failing on other PRs as well, so I'm not sure I did anything here that would cause that failure.

@cescoffier cescoffier merged commit 15c8ba8 into quarkusio:main Nov 12, 2023
52 of 53 checks passed
Quarkus Documentation automation moved this from Reviewer approved to Done Nov 12, 2023
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Nov 12, 2023
@quarkus-bot quarkus-bot bot added this to the 3.6 - main milestone Nov 12, 2023
@johannesctrl
Copy link

Hi, I appreciate the new feature of generating the descriptor file a lot because I would like to use this for WireMock. However, I am not able to generate it. While ...

  • using Maven
  • using Quarkus version 3.6.0.CR1
  • adding quarkus.generate-code.grpc.descriptor-set.generate=true to my application.properties
  • defining the goals "build", "generate-code" and "generate-code-tests"

I am getting the warning that the key cannot be found:
"[WARNING] [io.quarkus.config] Unrecognized configuration key "quarkus.generate-code.grpc.descriptor-set.generate" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo"

@edeandrea
Copy link
Contributor Author

Hi @johannesctrl have you tried it with 3.6.0 (the released version)?

Using it with Wiremock is exactly why I did this PR in the first place :)

@edeandrea
Copy link
Contributor Author

@johannesctrl I just added that to the grpc-locations project within the Quarkus superheroes and I see that it was generated:

image

You can customize the name & location of the file by using the quarkus.generate-code.grpc.descriptor-set.output-dir and quarkus.generate-code.grpc.descriptor-set.name properties:

quarkus:
  generate-code:
    grpc:
      descriptor-set:
        generate: true
        output-dir: .
        name: locationservice-v1.dsc

image

@johannesctrl
Copy link

Thank you so much for checking! :) Yes, I already tried the 3.6.0 version and also using the name and location properties. Maybe it's something else in my settings ... I'm gonna check all my settings again, I guess 😄

@edeandrea
Copy link
Contributor Author

edeandrea commented Dec 5, 2023

You can look in the the grpc-locations project within the Quarkus superheroes (pom.xml, etc) to see how it was configured.

All I did was clone that and run

./mvnw clean package -DskipTests -Dquarkus.generate-code.grpc.descriptor-set.generate=true -Dquarkus.generate-code.grpc.descriptor-set.output-dir=. -Dquarkus.generate-code.grpc.descriptor-set.name=locationservice-v1.dsc

You could also add the properties to src/main/resources/application.yml (this project uses yaml config).

@edeandrea edeandrea deleted the grpc-descriptor-sets branch December 5, 2023 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/documentation area/gradle Gradle area/grpc gRPC area/maven kind/enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

Unable to generate gRPC descriptor set
5 participants