Skip to content

feat(librarian): sync to release-please in add command - #6346

Merged
codyoss merged 5 commits into
googleapis:mainfrom
codyoss:lib-rp-add
Jun 10, 2026
Merged

codyoss merged 5 commits into
googleapis:mainfrom
codyoss:lib-rp-add

Conversation

@codyoss

@codyoss codyoss commented Jun 9, 2026 •

Copy link
Copy Markdown
Member

Update release-please bulk configuration files when onboarding Go and Python libraries via librarian add, replacing the obsolete .librarian/state.yaml synchronization.

Synchronization is skipped if the bulk configuration files are missing. Legacy state.yaml logic is completely removed.

Example runs of branches with release-please config(ignore the reordering as I did not have keys sorted in the initial generation of the config files}:

Fixes: #5029
Internal Bug: b/519647333

@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 replaces the legacy syncToStateYAML mechanism with a new syncToReleasePlease integration, which updates .release-please-bulk-manifest.json and release-please-bulk-config.json when onboarding new libraries for Go and Python. Feedback on the changes suggests removing unnecessary trailing slash normalization logic for API paths and improving error handling in hasBulkReleasePleaseConfigs by using errors.Is with fs.ErrNotExist to prevent silent failures on operational errors.

Comment thread internal/librarian/add.go Resolved
Comment thread internal/librarian/release_please.go Resolved
@codyoss
codyoss force-pushed the lib-rp-add branch 3 times, most recently from fa262fb to a3c70b1 Compare June 9, 2026 18:11
@codyoss

codyoss commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

Note there is a limitation here that python does not allow using librarian add if there are custom options configured in the librarian yaml. I think this is a good use case where instead of failing to add when there are options we should duplicate the options for the new api and log a warning for the person running the tooling to validate they are correct for the new api. In my quick audit this should work most of the time without requiring modifications.

Update release-please bulk configuration files when onboarding
Go and Python libraries via librarian add, replacing the obsolete
.librarian/state.yaml synchronization.

Synchronization is skipped if the bulk configuration files are
missing. Legacy state.yaml logic is completely removed.
@codyoss
codyoss marked this pull request as ready for review June 9, 2026 19:11
@codyoss
codyoss requested a review from a team as a code owner June 9, 2026 19:11
@codyoss
codyoss requested a review from noahdietz June 9, 2026 19:11

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

I did a first pass but need to look more closely at the release please merging code

Comment thread internal/librarian/python/add.go Resolved
Comment thread internal/librarian/python/add.go Resolved
Comment thread internal/librarian/add.go Resolved
Comment thread internal/librarian/release_please.go Resolved
Comment thread internal/librarian/releaseplease.go Resolved
@codyoss

codyoss commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

I will note with the merging code I purposefully did not create structs for marshaling the data. It make the code a little harder to read but allows us to be more decoupled from changes to the release-please config schema. Because we surgically edit specific fields we just marshal back out other data we don't touch. This ensures if release-please adds a new field in the future we automatically handle it without code changes.

Comment thread internal/librarian/release_please.go Resolved
Comment thread internal/librarian/release_please.go Resolved

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

Just nits left. Pretty slick, but that merging code hurts my brain lol

Comment thread internal/librarian/golang/add.go Resolved
Comment thread internal/librarian/release_please.go Resolved
@codyoss
codyoss enabled auto-merge (squash) June 10, 2026 19:34
@codyoss
codyoss merged commit f1103ae into googleapis:main Jun 10, 2026
27 checks passed
zhumin8 pushed a commit that referenced this pull request Jun 16, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.21.0](v0.20.0...v0.21.0)
(2026-06-16)


### Features

* **internal/librarian/java:** source google-cloud-pom-parent in pom.xml
templates ([#6432](#6432))
([c5718f4](c5718f4))
* **internal/librarian/java:** support alternate license header files
([#6311](#6311))
([e7222b1](e7222b1))
* **internal/librarian/nodejs:** add client_documentation_override to
migrate ([#6310](#6310))
([cb8b040](cb8b040))
* **internal/librarian/python:** update gapic-generator to 1.35.0
([#6427](#6427))
([c3a780e](c3a780e))
* **internal/librarian:** enable structured logging with slog
([#6363](#6363))
([458a738](458a738)),
closes [#6338](#6338)
* **internal/postprocessing:** add copyFile function
([#6364](#6364))
([8aa57f0](8aa57f0)),
closes [#6295](#6295)
* **internal/postprocessing:** add removeFile function
([#6371](#6371))
([9e471eb](9e471eb)),
closes [#6296](#6296)
* **internal/postprocessing:** add replace and replaceRegex functions
([#6412](#6412))
([ece3aff](ece3aff)),
closes [#6297](#6297)
* **librarian:** sync to release-please in add command
([#6346](#6346))
([f1103ae](f1103ae))
* **sidekick/rust:** add `gcp.resource.destination.id` and fix incorrect
`gcp.longrunning.done` status in lro traces
([#6275](#6275))
([0648f55](0648f55))
* **sidekick/swift:** improve snippet body
([#6434](#6434))
([dcb6e6c](dcb6e6c))
* **sidekick/swift:** LRO snippets
([#6431](#6431))
([be95a09](be95a09))


### Bug Fixes

* **.github/workflows:** fix outdated Java tools path in integration job
([#6372](#6372))
([72a5447](72a5447))
* **golang:** fix onboarding versionless paths
([#6435](#6435))
([acd1c2b](acd1c2b))
* **internal/postprocessing:** return error for missing files in
RemoveFile
([#6408](#6408))
([4a0e81b](4a0e81b))
* **librarian/internal/java:** preserve released_version for
non-snapshot versions during tidy
([#6426](#6426))
([034374c](034374c))
* **sdk.yaml:** enable java sql v1beta4 dual transport
([#6437](#6437))
([ac320d3](ac320d3))
* **sidekick/rust:** add clippy allow for BigQuery request methods
([#6373](#6373))
([cc804c9](cc804c9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
haphungw pushed a commit to haphungw/librarian that referenced this pull request Jun 26, 2026
Update release-please bulk configuration files when onboarding Go and
Python libraries via librarian add, replacing the obsolete
.librarian/state.yaml synchronization.

Synchronization is skipped if the bulk configuration files are missing.
Legacy state.yaml logic is completely removed.

Example runs of branches with release-please config(ignore the
reordering as I did not have keys sorted in the initial generation of
the config files}:
- codyoss/google-cloud-python#3
- codyoss/google-cloud-go#9

Fixes: googleapis#5029
Internal Bug: b/519647333
haphungw pushed a commit to haphungw/librarian that referenced this pull request Jun 26, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.21.0](googleapis/librarian@v0.20.0...v0.21.0)
(2026-06-16)


### Features

* **internal/librarian/java:** source google-cloud-pom-parent in pom.xml
templates ([googleapis#6432](googleapis#6432))
([c5718f4](googleapis@c5718f4))
* **internal/librarian/java:** support alternate license header files
([googleapis#6311](googleapis#6311))
([e7222b1](googleapis@e7222b1))
* **internal/librarian/nodejs:** add client_documentation_override to
migrate ([googleapis#6310](googleapis#6310))
([cb8b040](googleapis@cb8b040))
* **internal/librarian/python:** update gapic-generator to 1.35.0
([googleapis#6427](googleapis#6427))
([c3a780e](googleapis@c3a780e))
* **internal/librarian:** enable structured logging with slog
([googleapis#6363](googleapis#6363))
([458a738](googleapis@458a738)),
closes [googleapis#6338](googleapis#6338)
* **internal/postprocessing:** add copyFile function
([googleapis#6364](googleapis#6364))
([8aa57f0](googleapis@8aa57f0)),
closes [googleapis#6295](googleapis#6295)
* **internal/postprocessing:** add removeFile function
([googleapis#6371](googleapis#6371))
([9e471eb](googleapis@9e471eb)),
closes [googleapis#6296](googleapis#6296)
* **internal/postprocessing:** add replace and replaceRegex functions
([googleapis#6412](googleapis#6412))
([ece3aff](googleapis@ece3aff)),
closes [googleapis#6297](googleapis#6297)
* **librarian:** sync to release-please in add command
([googleapis#6346](googleapis#6346))
([f1103ae](googleapis@f1103ae))
* **sidekick/rust:** add `gcp.resource.destination.id` and fix incorrect
`gcp.longrunning.done` status in lro traces
([googleapis#6275](googleapis#6275))
([0648f55](googleapis@0648f55))
* **sidekick/swift:** improve snippet body
([googleapis#6434](googleapis#6434))
([dcb6e6c](googleapis@dcb6e6c))
* **sidekick/swift:** LRO snippets
([googleapis#6431](googleapis#6431))
([be95a09](googleapis@be95a09))


### Bug Fixes

* **.github/workflows:** fix outdated Java tools path in integration job
([googleapis#6372](googleapis#6372))
([72a5447](googleapis@72a5447))
* **golang:** fix onboarding versionless paths
([googleapis#6435](googleapis#6435))
([acd1c2b](googleapis@acd1c2b))
* **internal/postprocessing:** return error for missing files in
RemoveFile
([googleapis#6408](googleapis#6408))
([4a0e81b](googleapis@4a0e81b))
* **librarian/internal/java:** preserve released_version for
non-snapshot versions during tidy
([googleapis#6426](googleapis#6426))
([034374c](googleapis@034374c))
* **sdk.yaml:** enable java sql v1beta4 dual transport
([googleapis#6437](googleapis#6437))
([ac320d3](googleapis@ac320d3))
* **sidekick/rust:** add clippy allow for BigQuery request methods
([googleapis#6373](googleapis#6373))
([cc804c9](googleapis@cc804c9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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 functions to update state.yaml

2 participants