Skip to content

feat(internal/librarian/golang): restructure Go configuration in librarian.yaml#5975

Merged
suztomo merged 17 commits into
googleapis:mainfrom
suztomo:feat-restructure-go-config-only
May 13, 2026
Merged

feat(internal/librarian/golang): restructure Go configuration in librarian.yaml#5975
suztomo merged 17 commits into
googleapis:mainfrom
suztomo:feat-restructure-go-config-only

Conversation

@suztomo

@suztomo suztomo commented May 12, 2026

Copy link
Copy Markdown
Member

This PR restructures Go configuration in librarian.yaml to support nesting API.Go under apis entries.

Fixes #5471

@suztomo suztomo requested a review from a team as a code owner May 12, 2026 18:24
@suztomo suztomo marked this pull request as draft May 12, 2026 18:25
@suztomo suztomo force-pushed the feat-restructure-go-config-only branch from 410a7d7 to 038b25f Compare May 12, 2026 18:26

@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 nesting Go-specific API settings directly within the API struct, replacing the previous GoAPIs list in the GoModule. The changes include updates to the configuration model, documentation, and core processing logic, along with a comprehensive update of the test suite to align with the new structure. Review feedback recommends improving the Tidy function to clear the Path field in the nested Go configuration when it matches the parent API path to minimize redundancy in serialized YAML.

Comment thread internal/librarian/golang/tidy.go

@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 settings from a global list in GoModule to a nested field within each API entry. This change simplifies the configuration structure and is reflected across the codebase, including documentation, configuration structs, generation logic, and extensive test updates. A review comment identifies an inefficiency and a potential bug in internal/librarian/golang/module.go where findGoAPI is used instead of direct access to the now-nested api.Go field.

Comment thread internal/librarian/golang/module.go Outdated
@suztomo suztomo marked this pull request as ready for review May 12, 2026 18:48
@suztomo suztomo changed the title feat(internal/librarian/golang): restructure Go configuration in librarian.yaml (#5471) feat(internal/librarian/golang): restructure Go configuration in librarian.yaml May 12, 2026

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

nit: maybe use refactor or fix as. title type

Comment thread internal/librarian/golang/module.go
suztomo added 17 commits May 13, 2026 19:43
This removes support for top-level Go defaults (Issue googleapis#5246) to focus this branch solely on nesting Go configuration under API entries (Issue googleapis#5471).
With Go configuration now nested directly under API entries (Issue googleapis#5471), the API path is always known from the containing API structure. Removing GoAPI.Path eliminates redundancy and prevents potential state drift.
@suztomo suztomo force-pushed the feat-restructure-go-config-only branch from 4f72492 to b4ab8ae Compare May 13, 2026 19:43
@suztomo suztomo merged commit aee112c into googleapis:main May 13, 2026
24 checks passed
@suztomo suztomo deleted the feat-restructure-go-config-only branch May 13, 2026 20:02
noahdietz added a commit that referenced this pull request May 13, 2026
sofisl pushed a commit that referenced this pull request May 14, 2026
…arian.yaml (#5975)

This PR restructures Go configuration in `librarian.yaml` to support
nesting `API.Go` under `apis` entries.

Fixes #5471

---------

Signed-off-by: Tomo Suzuki <suztomo@gmail.com>
sofisl pushed a commit that referenced this pull request May 14, 2026
suztomo added a commit that referenced this pull request May 14, 2026
…arian.yaml (#5471) (#6009)

This PR re-applies the Go configuration restructuring from PR #5975,
nesting Go configuration under API entries. This PR will be merged
concurrently with the companion configuration migration in
google-cloud-go.
suztomo added a commit that referenced this pull request May 14, 2026
…arian.yaml (#6015)

This PR re-applies the Go configuration restructuring from PR #5975,
nesting Go configuration under API entries. This PR will be merged right
before the companion configuration migration in google-cloud-go:
googleapis/google-cloud-go#14587 is merged.

<details>
<summary>This temporarily skips the integration test using
google-cloud-go.</summary>

Here is how GitHub Actions handles the subsequent
`create-issue-on-failure` job:

```yaml
  create-issue-on-failure:
    needs: [integration]
    if: ${{ always() && contains(needs.*.result, 'failure') && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
```

1. **Dependency State**: Because `integration` has `if: false`, GitHub
Actions marks its final status as `skipped`.
2. **Evaluation**: By default, a job is skipped if its `needs`
dependency is skipped. However, because `create-issue-on-failure` uses
`always()`, GitHub evaluates its `if:` condition.
3. **Result**: The expression `needs.*.result` evaluates to
`['skipped']`. Since this array does not contain `'failure'`, the
`contains(...)` check evaluates to `false`.

As a result, the `create-issue-on-failure` job will be cleanly skipped
without creating any false alarm issues or causing workflow errors.
</details>

Fixes #5471
@suztomo

suztomo commented May 15, 2026

Copy link
Copy Markdown
Member Author

nit: maybe use refactor or fix as. title type

(I forgot to submit comment.) I went ahead with feat because this requires changes in Go's configuration file.

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: remove redundant path duplication between apis and go.go_apis

2 participants