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(librariangen): add protoc package by meltsufin · Pull Request #3935 · googleapis/sdk-platform-java
This repository was archived by the owner on Oct 29, 2026. It is now read-only.
Conversation
Contributor
This will be used for constructing the protoc command for generating Java GAPICs. Based on https://github.com/googleapis/google-cloud-go/tree/main/internal/librariangen/protoc with the following important changes:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsThis will be used for constructing the protoc command for generating Java GAPICs. Based on https://github.com/googleapis/google-cloud-go/tree/main/internal/librariangen/protoc with the following important changes: * The `Build` function in `protoc.go` is updated to construct the `protoc` command with the correct arguments for Java GAPIC generation. * The tests in `protoc_test.go` are updated to reflect the changes in `protoc.go`. * The `gapicImportPath` is removed from the test configuration, as it is not relevant for Java.'
suztomo
previously approved these changes
suztomo
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this used?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. It will be used in the next PR. I'll remove it.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #3935 +/- ## ========================================== - Coverage 97.53% 94.02% -3.51% ========================================== Files 3 4 +1 Lines 81 134 +53 ========================================== + Hits 79 126 +47 - Misses 2 6 +4 - Partials 0 2 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
/gemini review |
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.
This pull request introduces a new protoc package for constructing protoc commands to generate Java GAPICs. The implementation is clean and well-tested. I've identified a couple of areas for improvement related to unused code, which will enhance clarity and maintainability. My suggestions involve removing unused function parameters and test struct fields, along with updating the corresponding call sites.
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.
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.
Is this rewriting part of generate_library.sh in go? If yes, there are some special cases need to be handled. cc: @JoeWang1127
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.
This is just scaffolding for now. Yes, we'll be rewriting the needed logic in Go.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
/gemini review |
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.
This pull request introduces a new protoc package for constructing protoc commands, specifically for Java GAPIC generation. The changes include the core logic in protoc.go, comprehensive tests in protoc_test.go, and necessary test data. The code is well-structured and the approach of using a ConfigProvider interface is good for decoupling. I have a couple of suggestions to improve code clarity and maintainability.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if config.HasGAPIC() { | ||
| if config.ServiceYAML() != "" { | ||
| gapicOpts = append(gapicOpts, fmt.Sprintf("api-service-config=%s", filepath.Join(apiServiceDir, config.ServiceYAML()))) | ||
| } | ||
| if config.GapicYAML() != "" { | ||
| gapicOpts = append(gapicOpts, fmt.Sprintf("gapic-config=%s", filepath.Join(apiServiceDir, config.GapicYAML()))) | ||
| } | ||
| if config.GRPCServiceConfig() != "" { | ||
| gapicOpts = append(gapicOpts, fmt.Sprintf("grpc-service-config=%s", filepath.Join(apiServiceDir, config.GRPCServiceConfig()))) | ||
| } | ||
| if config.Transport() != "" { | ||
| gapicOpts = append(gapicOpts, fmt.Sprintf("transport=%s", config.Transport())) | ||
| } | ||
| if config.HasRESTNumericEnums() { | ||
| gapicOpts = append(gapicOpts, "rest-numeric-enums") | ||
| } | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This block has some repetition when constructing gapicOpts. You can refactor this to be more data-driven for the file-based options, which improves readability and makes it easier to add more options in the future.
| if config.HasGAPIC() { | |
| if config.ServiceYAML() != "" { | |
| gapicOpts = append(gapicOpts, fmt.Sprintf("api-service-config=%s", filepath.Join(apiServiceDir, config.ServiceYAML()))) | |
| } | |
| if config.GapicYAML() != "" { | |
| gapicOpts = append(gapicOpts, fmt.Sprintf("gapic-config=%s", filepath.Join(apiServiceDir, config.GapicYAML()))) | |
| } | |
| if config.GRPCServiceConfig() != "" { | |
| gapicOpts = append(gapicOpts, fmt.Sprintf("grpc-service-config=%s", filepath.Join(apiServiceDir, config.GRPCServiceConfig()))) | |
| } | |
| if config.Transport() != "" { | |
| gapicOpts = append(gapicOpts, fmt.Sprintf("transport=%s", config.Transport())) | |
| } | |
| if config.HasRESTNumericEnums() { | |
| gapicOpts = append(gapicOpts, "rest-numeric-enums") | |
| } | |
| } | |
| if config.HasGAPIC() { | |
| fileOpts := []struct{ key, val string }{ | |
| {"api-service-config", config.ServiceYAML()}, | |
| {"gapic-config", config.GapicYAML()}, | |
| {"grpc-service-config", config.GRPCServiceConfig()}, | |
| } | |
| for _, opt := range fileOpts { | |
| if opt.val != "" { | |
| gapicOpts = append(gapicOpts, fmt.Sprintf("%s=%s", opt.key, filepath.Join(apiServiceDir, opt.val))) | |
| } | |
| } | |
| if config.Transport() != "" { | |
| gapicOpts = append(gapicOpts, fmt.Sprintf("transport=%s", config.Transport())) | |
| } | |
| if config.HasRESTNumericEnums() { | |
| gapicOpts = append(gapicOpts, "rest-numeric-enums") | |
| } | |
| } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| tests := []struct { | ||
| name string | ||
| apiPath string | ||
| reqID string |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
🤖 I have created a release *beep* *boop* --- <details><summary>2.63.0</summary> ## [2.63.0](v2.62.3...v2.63.0) (2025-10-16) ### Features * **librariangen:** add bazel package ([#3940](#3940)) ([feabef3](feabef3)) * **librariangen:** add execv package ([#3932](#3932)) ([f6b0b47](f6b0b47)) * **librariangen:** add protoc package ([#3935](#3935)) ([598de06](598de06)) * **librariangen:** add request package ([#3933](#3933)) ([fe44aed](fe44aed)) * **librariangen:** scaffold Java language container for Librarian ([#3926](#3926)) ([29d188d](29d188d)) ### Dependencies * Bump errorprone-annotations to v2.42.0 ([8d6c1f9](8d6c1f9)) * Bump guava to v33.5.0 ([8d6c1f9](8d6c1f9)) * Bump j2objc-annotations to v3.1 ([8d6c1f9](8d6c1f9)) * update google auth library dependencies to v1.40.0 ([#3945](#3945)) ([1d74663](1d74663)) * Upgrade Google Http Java Client to v2.0.2 ([#3946](#3946)) ([7fb4f15](7fb4f15)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
This reverts commit 598de06.
This will be used for constructing the protoc command for generating Java GAPICs. Based on https://github.com/googleapis/google-cloud-go/tree/main/internal/librariangen/protoc with the following important changes: * The `Build` function in `protoc.go` is updated to construct the `protoc` command with the correct arguments for Java GAPIC generation. * The tests in `protoc_test.go` are updated to reflect the changes in `protoc.go`. * The `gapicImportPath` is removed from the test configuration, as it is not relevant for Java.' * The testdata is included with modifications for Java.
🤖 I have created a release *beep* *boop* --- <details><summary>2.63.0</summary> ## [2.63.0](v2.62.3...v2.63.0) (2025-10-16) ### Features * **librariangen:** add bazel package ([#3940](#3940)) ([feabef3](feabef3)) * **librariangen:** add execv package ([#3932](#3932)) ([f6b0b47](f6b0b47)) * **librariangen:** add protoc package ([#3935](#3935)) ([598de06](598de06)) * **librariangen:** add request package ([#3933](#3933)) ([fe44aed](fe44aed)) * **librariangen:** scaffold Java language container for Librarian ([#3926](#3926)) ([29d188d](29d188d)) ### Dependencies * Bump errorprone-annotations to v2.42.0 ([8d6c1f9](8d6c1f9)) * Bump guava to v33.5.0 ([8d6c1f9](8d6c1f9)) * Bump j2objc-annotations to v3.1 ([8d6c1f9](8d6c1f9)) * update google auth library dependencies to v1.40.0 ([#3945](#3945)) ([1d74663](1d74663)) * Upgrade Google Http Java Client to v2.0.2 ([#3946](#3946)) ([7fb4f15](7fb4f15)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- <details><summary>2.63.0</summary> ## [2.63.0](googleapis/sdk-platform-java@v2.62.3...v2.63.0) (2025-10-16) ### Features * **librariangen:** add bazel package ([#3940](googleapis/sdk-platform-java#3940)) ([d6bd0e0](googleapis/sdk-platform-java@d6bd0e0)) * **librariangen:** add execv package ([#3932](googleapis/sdk-platform-java#3932)) ([7fc08a5](googleapis/sdk-platform-java@7fc08a5)) * **librariangen:** add protoc package ([#3935](googleapis/sdk-platform-java#3935)) ([c3f7b9f](googleapis/sdk-platform-java@c3f7b9f)) * **librariangen:** add request package ([#3933](googleapis/sdk-platform-java#3933)) ([c478a98](googleapis/sdk-platform-java@c478a98)) * **librariangen:** scaffold Java language container for Librarian ([#3926](googleapis/sdk-platform-java#3926)) ([aec74aa](googleapis/sdk-platform-java@aec74aa)) ### Dependencies * Bump errorprone-annotations to v2.42.0 ([4fa48a2](googleapis/sdk-platform-java@4fa48a2)) * Bump guava to v33.5.0 ([4fa48a2](googleapis/sdk-platform-java@4fa48a2)) * Bump j2objc-annotations to v3.1 ([4fa48a2](googleapis/sdk-platform-java@4fa48a2)) * update google auth library dependencies to v1.40.0 ([#3945](googleapis/sdk-platform-java#3945)) ([4b2c98e](googleapis/sdk-platform-java@4b2c98e)) * Upgrade Google Http Java Client to v2.0.2 ([#3946](googleapis/sdk-platform-java#3946)) ([89d518c](googleapis/sdk-platform-java@89d518c)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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.