GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: update generated samples to executable format by eaball35 · Pull Request #874 · googleapis/sdk-platform-java
This repository was archived by the owner on Oct 29, 2026. It is now read-only.
Conversation
|
Codecov Report
@@ Coverage Diff @@ ## main #874 +/- ## ========================================== + Coverage 87.84% 87.93% +0.08% ========================================== Files 153 156 +3 Lines 15966 16068 +102 Branches 1155 1155 ========================================== + Hits 14025 14129 +104 Misses 1601 1601 + Partials 340 338 -2
Continue to review full report at Codecov.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM on how the resulting samples are looking, this is great.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@amanda-tarafa @eaball35
I see that this only updates inline samples, and the single-file samples as described in the design are not part of this PR.
I'm a little surprised to see essentially the whole executable sample file with imports and a wrapping application class inline. Was that the intent of the original design all along? Do you feel like this might be adding too much boilerplate repetitive code to the javadoc samples?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@meltsufin I'm starting a thread internally to discuss more in-depth, but basically, these aspects are up for decision for each language, as they know their community better. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just went over the top part of the PR. Will take another look later.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| this.sampleVariableAssignments = sampleVariableAssignments; | ||
| this.sampleBody = sampleBody; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm: is there any chance that the input List instances may be modified?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return sampleName; | ||
| } | ||
|
|
||
| public List<AssignmentExpr> getSampleVariableAssignments() { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Likewise, any chance that the output List object may be modified?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| JavaWriterVisitor visitor = new JavaWriterVisitor(); | ||
| classDefinition.accept(visitor); | ||
| // Escape character "@" in the markdown code block <pre>{@code...} tags. | ||
| return visitor.write().replaceAll("@", "{@literal @}"); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Since write(List<Statement>) does this too, will this end up double-escaping @? If not, I actually think this is unnecessary? And should we format code here instead of write(List<Statement>)?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| public static MethodInvocationExpr systemOutPrint(String content) { | ||
| return composeSystemOutPrint(ValueExpr.withValue(StringObjectValue.withValue(content))); | ||
| } | ||
|
|
||
| public static MethodInvocationExpr systemOutPrint(VariableExpr variableExpr) { | ||
| return composeSystemOutPrint(variableExpr.toBuilder().setIsDecl(false).build()); | ||
| } | ||
|
|
||
| static MethodInvocationExpr composeSystemOutPrint(Expr content) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
These method are not called by non-test code. Let's remove them.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Agreed, however I created them because eventually I will definitely want to use them in the samples to handle the responses. I was just getting a little ahead of myself implementing these now.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
That's actually what I suspected. Let's add them in the future when they are needed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Forking as new branch as we decided to not make inline snippets "executable" format but instead link to full example if users wants it - #882 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
chore: pin versions of certifi and google-resumable-media Source-Link: googleapis/synthtool@09c4fcd Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:264c6d5da60ff1684fbdd2b268d6a3ffca2038246e0948a06f15ca0c3cf28ce8 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…874) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.protobuf:protobuf-bom](https://developers.google.com/protocol-buffers/) ([source](https://togithub.com/protocolbuffers/protobuf)) | `3.21.2` -> `3.21.3` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>protocolbuffers/protobuf</summary> ### [`v3.21.3`](https://togithub.com/protocolbuffers/protobuf/compare/v3.21.2...v3.21.3) [Compare Source](https://togithub.com/protocolbuffers/protobuf/compare/v3.21.2...v3.21.3) </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:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMjIuMSIsInVwZGF0ZWRJblZlciI6IjMyLjEyMi4xIn0=-->
🤖 I have created a release *beep* *boop* --- ## [2.8.3](googleapis/java-core@v2.8.2...v2.8.3) (2022-07-26) ### Dependencies * update dependency com.google.api-client:google-api-client-bom to v2 ([#868](googleapis/java-core#868)) ([fe7991d](googleapis/java-core@fe7991d)) * update dependency com.google.api:gax-bom to v2.18.4 ([#864](googleapis/java-core#864)) ([d4a8501](googleapis/java-core@d4a8501)) * update dependency com.google.api:gax-bom to v2.18.5 ([#876](googleapis/java-core#876)) ([e2c0c13](googleapis/java-core@e2c0c13)) * update dependency com.google.api.grpc:proto-google-common-protos to v2.9.2 ([#870](googleapis/java-core#870)) ([adf5af4](googleapis/java-core@adf5af4)) * update dependency com.google.api.grpc:proto-google-iam-v1 to v1.5.2 ([#865](googleapis/java-core#865)) ([5dad1ea](googleapis/java-core@5dad1ea)) * update dependency com.google.auth:google-auth-library-bom to v1.8.1 ([#856](googleapis/java-core#856)) ([bb58609](googleapis/java-core@bb58609)) * update dependency com.google.http-client:google-http-client-bom to v1.42.2 ([#871](googleapis/java-core#871)) ([341b04e](googleapis/java-core@341b04e)) * update dependency com.google.protobuf:protobuf-bom to v3.21.3 ([#874](googleapis/java-core#874)) ([efe8c28](googleapis/java-core@efe8c28)) * update dependency com.google.protobuf:protobuf-bom to v3.21.4 ([#877](googleapis/java-core#877)) ([25bea6c](googleapis/java-core@25bea6c)) * update dependency io.grpc:grpc-bom to v1.48.0 ([#873](googleapis/java-core#873)) ([8bfee63](googleapis/java-core@8bfee63)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.