Skip to content

Revert "feat(internal/librarian/golang): restructure Go configuration in librarian.yaml"#5990

Merged
noahdietz merged 1 commit into
mainfrom
revert-5975-feat-restructure-go-config-only
May 13, 2026
Merged

Revert "feat(internal/librarian/golang): restructure Go configuration in librarian.yaml"#5990
noahdietz merged 1 commit into
mainfrom
revert-5975-feat-restructure-go-config-only

Conversation

@noahdietz

Copy link
Copy Markdown
Contributor

Reverts #5975

Fixes #5987

@noahdietz noahdietz merged commit d88230c into main May 13, 2026
45 of 46 checks passed
@noahdietz noahdietz deleted the revert-5975-feat-restructure-go-config-only branch May 13, 2026 21:37

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

Copy link
Copy Markdown
Contributor

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 refactors the configuration schema by moving Go-specific API configurations from the individual API structs to a centralized GoAPIs list within the GoModule struct. This change improves the organization of Go-specific settings and simplifies configuration management. The reviewer correctly identified a potential issue regarding shallow copies of the GoAPI struct when generating preview configurations, which could lead to unintended side effects if slice fields are modified in the future. No comments were removed as the provided feedback is actionable and addresses a potential bug.

if shared {
// Make a copy so that we can mutate it.
pga := *sg
pga := *g

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The GoAPI struct contains slice fields (EnabledGeneratorFeatures, NestedProtos). Performing a shallow copy of the struct here means the preview configuration will share the same underlying arrays as the stable configuration. While currently only the boolean NoSnippets field is mutated, this is a potential source of bugs if slice fields are ever modified for preview variants. Consider performing a deep copy or explicitly copying the slice fields if they need to be independent.

sofisl pushed a commit that referenced this pull request May 14, 2026
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.

google-cloud-go: librarian generate fails when run at HEAD

2 participants