Skip to content

chore(librariangen): update snippet metadata in both directories#14692

Open
JoeWang1127 wants to merge 8 commits into
googleapis:mainfrom
JoeWang1127:chore/update-snippets
Open

chore(librariangen): update snippet metadata in both directories#14692
JoeWang1127 wants to merge 8 commits into
googleapis:mainfrom
JoeWang1127:chore/update-snippets

Conversation

@JoeWang1127
Copy link
Copy Markdown
Contributor

@JoeWang1127 JoeWang1127 commented Jun 2, 2026

Updates the UpdateSnippetsMetadata logic in the legacylibrarian Go container to support and update snippet metadata files in both:

  • the shared directory (internal/generated/snippets/<moduleName>)
  • the module's examples directory (<moduleName>/examples)

Fixes googleapis/librarian#6257

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a 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 updates the snippet metadata processing to support reading and updating metadata files from two distinct directories: the shared snippets directory and the examples directory. While the added unit tests successfully cover these new scenarios, the current implementation introduces non-determinism by iterating over a map and silently ignores cases where neither file is found. It is recommended to refactor the logic using a slice of paths to ensure deterministic processing, reduce duplication, and preserve the original logging behavior when files are missing.

Comment thread internal/librariangen/module/module.go Outdated
@JoeWang1127 JoeWang1127 marked this pull request as ready for review June 2, 2026 00:32
@JoeWang1127 JoeWang1127 requested a review from a team as a code owner June 2, 2026 00:32
@JoeWang1127 JoeWang1127 requested a review from codyoss June 2, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

golang: change legacylibrarian to update snippets in two directories

1 participant