From f81f4bc1d508b80b82de49198bbbd51b9e7ee4b4 Mon Sep 17 00:00:00 2001 From: Sophia Yang <171981480+yangyzs@users.noreply.github.com> Date: Wed, 15 Jul 2026 14:18:38 -0400 Subject: [PATCH] chore: modernize post-processing for common-protos, iam, and showcase Remove legacy owlbot.py scripts for java-common-protos, java-iam, and java-showcase, and migrate their configurations to librarian.yaml. For https://github.com/googleapis/librarian/issues/6832 --- java-common-protos/owlbot.py | 52 ------------------------------------ java-iam/owlbot.py | 38 -------------------------- java-showcase/owlbot.py | 39 --------------------------- librarian.yaml | 11 ++++++++ 4 files changed, 11 insertions(+), 129 deletions(-) delete mode 100644 java-common-protos/owlbot.py delete mode 100644 java-iam/owlbot.py delete mode 100644 java-showcase/owlbot.py diff --git a/java-common-protos/owlbot.py b/java-common-protos/owlbot.py deleted file mode 100644 index fec20b7561cc..000000000000 --- a/java-common-protos/owlbot.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import os.path -import synthtool as s -from synthtool.languages import java - - -for library in s.get_staging_dirs(): - # put any special-case replacements here - # TODO: remove this for the next major version bump - if os.path.exists("owl-bot-staging/v1/proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadata.java"): - os.remove("owl-bot-staging/v1/proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadata.java") - if os.path.exists("owl-bot-staging/v1/proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataOrBuilder.java"): - os.remove("owl-bot-staging/v1/proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataOrBuilder.java") - if os.path.exists("owl-bot-staging/v1/proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataProto.java"): - os.remove("owl-bot-staging/v1/proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataProto.java") - if os.path.exists("owl-bot-staging/v1/proto-google-common-protos/src/main/proto/google/cloud/audit/bigquery_audit_metadata.proto"): - os.remove("owl-bot-staging/v1/proto-google-common-protos/src/main/proto/google/cloud/audit/bigquery_audit_metadata.proto") - if os.path.exists("owl-bot-staging/v1/proto-google-common-protos/src/main/proto/google/cloud/common_resources.proto"): - os.remove("owl-bot-staging/v1/proto-google-common-protos/src/main/proto/google/cloud/common_resources.proto") - s.move(library) - -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "README.md", - "renovate.json", - ".gitignore" -]) diff --git a/java-iam/owlbot.py b/java-iam/owlbot.py deleted file mode 100644 index dc410938cd4c..000000000000 --- a/java-iam/owlbot.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -from synthtool.languages import java - -for library in s.get_staging_dirs(): - # put any special-case replacements here - s.move(library) - -s.remove_staging_dirs() -java.common_templates(monorepo=True,excludes=[ - ".github/*", - ".kokoro/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "README.md", - "samples/*", - "renovate.json", - ".gitignore" -]) diff --git a/java-showcase/owlbot.py b/java-showcase/owlbot.py deleted file mode 100644 index bad5aa284878..000000000000 --- a/java-showcase/owlbot.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import synthtool as s -from synthtool.languages import java - - -for library in s.get_staging_dirs(): - # put any special-case replacements here - s.move(library) - -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "README.md", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/librarian.yaml b/librarian.yaml index efa0a8790e49..205447cbf4f9 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -1050,6 +1050,14 @@ libraries: transport_override: grpc skip_pom_updates: true skip_api_id: true + keep: + - README.md + postprocess: + remove_file: + - proto-google-common-protos/src/main/proto/google/cloud/audit/bigquery_audit_metadata.proto + - proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadata.java + - proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataProto.java + - proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataOrBuilder.java - name: compute version: 1.105.0-SNAPSHOT apis: @@ -1977,6 +1985,8 @@ libraries: proto_artifact_id_override: proto-google-iam-v2beta generate_gapic: false samples: false + keep: + - README.md java: api_description_override: Manages access control for Google Cloud Platform resources artifact_id: proto-google-iam-v1 @@ -3379,6 +3389,7 @@ libraries: keep: - gapic-showcase/src/main/java/com/google/showcase/v1beta1/Version.java - gapic-showcase/src/test + - README.md roots: - showcase - googleapis