Skip to content

chore: configure default_enabled_generator_features in librarian.yaml#14600

Merged
suztomo merged 3 commits into
googleapis:mainfrom
suztomo:issue-5246-librarian-yaml
May 18, 2026
Merged

chore: configure default_enabled_generator_features in librarian.yaml#14600
suztomo merged 3 commits into
googleapis:mainfrom
suztomo:issue-5246-librarian-yaml

Conversation

@suztomo

@suztomo suztomo commented May 15, 2026

Copy link
Copy Markdown
Member

This change adds default_enabled_generator_features under default.go and removes redundant enabled_generator_features from individual APIs where they match the default.

The companion pull request is googleapis/librarian#6029. The librarian change needs to happen first. After that, I'll update the librarian version in librarian.yaml in google-cloud-go with a pseudo version. => It is v0.13.2-0.20260518181009-04b8e642ea4c.

I regenerated the code using the pseudo version:

suztomo@suztomo:~/librarian-2026/google-cloud-go$ echo $V
v0.13.2-0.20260518181009-04b8e642ea4c
suztomo@suztomo:~/librarian-2026/google-cloud-go$ go run github.com/googleapis/librarian/cmd/librarian@${V} generate --all

This fixes maps/mapmanagement/apiv2beta/map_management_client.go being generated without the F_open_telemetry_attributes option (details: googleapis/librarian#5246 (comment)).

Fixes googleapis/librarian#5246

@suztomo suztomo requested review from a team as code owners May 15, 2026 16:58
@suztomo suztomo marked this pull request as draft May 15, 2026 16:59

@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 librarian.yaml configuration by moving the F_open_telemetry_attributes and F_proto_cloneof Go generator features to a global default_enabled_generator_features setting. Consequently, these redundant feature flags have been removed from the individual configurations of numerous libraries. I have no feedback to provide.

@suztomo

suztomo commented May 18, 2026

Copy link
Copy Markdown
Member Author

To myself: This needs to be merged after Librarian pull request.

suztomo added a commit to googleapis/librarian that referenced this pull request May 18, 2026
…onfiguration (#6029)

This change introduces default_enabled_generator_features in
librarian.yaml's default.go section and updates Librarian to append
these defaults to APIs' `go.enabled_generator_features` list.

It implements a `union` helper to merge default generator features with
API-specific ones while de-duplicating elements and preserving their
original insertion order. This custom helper is necessary as the Go
standard library does not provide a built-in order-preserving
de-duplication helper for slices. Preserving the order of generator
features is important because it ensures the generated `protoc` command
line remains consistent across runs.

The companion pull request is
googleapis/google-cloud-go#14600. The librarian
change needs to happen first. After that, I'll update the librarian
version in `librarian.yaml` in google-cloud-go with a pseudo version
with the default value added there.

Fixes #5246
suztomo added 3 commits May 18, 2026 18:23
This change adds default_enabled_generator_features under default.go and removes redundant enabled_generator_features from individual APIs where they match the default.

Fixes googleapis/librarian#5246

TAG=agy
CONV=dc5bc0de-b49f-4b0d-ab5c-5e44d6ecd975
```
$ V=$(GOPROXY=direct go list -m -f '{{.Version}}' github.com/googleapis/librarian@main)
$ echo $V
v0.13.2-0.20260518181009-04b8e642ea4c
```
@suztomo suztomo force-pushed the issue-5246-librarian-yaml branch from 1248783 to 3369aee Compare May 18, 2026 18:28
@suztomo suztomo enabled auto-merge (squash) May 18, 2026 18:34
@suztomo suztomo merged commit 9535ea5 into googleapis:main May 18, 2026
11 checks passed
@suztomo suztomo deleted the issue-5246-librarian-yaml branch May 18, 2026 18:37
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: add GoModule in Default configuration

2 participants