Skip to content

fix: update librarian.js for containeranalysis to fix postproccessing issue#8489

Merged
gcf-merge-on-green[bot] merged 2 commits into
mainfrom
pearigee-librarian-js-fixes
Jun 9, 2026
Merged

fix: update librarian.js for containeranalysis to fix postproccessing issue#8489
gcf-merge-on-green[bot] merged 2 commits into
mainfrom
pearigee-librarian-js-fixes

Conversation

@pearigee

@pearigee pearigee commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This should fix #8478 which is breaking because this code incorrectly injects code into the middle of an import statement:
image

The new regex is /}\s*$/. Here is a quick breakdown of what it does and why it works better:

How it works:

  • } matches a literal closing brace.
  • \s* matches any trailing whitespace (like spaces or newlines) that might exist at the bottom of the file.
  • $ anchors the match to the absolute end of the file/string.

Why it fixes the bug: The original regex (/^}/m) matched the first } that appeared at the start of a new line. Because prettier splits import type { ... } blocks across multiple lines, their closing brace ends up at the start of a line. This tricked the old regex into injecting the new method inside the imports, creating a syntax error.

@pearigee pearigee requested a review from a team as a code owner June 9, 2026 17:47

@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 updates the librarian.js script to adjust the indentation of the generated getGrafeasClient method and changes the replacement regex to target the end of the file. The review feedback points out that the new regex /}\s*$/ will consume the trailing newline of the file, which can cause linting or formatting issues, and suggests adding a trailing newline to the template literal to prevent this.

Comment thread packages/google-devtools-containeranalysis/librarian.js Outdated
@pearigee pearigee added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 9, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 9, 2026
@quirogas

quirogas commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Updates googleapis/librarian#5040

@pearigee pearigee added the automerge Merge the pull request once unit tests and other checks pass. label Jun 9, 2026
@gcf-merge-on-green gcf-merge-on-green Bot merged commit 9f7d7b9 into main Jun 9, 2026
33 checks passed
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jun 9, 2026
@gcf-merge-on-green gcf-merge-on-green Bot deleted the pearigee-librarian-js-fixes branch June 9, 2026 18:20
@release-please release-please Bot mentioned this pull request Jun 9, 2026
gcf-merge-on-green Bot pushed a commit that referenced this pull request Jun 16, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>datamanager: 0.4.0</summary>

## [0.4.0](https://togithub.com/googleapis/google-cloud-node/compare/datamanager-v0.3.0...datamanager-v0.4.0) (2026-06-16)


### Features

* [datamanager] add encrypted_user_id.proto and the EncryptedUserId resource ([#8378](https://togithub.com/googleapis/google-cloud-node/issues/8378)) ([f5b12cf](https://togithub.com/googleapis/google-cloud-node/commit/f5b12cf10d9974c87e651e1182a5804030af8cdc))
</details>

<details><summary>alloydb: 2.6.0</summary>

## [2.6.0](https://togithub.com/googleapis/google-cloud-node/compare/alloydb-v2.5.1...alloydb-v2.6.0) (2026-06-16)


### Features

* Migrate google-cloud-alloydb to librarian ([#8491](https://togithub.com/googleapis/google-cloud-node/issues/8491)) ([2a7f823](https://togithub.com/googleapis/google-cloud-node/commit/2a7f82336695397220cae1ee249f8ff5e1871b60))
</details>

<details><summary>api-gateway: 4.3.0</summary>

## [4.3.0](https://togithub.com/googleapis/google-cloud-node/compare/api-gateway-v4.2.2...api-gateway-v4.3.0) (2026-06-16)


### Features

* Migrate google-cloud-apigateway to librarian ([#8492](https://togithub.com/googleapis/google-cloud-node/issues/8492)) ([29e4147](https://togithub.com/googleapis/google-cloud-node/commit/29e4147e202ac786d7a943e0156be4160bba459f))
</details>

<details><summary>apigee-connect: 4.3.0</summary>

## [4.3.0](https://togithub.com/googleapis/google-cloud-node/compare/apigee-connect-v4.2.2...apigee-connect-v4.3.0) (2026-06-16)


### Features

* Migrate google-cloud-apigeeconnect to librarian ([#8493](https://togithub.com/googleapis/google-cloud-node/issues/8493)) ([e314fa8](https://togithub.com/googleapis/google-cloud-node/commit/e314fa8c1aada689298f0ba84619f6918d17cb05))
</details>

<details><summary>dataproc: 6.6.0</summary>

## [6.6.0](https://togithub.com/googleapis/google-cloud-node/compare/dataproc-v6.5.1...dataproc-v6.6.0) (2026-06-16)


### Features

* Regenerated google-cloud-dataproc ([#8604](https://togithub.com/googleapis/google-cloud-node/issues/8604)) ([3b7367a](https://togithub.com/googleapis/google-cloud-node/commit/3b7367a24115ccf43bd46646f257cee6e787c07c))
</details>

<details><summary>locationfinder: 0.2.0</summary>

## [0.2.0](https://togithub.com/googleapis/google-cloud-node/compare/locationfinder-v0.1.2...locationfinder-v0.2.0) (2026-06-16)


### Features

* Update google-cloud-locationfinder API ([#8583](https://togithub.com/googleapis/google-cloud-node/issues/8583)) ([8882faa](https://togithub.com/googleapis/google-cloud-node/commit/8882faa7faecb3afab2f3a658d33bcc125b48885))
</details>

<details><summary>recommender: 7.3.0</summary>

## [7.3.0](https://togithub.com/googleapis/google-cloud-node/compare/recommender-v7.2.2...recommender-v7.3.0) (2026-06-16)


### Features

* [recommender] Support utilization insights and cloud hub ([#8375](https://togithub.com/googleapis/google-cloud-node/issues/8375)) ([7e6c7be](https://togithub.com/googleapis/google-cloud-node/commit/7e6c7bead35a43c675c8875ff1fd2979badeb6f7))
</details>

<details><summary>redis: 5.3.0</summary>

## [5.3.0](https://togithub.com/googleapis/google-cloud-node/compare/redis-v5.2.2...redis-v5.3.0) (2026-06-16)


### Features

* Local OwlBot generation batch 1 ([#8612](https://togithub.com/googleapis/google-cloud-node/issues/8612)) ([b4d5da7](https://togithub.com/googleapis/google-cloud-node/commit/b4d5da72a41c4d961eaeee7b7633c7885ecb9166))
</details>

<details><summary>redis-cluster: 0.11.0</summary>

## [0.11.0](https://togithub.com/googleapis/google-cloud-node/compare/redis-cluster-v0.10.0...redis-cluster-v0.11.0) (2026-06-16)


### Features

* Local OwlBot generation batch 1 ([#8612](https://togithub.com/googleapis/google-cloud-node/issues/8612)) ([b4d5da7](https://togithub.com/googleapis/google-cloud-node/commit/b4d5da72a41c4d961eaeee7b7633c7885ecb9166))
</details>

<details><summary>resource-manager: 6.3.0</summary>

## [6.3.0](https://togithub.com/googleapis/google-cloud-node/compare/resource-manager-v6.2.2...resource-manager-v6.3.0) (2026-06-16)


### Features

* Local OwlBot generation batch 1 ([#8612](https://togithub.com/googleapis/google-cloud-node/issues/8612)) ([b4d5da7](https://togithub.com/googleapis/google-cloud-node/commit/b4d5da72a41c4d961eaeee7b7633c7885ecb9166))
</details>

<details><summary>retail: 4.4.0</summary>

## [4.4.0](https://togithub.com/googleapis/google-cloud-node/compare/retail-v4.3.1...retail-v4.4.0) (2026-06-16)


### Features

* Local OwlBot generation batch 1 ([#8612](https://togithub.com/googleapis/google-cloud-node/issues/8612)) ([b4d5da7](https://togithub.com/googleapis/google-cloud-node/commit/b4d5da72a41c4d961eaeee7b7633c7885ecb9166))
</details>

<details><summary>run: 3.3.0</summary>

## [3.3.0](https://togithub.com/googleapis/google-cloud-node/compare/run-v3.2.1...run-v3.3.0) (2026-06-16)


### Features

* Local OwlBot generation batch 1 ([#8612](https://togithub.com/googleapis/google-cloud-node/issues/8612)) ([b4d5da7](https://togithub.com/googleapis/google-cloud-node/commit/b4d5da72a41c4d961eaeee7b7633c7885ecb9166))
</details>

<details><summary>scheduler: 5.4.0</summary>

## [5.4.0](https://togithub.com/googleapis/google-cloud-node/compare/scheduler-v5.3.2...scheduler-v5.4.0) (2026-06-16)


### Features

* Local OwlBot generation batch 2 ([#8613](https://togithub.com/googleapis/google-cloud-node/issues/8613)) ([243fb1a](https://togithub.com/googleapis/google-cloud-node/commit/243fb1a66876934bd68ca96e420937ae8adeb77d))
</details>

<details><summary>secret-manager: 6.2.0</summary>

## [6.2.0](https://togithub.com/googleapis/google-cloud-node/compare/secret-manager-v6.1.3...secret-manager-v6.2.0) (2026-06-16)


### Features

* Local OwlBot generation batch 2 ([#8613](https://togithub.com/googleapis/google-cloud-node/issues/8613)) ([243fb1a](https://togithub.com/googleapis/google-cloud-node/commit/243fb1a66876934bd68ca96e420937ae8adeb77d))


### Bug Fixes

* **google-cloud-secretmanager:** Improve librarian.js script an re-add missing functions ([#8424](https://togithub.com/googleapis/google-cloud-node/issues/8424)) ([13d03c1](https://togithub.com/googleapis/google-cloud-node/commit/13d03c1f0f07f92770d44490050ab65498b4a8ff))
</details>

<details><summary>securesourcemanager: 0.10.0</summary>

## [0.10.0](https://togithub.com/googleapis/google-cloud-node/compare/securesourcemanager-v0.9.1...securesourcemanager-v0.10.0) (2026-06-16)


### Features

* Local OwlBot generation batch 2 ([#8613](https://togithub.com/googleapis/google-cloud-node/issues/8613)) ([243fb1a](https://togithub.com/googleapis/google-cloud-node/commit/243fb1a66876934bd68ca96e420937ae8adeb77d))
</details>

<details><summary>security-private-ca: 7.2.0</summary>

## [7.2.0](https://togithub.com/googleapis/google-cloud-node/compare/security-private-ca-v7.1.0...security-private-ca-v7.2.0) (2026-06-16)


### Features

* Local OwlBot generation batch 2 ([#8613](https://togithub.com/googleapis/google-cloud-node/issues/8613)) ([243fb1a](https://togithub.com/googleapis/google-cloud-node/commit/243fb1a66876934bd68ca96e420937ae8adeb77d))
</details>

<details><summary>publicca: 2.3.0</summary>

## [2.3.0](https://togithub.com/googleapis/google-cloud-node/compare/publicca-v2.2.2...publicca-v2.3.0) (2026-06-16)


### Features

* Local OwlBot generation batch 2 ([#8613](https://togithub.com/googleapis/google-cloud-node/issues/8613)) ([243fb1a](https://togithub.com/googleapis/google-cloud-node/commit/243fb1a66876934bd68ca96e420937ae8adeb77d))
</details>

<details><summary>security-center: 9.4.0</summary>

## [9.4.0](https://togithub.com/googleapis/google-cloud-node/compare/security-center-v9.3.2...security-center-v9.4.0) (2026-06-16)


### Features

* Local OwlBot generation batch 3 ([#8614](https://togithub.com/googleapis/google-cloud-node/issues/8614)) ([fae15ec](https://togithub.com/googleapis/google-cloud-node/commit/fae15ecca725f8e978341156e2c99c623ce74fcc))
</details>

<details><summary>securitycentermanagement: 0.8.0</summary>

## [0.8.0](https://togithub.com/googleapis/google-cloud-node/compare/securitycentermanagement-v0.7.2...securitycentermanagement-v0.8.0) (2026-06-16)


### Features

* Local OwlBot generation batch 3 ([#8614](https://togithub.com/googleapis/google-cloud-node/issues/8614)) ([fae15ec](https://togithub.com/googleapis/google-cloud-node/commit/fae15ecca725f8e978341156e2c99c623ce74fcc))
</details>

<details><summary>service-directory: 6.2.0</summary>

## [6.2.0](https://togithub.com/googleapis/google-cloud-node/compare/service-directory-v6.1.3...service-directory-v6.2.0) (2026-06-16)


### Features

* Local OwlBot generation batch 3 ([#8614](https://togithub.com/googleapis/google-cloud-node/issues/8614)) ([fae15ec](https://togithub.com/googleapis/google-cloud-node/commit/fae15ecca725f8e978341156e2c99c623ce74fcc))
</details>

<details><summary>servicehealth: 0.8.0</summary>

## [0.8.0](https://togithub.com/googleapis/google-cloud-node/compare/servicehealth-v0.7.2...servicehealth-v0.8.0) (2026-06-16)


### Features

* Local OwlBot generation batch 3 ([#8614](https://togithub.com/googleapis/google-cloud-node/issues/8614)) ([fae15ec](https://togithub.com/googleapis/google-cloud-node/commit/fae15ecca725f8e978341156e2c99c623ce74fcc))
</details>

<details><summary>shell: 4.2.0</summary>

## [4.2.0](https://togithub.com/googleapis/google-cloud-node/compare/shell-v4.1.2...shell-v4.2.0) (2026-06-16)


### Features

* Local OwlBot generation batch 3 ([#8614](https://togithub.com/googleapis/google-cloud-node/issues/8614)) ([fae15ec](https://togithub.com/googleapis/google-cloud-node/commit/fae15ecca725f8e978341156e2c99c623ce74fcc))
</details>

<details><summary>speech: 7.4.0</summary>

## [7.4.0](https://togithub.com/googleapis/google-cloud-node/compare/speech-v7.3.2...speech-v7.4.0) (2026-06-16)


### Features

* Local OwlBot generation batch 4 ([#8615](https://togithub.com/googleapis/google-cloud-node/issues/8615)) ([f629251](https://togithub.com/googleapis/google-cloud-node/commit/f629251e27e51aa06003b4846a497d5a7c411cc2))
</details>

<details><summary>storagebatchoperations: 0.5.0</summary>

## [0.5.0](https://togithub.com/googleapis/google-cloud-node/compare/storagebatchoperations-v0.4.0...storagebatchoperations-v0.5.0) (2026-06-16)


### Features

* Local OwlBot generation batch 4 ([#8615](https://togithub.com/googleapis/google-cloud-node/issues/8615)) ([f629251](https://togithub.com/googleapis/google-cloud-node/commit/f629251e27e51aa06003b4846a497d5a7c411cc2))
</details>

<details><summary>storageinsights: 2.3.0</summary>

## [2.3.0](https://togithub.com/googleapis/google-cloud-node/compare/storageinsights-v2.2.2...storageinsights-v2.3.0) (2026-06-16)


### Features

* Local OwlBot generation batch 4 ([#8615](https://togithub.com/googleapis/google-cloud-node/issues/8615)) ([f629251](https://togithub.com/googleapis/google-cloud-node/commit/f629251e27e51aa06003b4846a497d5a7c411cc2))
</details>

<details><summary>support: 2.4.0</summary>

## [2.4.0](https://togithub.com/googleapis/google-cloud-node/compare/support-v2.3.0...support-v2.4.0) (2026-06-16)


### Features

* Local OwlBot generation batch 4 ([#8615](https://togithub.com/googleapis/google-cloud-node/issues/8615)) ([f629251](https://togithub.com/googleapis/google-cloud-node/commit/f629251e27e51aa06003b4846a497d5a7c411cc2))
</details>

<details><summary>talent: 7.2.0</summary>

## [7.2.0](https://togithub.com/googleapis/google-cloud-node/compare/talent-v7.1.3...talent-v7.2.0) (2026-06-16)


### Features

* Regenerated google-cloud-talent ([#8616](https://togithub.com/googleapis/google-cloud-node/issues/8616)) ([8d87b39](https://togithub.com/googleapis/google-cloud-node/commit/8d87b39babf85a341506a1f4918a18a835887990))
</details>

<details><summary>workstations: 2.3.0</summary>

## [2.3.0](https://togithub.com/googleapis/google-cloud-node/compare/workstations-v2.2.2...workstations-v2.3.0) (2026-06-16)


### Features

* Migrate google-cloud-workstations to librarian ([#8480](https://togithub.com/googleapis/google-cloud-node/issues/8480)) ([127ce8d](https://togithub.com/googleapis/google-cloud-node/commit/127ce8d7a8fb8e3b56a25c0b3b3122c20aee81d5))
</details>

<details><summary>containeranalysis: 6.8.0</summary>

## [6.8.0](https://togithub.com/googleapis/google-cloud-node/compare/containeranalysis-v6.7.2...containeranalysis-v6.8.0) (2026-06-16)


### Features

* Migrate google-devtools-containeranalysis to librarian ([#8534](https://togithub.com/googleapis/google-cloud-node/issues/8534)) ([48cfd70](https://togithub.com/googleapis/google-cloud-node/commit/48cfd703e8632bc2b219a298a98301de23dc3ea9))


### Bug Fixes

* Update librarian.js for containeranalysis to fix postproccessing issue ([#8489](https://togithub.com/googleapis/google-cloud-node/issues/8489)) ([9f7d7b9](https://togithub.com/googleapis/google-cloud-node/commit/9f7d7b9132694b89908243d7c284c0a6e121826d))
</details>

<details><summary>grafeas: 6.2.0</summary>

## [6.2.0](https://togithub.com/googleapis/google-cloud-node/compare/grafeas-v6.1.2...grafeas-v6.2.0) (2026-06-16)


### Features

* Regenerated google-cloud-monitoring ([#8618](https://togithub.com/googleapis/google-cloud-node/issues/8618)) ([4b5aff4](https://togithub.com/googleapis/google-cloud-node/commit/4b5aff4b65b3729f3742d25ba0674bad0943d456))
</details>

<details><summary>ces: 0.4.1</summary>

## [0.4.1](https://togithub.com/googleapis/google-cloud-node/compare/ces-v0.4.0...ces-v0.4.1) (2026-06-16)


### Bug Fixes

* **php:** Remove abandoned deps ([602338b](https://togithub.com/googleapis/google-cloud-node/commit/602338ba5a448a7fe8b5a8c60dcb68adad39e20e))
</details>

<details><summary>mapmanagement: 0.1.0</summary>

## 0.1.0 (2026-06-16)


### Features

* Add initial files for google.maps.mapmanagement.v2beta ([#8066](https://togithub.com/googleapis/google-cloud-node/issues/8066)) ([6f9710c](https://togithub.com/googleapis/google-cloud-node/commit/6f9710c504c5272dfb59a77c7da98235ed9cf3ff))


### Bug Fixes

* Change the copyright year for files in the packages folder ([#8109](https://togithub.com/googleapis/google-cloud-node/issues/8109)) ([c1a03fe](https://togithub.com/googleapis/google-cloud-node/commit/c1a03fe604662091be283055c7d34052c64d6334))
</details>

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
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.

3 participants