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 — chore(librariangen): Generate to use languagecontainer.Run by suztomo · Pull Request #3968 · googleapis/sdk-platform-java

This repository was archived by the owner on Oct 29, 2026. It is now read-only.

Conversation

@suztomo

@suztomo suztomo commented Oct 23, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This pull requests changes the argument parsing/validation logic of the generate command to languagecontainer package. The corresponding test cases have been moved to the languagecontainer package as well.

As a result, the main.go and main_test.go became simpler.

Test to confirm the generate function is called

suztomo@suztomo:~/sdk-platform-java/internal/librariangen$ docker build .
...
 => => writing image sha256:0e0d003ebd405958e90efd9fd835bcc80ef811be00716c7b5fc9ba8e64dc5eb9
suztomo@suztomo:/tmp/librarian$ docker run --rm -v /tmp/librarian:/tmp/librarian sha256:0e0d003ebd405958e90efd9fd835bcc80ef811be00716c7b5fc9ba8e64dc5eb9 generate -librarian /tmp/librarian
time=2025-10-23T18:10:34.048Z level=INFO msg="librariangen: invoked" args="[/usr/local/bin/librariangen generate -librarian /tmp/librarian]"
time=2025-10-23T18:10:34.049Z level=ERROR msg="generate failed" error="librariangen: failed to unzip /output/java_gapic.zip: open /output/java_gapic.zip: no such file or directory"

Sorry, something went wrong.

Uh oh!

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

All reactions
@suztomo
chore(librariangen): Generate to use languagecontainer.Run
b68161a
@product-auto-label product-auto-label Bot added the size: l Pull request size is large. label Oct 23, 2025
@gemini-code-assist

gemini-code-assist Bot commented Oct 23, 2025

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @suztomo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the librariangen tool's generate command. The changes introduce a new languagecontainer/generate package to centralize configuration and request parsing, moving this logic out of the main generator file. This architectural shift aims to improve modularity, maintainability, and extensibility by aligning the generation process with a more standardized languagecontainer.Run pattern.

Highlights

  • Refactored Generate Command: The core generate command logic has been refactored to integrate with the new languagecontainer.Run function, promoting a more modular structure.
  • New Configuration Structures: Introduced new generate.Context and generate.Config structs within a dedicated languagecontainer/generate package to encapsulate directory paths and parsed generation requests.
  • Centralized Configuration Handling: Configuration parsing and validation, including reading generate-request.json and validating directory paths, are now centralized within the languagecontainer/generate package.
  • Simplified Generator Logic: The internal/librariangen/generate/generator.go file has been simplified by removing its internal Config struct and Validate method, delegating these responsibilities to the new languagecontainer/generate package.
  • Main CLI Integration: The main.go entry point now leverages languagecontainer.Run to execute the generate command, passing the generate.Generate function as part of the LanguageContainer struct.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

All reactions

Sorry, something went wrong.

Uh oh!

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

suztomo
suztomo commented Oct 23, 2025
View reviewed changes
Comment thread internal/librariangen/generate/generator.go
)

// Config holds the internal librariangen configuration for the generate command.
type Config struct {

@suztomo suztomo Oct 23, 2025

Copy link
Copy Markdown
Member 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 has moved to languagecontainer.Context.

Sorry, something went wrong.

Uh oh!

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

All reactions
@codecov

codecov Bot commented Oct 23, 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 82.05%. Comparing base (452d703) to head (ef288e5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3968      +/-   ##
==========================================
+ Coverage   78.89%   82.05%   +3.16%     
==========================================
  Files           8        9       +1     
  Lines         379      379              
==========================================
+ Hits          299      311      +12     
+ Misses         53       41      -12     
  Partials       27       27              
Flag Coverage Δ
librariangen 82.05% <ø> (+3.16%) ⬆️

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.

suztomo
suztomo commented Oct 23, 2025
View reviewed changes
Comment thread internal/librariangen/generate/generator.go
// readGenerateReq reads generate-request.json from the librarian-tool input directory.
// The request file tells librariangen which library and APIs to generate.
// It is prepared by the Librarian tool and mounted at /librarian.
func readGenerateReq(librarianDir string) (*message.Library, error) {

@suztomo suztomo Oct 23, 2025

Copy link
Copy Markdown
Member 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 has moved to languagecontainer.generate.NewConfig.

Sorry, something went wrong.

Uh oh!

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

All reactions
gemini-code-assist[bot]
gemini-code-assist Bot reviewed Oct 23, 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 the use of languagecontainer.Run for the generate command, refactors the Generate function to use a generate.Config struct, and adds a new generate package with Context and Config types. The changes also include updates to tests and the main entry point to accommodate the new structure. The review focuses on ensuring the correctness of the new implementation, proper error handling, and adherence to good coding practices.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread internal/librariangen/generate/generator.go Resolved

Uh oh!

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

Comment thread internal/librariangen/languagecontainer/languagecontainer.go Resolved

Uh oh!

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

Comment thread internal/librariangen/languagecontainer/languagecontainer.go Resolved

Uh oh!

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

Comment thread internal/librariangen/languagecontainer/languagecontainer_test.go Resolved

Uh oh!

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

Comment thread internal/librariangen/main.go Resolved

Uh oh!

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

@suztomo
Test to validate the nil functions
d7ce698
@suztomo suztomo mentioned this pull request Oct 23, 2025
chore(librariangen): languagecontainer package to parse release-init request #3965
Merged
@suztomo
suztomo marked this pull request as draft October 23, 2025 16:55
suztomo added 2 commits October 23, 2025 17:30
@suztomo
Validation moved to languagecontainer
1160ca4
@suztomo
Do not pass the command itself in the argument.
d159ee2
suztomo
suztomo commented Oct 23, 2025
View reviewed changes
Comment thread internal/librariangen/main.go
}

// handleGenerate parses flags for the generate command and calls the generator.
func handleGenerate(ctx context.Context, args []string) error {

@suztomo suztomo Oct 23, 2025

Copy link
Copy Markdown
Member 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 moved to languagecontainer package.

Sorry, something went wrong.

Uh oh!

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

All reactions
@suztomo
suztomo marked this pull request as ready for review October 23, 2025 18:11
meltsufin
meltsufin suggested changes Oct 23, 2025
View reviewed changes

@meltsufin meltsufin 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.

This is conflicting a lot with #3967. Can you please make the change in two separate PRs.

  1. changes to main.go
  2. changes to generator.go

Sorry, something went wrong.

Uh oh!

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

All reactions
@suztomo

suztomo commented Oct 23, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

@meltsufin I couldn't think of a good way to split it. main.go starts using languagecontainer.Run which pass new languagecontainer.generate.Config to the Generate command (defined in generator.go). The changes are related. How about merging your pull request first and I deal with the conflicts?

meltsufin reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@suztomo
Merge remote-tracking branch 'upstream/main' into languagecontainer_g…
ef288e5
…enerate
@suztomo

suztomo commented Oct 23, 2025

Copy link
Copy Markdown
Member Author

@meltsufin I merged the main branch. PTAL.

All reactions

Sorry, something went wrong.

Uh oh!

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

@suztomo
suztomo requested a review from meltsufin October 23, 2025 21:32
meltsufin
meltsufin approved these changes Oct 24, 2025
View reviewed changes
@suztomo
suztomo merged commit 0a1bbea into main Oct 24, 2025
@suztomo
suztomo deleted the languagecontainer_generate branch October 24, 2025 03:58
meltsufin added a commit that referenced this pull request Oct 24, 2025
@meltsufin
Revert "chore(librariangen): Generate to use languagecontainer.Run (#…
5101a26
…3968)"

This reverts commit 0a1bbea.
lqiu96 pushed a commit that referenced this pull request Feb 12, 2026
@suztomo @lqiu96
chore(librariangen): Generate to use languagecontainer.Run (#3968)
d75f128
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
@meltsufin meltsufin meltsufin 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.

2 participants

@suztomo @meltsufin
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.