From 812d515bc523a255441a98b48f076d279f4e7235 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 17:33:18 +0000 Subject: [PATCH 01/14] chore: update hermetic build docker volume usage --- generation/hermetic_library_generation.sh | 17 +---------------- generation/new_client_hermetic_build/README.md | 18 +++++------------- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/generation/hermetic_library_generation.sh b/generation/hermetic_library_generation.sh index b37b898c7364..d48b28a0bcac 100755 --- a/generation/hermetic_library_generation.sh +++ b/generation/hermetic_library_generation.sh @@ -70,9 +70,7 @@ if [ -z "${generation_config}" ]; then echo "Use default generation config: ${generation_config}" fi -volume_name="repo" workspace_name="/workspace/repo" -repo_volumes="${volume_name}:${workspace_name}" baseline_generation_config="baseline_generation_config.yaml" message="chore: generate libraries at $(date)" @@ -89,23 +87,10 @@ fi git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}" config_diff=$(diff "${generation_config}" "${baseline_generation_config}") -# bind docker volume to include the repository in docker running environment. -if [[ $(docker volume inspect ${volume_name}) != '[]' ]]; then - docker volume rm ${volume_name} -fi -docker volume create \ - --name ${volume_name} \ - --opt "type=none" \ - --opt "device=$(pwd)" \ - --opt "o=bind" # run hermetic code generation docker image. docker run \ --rm \ - -v "${repo_volumes}" \ - -v /tmp:/tmp \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -e "RUNNING_IN_DOCKER=true" \ - -e "REPO_BINDING_VOLUMES=-v ${repo_volumes}" \ + -v "$(pwd):${workspace_name}" \ gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \ python /src/cli/entry_point.py generate \ --baseline-generation-config-path="${workspace_name}/${baseline_generation_config}" \ diff --git a/generation/new_client_hermetic_build/README.md b/generation/new_client_hermetic_build/README.md index 7137a7326f09..8ffcfeab5d11 100644 --- a/generation/new_client_hermetic_build/README.md +++ b/generation/new_client_hermetic_build/README.md @@ -158,19 +158,11 @@ was modified (or the script exited because the library already existed). The last step you need is to `cd` into the root of `google-cloud-java` and run ``` -docker volume create --name "repo-google-cloud-java" --opt "type=none" --opt "device=$(pwd)" --opt "o=bind" -repo_volumes="-v repo-google-cloud-java:/workspace/google-cloud-java" -docker run --rm \ - ${repo_volumes} \ - -v /tmp:/tmp \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -e "RUNNING_IN_DOCKER=true" \ - -e "REPO_BINDING_VOLUMES=${repo_volumes}" \ - gcr.io/cloud-devrel-public-resources/java-library-generation:latest \ - python /src/generate_repo.py generate \ - --generation-config-yaml=/workspace/google-cloud-java/generation_config.yaml \ - --repository-path=/workspace/google-cloud-java \ - --target-library-names= +docker run --rm -u $(id -u):$(id -g) -v $(pwd):/workspace --entrypoint \ + python gcr.io/cloud-devrel-public-resources/java-library-generation:latest \ + /src/generate_repo.py generate \ + --target-library-names=contentwarehouse \ + --generation-config-yaml=/workspace/generation_config.yaml ``` From 8255e656bc74dbb045b7497e96cbad9e61ed46cf Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 17:37:39 +0000 Subject: [PATCH 02/14] remove redundant entrypoint sppecification --- generation/hermetic_library_generation.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/generation/hermetic_library_generation.sh b/generation/hermetic_library_generation.sh index d48b28a0bcac..00591e4f4f7b 100755 --- a/generation/hermetic_library_generation.sh +++ b/generation/hermetic_library_generation.sh @@ -92,7 +92,6 @@ docker run \ --rm \ -v "$(pwd):${workspace_name}" \ gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \ - python /src/cli/entry_point.py generate \ --baseline-generation-config-path="${workspace_name}/${baseline_generation_config}" \ --current-generation-config-path="${workspace_name}/${generation_config}" \ --repository-path="${workspace_name}" From cbc2ec6a3b75a2815419319a00e4e33886519240 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 17:38:13 +0000 Subject: [PATCH 03/14] test config change --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index d7e9ab6cb938..1831a373aea0 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -25,7 +25,7 @@ libraries: name_pretty: Access Approval product_documentation: https://cloud.google.com/access-approval/docs/ api_description: enables controlling access to your organization's data by Google - personnel. + personnel. - test release_level: stable GAPICs: - proto_path: google/cloud/accessapproval/v1 From 167850dd602834239b3405e8ac46b7690b27e44b Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 17:41:46 +0000 Subject: [PATCH 04/14] fix docker image call --- generation/hermetic_library_generation.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/generation/hermetic_library_generation.sh b/generation/hermetic_library_generation.sh index 00591e4f4f7b..6e9a6687cc95 100755 --- a/generation/hermetic_library_generation.sh +++ b/generation/hermetic_library_generation.sh @@ -70,7 +70,7 @@ if [ -z "${generation_config}" ]; then echo "Use default generation config: ${generation_config}" fi -workspace_name="/workspace/repo" +workspace_name="/workspace" baseline_generation_config="baseline_generation_config.yaml" message="chore: generate libraries at $(date)" @@ -93,8 +93,7 @@ docker run \ -v "$(pwd):${workspace_name}" \ gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \ --baseline-generation-config-path="${workspace_name}/${baseline_generation_config}" \ - --current-generation-config-path="${workspace_name}/${generation_config}" \ - --repository-path="${workspace_name}" + --current-generation-config-path="${workspace_name}/${generation_config}" # commit the change to the pull request. git add java-* pom.xml gapic-libraries-bom/pom.xml versions.txt changed_files=$(git diff --cached --name-only) From 1d3caed6359f0c3d5f9e37ea5f55d21f811f7806 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 17:46:51 +0000 Subject: [PATCH 05/14] add another test for config change --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index 1831a373aea0..14917eddad46 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -25,7 +25,7 @@ libraries: name_pretty: Access Approval product_documentation: https://cloud.google.com/access-approval/docs/ api_description: enables controlling access to your organization's data by Google - personnel. - test + personnel. - test2 release_level: stable GAPICs: - proto_path: google/cloud/accessapproval/v1 From e01a95db36248fb3f55ea0e6670bd814c52d2986 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 17:55:23 +0000 Subject: [PATCH 06/14] chore: generate libraries at Wed May 1 05:54:59 PM UTC 2024 --- java-accessapproval/.repo-metadata.json | 2 +- java-accessapproval/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java-accessapproval/.repo-metadata.json b/java-accessapproval/.repo-metadata.json index ce8049bfd4fa..adf69d564904 100644 --- a/java-accessapproval/.repo-metadata.json +++ b/java-accessapproval/.repo-metadata.json @@ -2,7 +2,7 @@ "api_shortname": "accessapproval", "name_pretty": "Access Approval", "product_documentation": "https://cloud.google.com/access-approval/docs/", - "api_description": "enables controlling access to your organization's data by Google personnel.", + "api_description": "enables controlling access to your organization's data by Google personnel. - test2", "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-accessapproval/latest/overview", "release_level": "stable", "transport": "both", diff --git a/java-accessapproval/README.md b/java-accessapproval/README.md index 0f852a9a6ea5..822ab5fcd5a4 100644 --- a/java-accessapproval/README.md +++ b/java-accessapproval/README.md @@ -85,7 +85,7 @@ to add `google-cloud-accessapproval` as a dependency in your code. ## About Access Approval -[Access Approval][product-docs] enables controlling access to your organization's data by Google personnel. +[Access Approval][product-docs] enables controlling access to your organization's data by Google personnel. - test2 See the [Access Approval client library docs][javadocs] to learn how to use this Access Approval Client Library. @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-accessapproval.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-accessapproval/2.42.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-accessapproval/2.43.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles From 6e4eb24970ecc97c2c408fc4723e264c47d5df38 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 17:58:43 +0000 Subject: [PATCH 07/14] use current user --- generation/hermetic_library_generation.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/generation/hermetic_library_generation.sh b/generation/hermetic_library_generation.sh index 6e9a6687cc95..b087a1af78eb 100755 --- a/generation/hermetic_library_generation.sh +++ b/generation/hermetic_library_generation.sh @@ -90,6 +90,7 @@ config_diff=$(diff "${generation_config}" "${baseline_generation_config}") # run hermetic code generation docker image. docker run \ --rm \ + -u "$(id -u):$(id -g)" \ -v "$(pwd):${workspace_name}" \ gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \ --baseline-generation-config-path="${workspace_name}/${baseline_generation_config}" \ From 34577f89164fa38a45da2a8d56337a9057df0809 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 17:59:17 +0000 Subject: [PATCH 08/14] restore test changes --- generation_config.yaml | 2 +- java-accessapproval/.repo-metadata.json | 2 +- java-accessapproval/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generation_config.yaml b/generation_config.yaml index 14917eddad46..feed5e964bac 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -25,7 +25,7 @@ libraries: name_pretty: Access Approval product_documentation: https://cloud.google.com/access-approval/docs/ api_description: enables controlling access to your organization's data by Google - personnel. - test2 + personnel. -test2 release_level: stable GAPICs: - proto_path: google/cloud/accessapproval/v1 diff --git a/java-accessapproval/.repo-metadata.json b/java-accessapproval/.repo-metadata.json index adf69d564904..c73836c3f77f 100644 --- a/java-accessapproval/.repo-metadata.json +++ b/java-accessapproval/.repo-metadata.json @@ -2,7 +2,7 @@ "api_shortname": "accessapproval", "name_pretty": "Access Approval", "product_documentation": "https://cloud.google.com/access-approval/docs/", - "api_description": "enables controlling access to your organization's data by Google personnel. - test2", + "api_description": "enables controlling access to your organization's data by Google personnel. -test2", "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-accessapproval/latest/overview", "release_level": "stable", "transport": "both", diff --git a/java-accessapproval/README.md b/java-accessapproval/README.md index 822ab5fcd5a4..e7d03827f214 100644 --- a/java-accessapproval/README.md +++ b/java-accessapproval/README.md @@ -85,7 +85,7 @@ to add `google-cloud-accessapproval` as a dependency in your code. ## About Access Approval -[Access Approval][product-docs] enables controlling access to your organization's data by Google personnel. - test2 +[Access Approval][product-docs] enables controlling access to your organization's data by Google personnel. -test2 See the [Access Approval client library docs][javadocs] to learn how to use this Access Approval Client Library. From c4014d778ad8f7490e5bbb5c1030cd5538c1308f Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 18:00:44 +0000 Subject: [PATCH 09/14] test change --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index feed5e964bac..4f99250cd856 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -25,7 +25,7 @@ libraries: name_pretty: Access Approval product_documentation: https://cloud.google.com/access-approval/docs/ api_description: enables controlling access to your organization's data by Google - personnel. -test2 + personnel. -test3 release_level: stable GAPICs: - proto_path: google/cloud/accessapproval/v1 From 60ef17647ebf5a1f3300048bc39b1b8decc3fd65 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 18:08:07 +0000 Subject: [PATCH 10/14] test change --- generation_config.yaml | 2 +- java-accessapproval/.OwlBot.hermetic.yaml | 35 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 java-accessapproval/.OwlBot.hermetic.yaml diff --git a/generation_config.yaml b/generation_config.yaml index 4f99250cd856..b8e28577f68a 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -25,7 +25,7 @@ libraries: name_pretty: Access Approval product_documentation: https://cloud.google.com/access-approval/docs/ api_description: enables controlling access to your organization's data by Google - personnel. -test3 + personnel. -test4 release_level: stable GAPICs: - proto_path: google/cloud/accessapproval/v1 diff --git a/java-accessapproval/.OwlBot.hermetic.yaml b/java-accessapproval/.OwlBot.hermetic.yaml new file mode 100644 index 000000000000..6f46436cbff4 --- /dev/null +++ b/java-accessapproval/.OwlBot.hermetic.yaml @@ -0,0 +1,35 @@ +# Copyright 2021 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. + + +deep-remove-regex: + - "/grpc-google-.*/src" + - "/proto-google-.*/src" + - "/google-.*/src" + - "/samples/snippets/generated" + +deep-preserve-regex: + - "/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/it" + +deep-copy-regex: +- source: "/google/cloud/accessapproval/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-accessapproval/$1/proto-google-cloud-accessapproval-$1/src" +- source: "/google/cloud/accessapproval/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-accessapproval/$1/grpc-google-cloud-accessapproval-$1/src" +- source: "/google/cloud/accessapproval/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-accessapproval/$1/google-cloud-accessapproval/src" +- source: "/google/cloud/accessapproval/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-accessapproval/$1/samples/snippets/generated" + +api-name: accessapproval From 30c697d939ee1a0224c2f6c56b9214056639033c Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 18:14:53 +0000 Subject: [PATCH 11/14] restore test changes --- java-accessapproval/.repo-metadata.json | 2 +- java-accessapproval/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java-accessapproval/.repo-metadata.json b/java-accessapproval/.repo-metadata.json index c73836c3f77f..ce8049bfd4fa 100644 --- a/java-accessapproval/.repo-metadata.json +++ b/java-accessapproval/.repo-metadata.json @@ -2,7 +2,7 @@ "api_shortname": "accessapproval", "name_pretty": "Access Approval", "product_documentation": "https://cloud.google.com/access-approval/docs/", - "api_description": "enables controlling access to your organization's data by Google personnel. -test2", + "api_description": "enables controlling access to your organization's data by Google personnel.", "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-accessapproval/latest/overview", "release_level": "stable", "transport": "both", diff --git a/java-accessapproval/README.md b/java-accessapproval/README.md index e7d03827f214..0f852a9a6ea5 100644 --- a/java-accessapproval/README.md +++ b/java-accessapproval/README.md @@ -85,7 +85,7 @@ to add `google-cloud-accessapproval` as a dependency in your code. ## About Access Approval -[Access Approval][product-docs] enables controlling access to your organization's data by Google personnel. -test2 +[Access Approval][product-docs] enables controlling access to your organization's data by Google personnel. See the [Access Approval client library docs][javadocs] to learn how to use this Access Approval Client Library. @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-accessapproval.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-accessapproval/2.43.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-accessapproval/2.42.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles From d065f894c0b1bd7bb71a82e54e58d18b942113fa Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 18:18:01 +0000 Subject: [PATCH 12/14] restore test changes 2 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index b8e28577f68a..d7e9ab6cb938 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -25,7 +25,7 @@ libraries: name_pretty: Access Approval product_documentation: https://cloud.google.com/access-approval/docs/ api_description: enables controlling access to your organization's data by Google - personnel. -test4 + personnel. release_level: stable GAPICs: - proto_path: google/cloud/accessapproval/v1 From 23fce07c9b98940b04a0c42ba0f27627813c127e Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 18:18:14 +0000 Subject: [PATCH 13/14] prepare for next release of library_generation --- .github/workflows/hermetic_library_generation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml index fb0e1bc65669..6dccee3ec852 100644 --- a/.github/workflows/hermetic_library_generation.yaml +++ b/.github/workflows/hermetic_library_generation.yaml @@ -24,7 +24,7 @@ jobs: library_generation: runs-on: ubuntu-latest env: - library_generation_image_tag: 2.39.0 + library_generation_image_tag: 2.40.0 steps: - uses: actions/checkout@v4 with: From 592204f82b83a2ce2742b21e1e0fc19139a005f5 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 1 May 2024 18:19:17 +0000 Subject: [PATCH 14/14] restore test changes 3 --- java-accessapproval/.OwlBot.hermetic.yaml | 35 ----------------------- 1 file changed, 35 deletions(-) delete mode 100644 java-accessapproval/.OwlBot.hermetic.yaml diff --git a/java-accessapproval/.OwlBot.hermetic.yaml b/java-accessapproval/.OwlBot.hermetic.yaml deleted file mode 100644 index 6f46436cbff4..000000000000 --- a/java-accessapproval/.OwlBot.hermetic.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2021 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. - - -deep-remove-regex: - - "/grpc-google-.*/src" - - "/proto-google-.*/src" - - "/google-.*/src" - - "/samples/snippets/generated" - -deep-preserve-regex: - - "/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/it" - -deep-copy-regex: -- source: "/google/cloud/accessapproval/(v.*)/.*-java/proto-google-.*/src" - dest: "/owl-bot-staging/java-accessapproval/$1/proto-google-cloud-accessapproval-$1/src" -- source: "/google/cloud/accessapproval/(v.*)/.*-java/grpc-google-.*/src" - dest: "/owl-bot-staging/java-accessapproval/$1/grpc-google-cloud-accessapproval-$1/src" -- source: "/google/cloud/accessapproval/(v.*)/.*-java/gapic-google-.*/src" - dest: "/owl-bot-staging/java-accessapproval/$1/google-cloud-accessapproval/src" -- source: "/google/cloud/accessapproval/(v.*)/.*-java/samples/snippets/generated" - dest: "/owl-bot-staging/java-accessapproval/$1/samples/snippets/generated" - -api-name: accessapproval