GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@meltsufin

@meltsufin meltsufin commented Oct 11, 2025

Copy link
Copy Markdown
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:

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@meltsufin
feat(librariangen): add protoc package
42b04c9
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.'
@product-auto-label product-auto-label Bot added the size: l Pull request size is large. label Oct 11, 2025
@meltsufin
meltsufin requested a review from suztomo October 11, 2025 03:21
suztomo
suztomo previously approved these changes Oct 13, 2025
View reviewed changes
suztomo
suztomo reviewed Oct 13, 2025
View reviewed changes
Comment thread internal/librariangen/testdata/generate/librarian/generate-request.json Outdated
@@ -0,0 +1,22 @@
{

@suztomo suztomo Oct 13, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The 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

@meltsufin meltsufin Oct 13, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The 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
@meltsufin
remove generate-request.json
e7c57b5
@meltsufin
meltsufin dismissed suztomo’s stale review via e7c57b5 October 13, 2025 14:49
@codecov

codecov Bot commented Oct 13, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.02%. Comparing base (f32325e) to head (ec1e063).
⚠️ Report is 1 commits behind head on main.

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     
Flag Coverage Δ
librariangen 94.02% <ø> (-3.51%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@meltsufin
Merge branch 'main' into librariangen-protoc
353e7a0
suztomo
suztomo previously approved these changes Oct 13, 2025
View reviewed changes
@meltsufin

meltsufin commented Oct 13, 2025

Copy link
Copy Markdown
Contributor Author

/gemini review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot]
gemini-code-assist Bot reviewed Oct 13, 2025
View reviewed changes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Code Review

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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/librariangen/protoc/protoc.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/librariangen/protoc/protoc_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/librariangen/protoc/protoc_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

blakeli0
blakeli0 reviewed Oct 13, 2025
View reviewed changes
Comment thread internal/librariangen/protoc/protoc.go

@blakeli0 blakeli0 Oct 13, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@meltsufin meltsufin Oct 13, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@meltsufin
chore: respond to GCA findings
7093602
@meltsufin
meltsufin dismissed suztomo’s stale review via 7093602 October 13, 2025 16:04
@meltsufin

meltsufin commented Oct 13, 2025

Copy link
Copy Markdown
Contributor Author

/gemini review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot]
gemini-code-assist Bot reviewed Oct 13, 2025
View reviewed changes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Code Review

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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/librariangen/protoc/protoc.go
Comment on lines +58 to +74
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")
}
}

@gemini-code-assist gemini-code-assist Bot Oct 13, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/librariangen/protoc/protoc_test.go Outdated
tests := []struct {
name string
apiPath string
reqID string

@gemini-code-assist gemini-code-assist Bot Oct 13, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

medium

The reqID field is unused in the test logic. Please remove it from the struct definition. The Go compiler will then flag the now-unused values in the test cases, which should also be removed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@meltsufin
remove unused reqID
ec1e063
@sonarqubecloud

sonarqubecloud Bot commented Oct 13, 2025

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed for 'gapic-generator-java-root'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sonarqubecloud

sonarqubecloud Bot commented Oct 13, 2025

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

suztomo
suztomo approved these changes Oct 13, 2025
View reviewed changes
@meltsufin
meltsufin merged commit 598de06 into main Oct 13, 2025
@meltsufin
meltsufin deleted the librariangen-protoc branch October 13, 2025 17:37
@release-please release-please Bot mentioned this pull request Oct 13, 2025
chore(main): release 2.63.0 #3927
Merged
lqiu96 pushed a commit that referenced this pull request Oct 16, 2025
@release-please
chore(main): release 2.63.0 (#3927)
6473668
🤖 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>
meltsufin added a commit that referenced this pull request Oct 24, 2025
@meltsufin
Revert "feat(librariangen): add protoc package (#3935)"
3d7dd82
This reverts commit 598de06.
@release-please release-please Bot mentioned this pull request Dec 11, 2025
chore(protobuf-4.x-rc): release 2.65.0-rc1 #3999
Merged
lqiu96 pushed a commit that referenced this pull request Feb 12, 2026
@meltsufin @lqiu96
feat(librariangen): add protoc package (#3935)
3d6d268
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.
lqiu96 pushed a commit that referenced this pull request Feb 12, 2026
@release-please @lqiu96
chore(main): release 2.63.0 (#3927)
48954a4
🤖 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>
chingor13 pushed a commit to googleapis/google-cloud-java that referenced this pull request Mar 24, 2026
@release-please
chore(main): release 2.63.0 (#3927)
588b428
🤖 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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

3 more reviewers
@blakeli0 blakeli0 blakeli0 left review comments
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
@suztomo suztomo suztomo approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size: l Pull request size is large.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@meltsufin @suztomo @blakeli0
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.