From ed55172e098ece24d85f0628dc1d17ff1fa8e8c0 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Fri, 6 Dec 2024 02:29:25 +0000 Subject: [PATCH 01/11] chore: Update generation configuration at Fri Dec 6 02:29:18 UTC 2024 --- generation_config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generation_config.yaml b/generation_config.yaml index f1a22f1f56..565d9161b2 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ gapic_generator_version: 2.50.0 -googleapis_commitish: 9ea2c56cb70d70f10fd2bef310ac9febe8d42d30 -libraries_bom_version: 26.50.0 +googleapis_commitish: 3be31fed1e19de78da8ae8a7f074ecaae5d1db60 +libraries_bom_version: 26.51.0 libraries: - api_shortname: bigquerystorage name_pretty: BigQuery Storage From 247ef1c01d0efc54d258c83a5d7d1b302e30c717 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Fri, 6 Dec 2024 02:31:36 +0000 Subject: [PATCH 02/11] chore: generate libraries at Fri Dec 6 02:29:56 UTC 2024 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea3d105936..2538064a03 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.50.0') +implementation platform('com.google.cloud:libraries-bom:26.51.0') implementation 'com.google.cloud:google-cloud-bigquerystorage' ``` From d589c32ffae5cf716237a3879625549bc8df3c9f Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Sat, 7 Dec 2024 02:28:45 +0000 Subject: [PATCH 03/11] chore: Update generation configuration at Sat Dec 7 02:28:35 UTC 2024 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index 565d9161b2..4c2be4547f 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.50.0 -googleapis_commitish: 3be31fed1e19de78da8ae8a7f074ecaae5d1db60 +googleapis_commitish: 0f3a20ebd29fb1deb2bd1f75c7ba55500d35457d libraries_bom_version: 26.51.0 libraries: - api_shortname: bigquerystorage From b9b9df1b2fdfb71dc64fa0f0f570de23b00fe1be Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Tue, 10 Dec 2024 02:30:26 +0000 Subject: [PATCH 04/11] chore: Update generation configuration at Tue Dec 10 02:30:17 UTC 2024 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index 4c2be4547f..a614514f20 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.50.0 -googleapis_commitish: 0f3a20ebd29fb1deb2bd1f75c7ba55500d35457d +googleapis_commitish: 5d5b1bf126485b0e2c972bac41b376438601e266 libraries_bom_version: 26.51.0 libraries: - api_shortname: bigquerystorage From d9a21ad954b1a05308afbe2d93ea850f627a8c6d Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Wed, 11 Dec 2024 02:29:35 +0000 Subject: [PATCH 05/11] chore: Update generation configuration at Wed Dec 11 02:29:28 UTC 2024 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index a614514f20..a4f76b8211 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.50.0 -googleapis_commitish: 5d5b1bf126485b0e2c972bac41b376438601e266 +googleapis_commitish: 798bd23a97e0c6a2582a4b442c09523b1325b533 libraries_bom_version: 26.51.0 libraries: - api_shortname: bigquerystorage From 4ef79d9999e59eabec8296238d4f721806cb8f99 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Thu, 12 Dec 2024 02:29:37 +0000 Subject: [PATCH 06/11] chore: Update generation configuration at Thu Dec 12 02:29:27 UTC 2024 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index a4f76b8211..c4714937e8 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.50.0 -googleapis_commitish: 798bd23a97e0c6a2582a4b442c09523b1325b533 +googleapis_commitish: d1695384cf03b73ed0d14bdf3c664be82eb5f42a libraries_bom_version: 26.51.0 libraries: - api_shortname: bigquerystorage From c4055c4b6738be8920c892bcb4889e594e5ade7d Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Thu, 12 Dec 2024 22:48:39 +0000 Subject: [PATCH 07/11] chore: Update generation configuration at Thu Dec 12 22:48:29 UTC 2024 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index c4714937e8..367e516c0e 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.50.0 -googleapis_commitish: d1695384cf03b73ed0d14bdf3c664be82eb5f42a +googleapis_commitish: 7d0c6bee2517d77635beb2a1dd6d6e7d4d943512 libraries_bom_version: 26.51.0 libraries: - api_shortname: bigquerystorage From bcce84ed3e5a9cbfe11172e8c24e12352b1ee4f0 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 12 Dec 2024 17:56:59 -0500 Subject: [PATCH 08/11] update workflow script --- .github/scripts/update_generation_config.sh | 63 ++++++++++++++++++--- 1 file changed, 55 insertions(+), 8 deletions(-) diff --git a/.github/scripts/update_generation_config.sh b/.github/scripts/update_generation_config.sh index 561a313040..91434688cc 100644 --- a/.github/scripts/update_generation_config.sh +++ b/.github/scripts/update_generation_config.sh @@ -28,11 +28,23 @@ function update_config() { sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}" } +# Update an action to a new version in GitHub action. +function update_action() { + local key_word=$1 + local new_value=$2 + local file=$3 + echo "Update ${key_word} to ${new_value} in ${file}" + # use a different delimiter because the key_word contains "/". + sed -i -e "s|${key_word}@v.*$|${key_word}@v${new_value}|" "${file}" +} + # The parameters of this script is: # 1. base_branch, the base branch of the result pull request. # 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java # 3. [optional] generation_config, the path to the generation configuration, # the default value is generation_config.yaml in the repository root. +# 4. [optional] workflow, the library generation workflow file, +# the default value is .github/workflows/hermetic_library_generation.yaml. while [[ $# -gt 0 ]]; do key="$1" case "${key}" in @@ -48,6 +60,10 @@ case "${key}" in generation_config="$2" shift ;; + --workflow) + workflow="$2" + shift + ;; *) echo "Invalid option: [$1]" exit 1 @@ -71,21 +87,34 @@ if [ -z "${generation_config}" ]; then echo "Use default generation config: ${generation_config}" fi +if [ -z "${workflow}" ]; then + workflow=".github/workflows/hermetic_library_generation.yaml" + echo "Use default library generation workflow file: ${workflow}" +fi + current_branch="generate-libraries-${base_branch}" title="chore: Update generation configuration at $(date)" -# try to find a open pull request associated with the branch +git checkout "${base_branch}" +# Try to find a open pull request associated with the branch pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") -# create a branch if there's no open pull request associated with the +# Create a branch if there's no open pull request associated with the # branch; otherwise checkout the pull request. if [ -z "${pr_num}" ]; then git checkout -b "${current_branch}" + # Push the current branch to remote so that we can + # compare the commits later. + git push -u origin "${current_branch}" else gh pr checkout "${pr_num}" fi +# Only allow fast-forward merging; exit with non-zero result if there's merging +# conflict. +git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}" + mkdir tmp-googleapis -# use partial clone because only commit history is needed. +# Use partial clone because only commit history is needed. git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis pushd tmp-googleapis git pull @@ -94,25 +123,43 @@ popd rm -rf tmp-googleapis update_config "googleapis_commitish" "${latest_commit}" "${generation_config}" -# update gapic-generator-java version to the latest +# Update gapic-generator-java version to the latest latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java") update_config "gapic_generator_version" "${latest_version}" "${generation_config}" -# update libraries-bom version to the latest +# Update composite action version to latest gapic-generator-java version +update_action "googleapis/sdk-platform-java/.github/scripts" \ + "${latest_version}" \ + "${workflow}" + +# Update libraries-bom version to the latest latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom") update_config "libraries_bom_version" "${latest_version}" "${generation_config}" -git add "${generation_config}" +git add "${generation_config}" "${workflow}" changed_files=$(git diff --cached --name-only) if [[ "${changed_files}" == "" ]]; then echo "The latest generation config is not changed." echo "Skip committing to the pull request." +else + git commit -m "${title}" +fi + +# There are potentially at most two commits: merge commit and change commit. +# We want to exit the script if no commit happens (otherwise this will be an +# infinite loop). +# `git cherry` is a way to find whether the local branch has commits that are +# not in the remote branch. +# If we find any such commit, push them to remote branch. +unpushed_commit=$(git cherry -v "origin/${current_branch}" | wc -l) +if [[ "${unpushed_commit}" -eq 0 ]]; then + echo "No unpushed commits, exit" exit 0 fi -git commit -m "${title}" + if [ -z "${pr_num}" ]; then git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git" - git fetch -q --unshallow remote_repo + git fetch -q remote_repo git push -f remote_repo "${current_branch}" gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}" else From 387a265060dcc1d2eefa005f4a65efe1ae9295b1 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 12 Dec 2024 17:57:13 -0500 Subject: [PATCH 09/11] update generation config --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index 367e516c0e..d506a228ff 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,4 +1,4 @@ -gapic_generator_version: 2.50.0 +gapic_generator_version: 2.51.0 googleapis_commitish: 7d0c6bee2517d77635beb2a1dd6d6e7d4d943512 libraries_bom_version: 26.51.0 libraries: From 39b562e75c74525691cc9ef43a790140fb7e39ae Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 12 Dec 2024 17:59:01 -0500 Subject: [PATCH 10/11] update renovate --- renovate.json | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/renovate.json b/renovate.json index 4b48f48dd6..154cbe8927 100644 --- a/renovate.json +++ b/renovate.json @@ -29,16 +29,6 @@ "matchStrings": ["uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v(?.+?)\\n"], "depNameTemplate": "com.google.cloud:sdk-platform-java-config", "datasourceTemplate": "maven" - }, - { - "fileMatch": [ - ".github/workflows/hermetic_library_generation.yaml" - ], - "matchStrings": [ - "uses: googleapis/sdk-platform-java/.github/scripts@v(?.+?)\\n" - ], - "depNameTemplate": "com.google.api:gapic-generator-java", - "datasourceTemplate": "maven" } ], "packageRules": [ @@ -99,14 +89,6 @@ "^com.google.cloud:google-cloud-" ], "ignoreUnstable": false - }, - { - "packagePatterns": [ - "^com.google.api:gapic-generator-java", - "^com.google.cloud:sdk-platform-java-config", - "^com.google.cloud:gapic-libraries-bom" - ], - "groupName": "sdk-platform-java dependencies" } ], "semanticCommits": true, From bed4190ce3c9b0a7fe42a4ee2bb0f5d7794b07e0 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Thu, 12 Dec 2024 23:01:39 +0000 Subject: [PATCH 11/11] chore: generate libraries at Thu Dec 12 23:00:01 UTC 2024 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2538064a03..010a875c40 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,14 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.50.0 + 26.51.0 pom import io.opentelemetry opentelemetry-bom - 1.44.1 + 1.45.0 pom import