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

feat: Add add autogenerated javadoc sample for selecting REST transport over gRPC #983

Merged
merged 2 commits into from Apr 21, 2022

Conversation

vam-google
Copy link
Contributor

This is for grpc+rest clients.

Also add proper grpc+rest unit tests which were missing.

…rt over gRPC

This is for grpc+rest clients.

Also add proper grpc+rest unit tests which were missing.
@vam-google vam-google requested review from a team as code owners April 20, 2022 05:39
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Apr 20, 2022
@vam-google
Copy link
Contributor Author

@blakeli0 PTAL

@@ -112,7 +114,10 @@ public static List<CommentStatement> createClassHeaderComments(
Service service,
String classMethodSampleCode,
String credentialsSampleCode,
String endpointSampleCode) {
String endpointSampleCode,
String transportStample,
Copy link
Contributor

Choose a reason for hiding this comment

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

typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Fixed

@sonarcloud
Copy link

sonarcloud bot commented Apr 21, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@vam-google vam-google merged commit 051713d into googleapis:main Apr 21, 2022
@@ -208,7 +208,10 @@ private static List<CommentStatement> createClassHeaderComments(
service,
SampleCodeWriter.writeInlineSample(classMethodSampleCode.body()),
SampleCodeWriter.writeInlineSample(credentialsSampleCode.body()),
SampleCodeWriter.writeInlineSample(endpointSampleCode.body()));
SampleCodeWriter.writeInlineSample(endpointSampleCode.body()),
Copy link
Contributor

Choose a reason for hiding this comment

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

do you mean to include these null args?


return ServiceClientCommentComposer.createClassHeaderComments(
service,
SampleCodeWriter.writeInlineSample(classMethodSampleCode.body()),
Copy link
Contributor

Choose a reason for hiding this comment

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

You could also combine all the different sample.body into one List and pass the whole list to SampleCodeWriter.writeInlineSample()

Utils.saveCodegenToFile(this.getClass(), "GrpcEchoCallableFactory.golden", visitor.write());
Path goldenFilePath =
Paths.get(Utils.getGoldenDir(this.getClass()), "GrpcEchoCallableFactory.golden");
Assert.assertCodeEquals(goldenFilePath, visitor.write());
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider checking the clazz.samples() as well. See similar grpc tests. See Assert.assertGoldenSamples and assertEmptySamples. Even if there aren't any samples, I think it's good to be clear in the tests which classes generate samples and which don't.

suztomo pushed a commit that referenced this pull request Dec 16, 2022
…rt over gRPC (#983)

This is for grpc+rest clients.

Also add proper grpc+rest unit tests which were missing.
suztomo pushed a commit that referenced this pull request Mar 21, 2023
….12.1 (#983)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.auth:google-auth-library-bom](https://togithub.com/googleapis/google-auth-library-java) | `1.12.0` -> `1.12.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-bom/1.12.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-bom/1.12.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-bom/1.12.1/compatibility-slim/1.12.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-bom/1.12.1/confidence-slim/1.12.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/google-auth-library-java</summary>

### [`v1.12.1`](https://togithub.com/googleapis/google-auth-library-java/blob/HEAD/CHANGELOG.md#&#8203;1121-httpsgithubcomgoogleapisgoogle-auth-library-javacomparev1120v1121-2022-10-18)

##### Bug Fixes

-   Resolve race condition reported in [#&#8203;692](https://togithub.com/googleapis/google-auth-library-java/issues/692) ([#&#8203;1031](https://togithub.com/googleapis/google-auth-library-java/issues/1031)) ([87a6606](https://togithub.com/googleapis/google-auth-library-java/commit/87a66067dff49d68f5b01cfe4c3f755fbf6b44fb))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-core).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMzguNCIsInVwZGF0ZWRJblZlciI6IjMyLjI0MC41In0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants