From d1d7a15078cebaa2d11d652e0e3df0e484a71b50 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Wed, 4 Dec 2024 02:29:54 +0000 Subject: [PATCH 01/13] chore: Update generation configuration at Wed Dec 4 02:29:45 UTC 2024 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index c885f1fb1..7acc81359 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.50.0 -googleapis_commitish: 349841abac6c3e580ccce6e3d6fcc182ed2512c2 +googleapis_commitish: 608531f2fa278d8cdf362c1b04550c5b5f2a1599 libraries_bom_version: 26.50.0 template_excludes: - .gitignore From 5b496e8a118f9e4f8016f8a1eac6fc5c0bc7d3e4 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Wed, 4 Dec 2024 02:32:19 +0000 Subject: [PATCH 02/13] chore: generate libraries at Wed Dec 4 02:30:21 UTC 2024 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 837665a4a..111bc7245 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigtable - 2.40.0 + 2.48.0 ``` From 5934c78254620a50e4811e15564d1ccc63e5062a Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Thu, 5 Dec 2024 02:30:00 +0000 Subject: [PATCH 03/13] chore: Update generation configuration at Thu Dec 5 02:29:53 UTC 2024 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index 7acc81359..923248683 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.50.0 -googleapis_commitish: 608531f2fa278d8cdf362c1b04550c5b5f2a1599 +googleapis_commitish: 9ea2c56cb70d70f10fd2bef310ac9febe8d42d30 libraries_bom_version: 26.50.0 template_excludes: - .gitignore From 611afd20d18869f090d39c55749175a118645516 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Fri, 6 Dec 2024 02:29:31 +0000 Subject: [PATCH 04/13] chore: Update generation configuration at Fri Dec 6 02:29:21 UTC 2024 --- generation_config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generation_config.yaml b/generation_config.yaml index 923248683..941a70e01 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 template_excludes: - .gitignore - .kokoro/presubmit/integration.cfg From 3be0b9ff7b0e7000357a65ba81e70988d6db78c0 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Fri, 6 Dec 2024 02:31:45 +0000 Subject: [PATCH 05/13] chore: generate libraries at Fri Dec 6 02:29:58 UTC 2024 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 111bc7245..61049e305 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,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-bigtable' ``` From e2d678b6742ee3cee31bf536a683ae947ac82eea Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Sat, 7 Dec 2024 02:28:49 +0000 Subject: [PATCH 06/13] chore: Update generation configuration at Sat Dec 7 02:28:39 UTC 2024 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index 941a70e01..7acfea399 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 template_excludes: - .gitignore From 6e183b0f30bd9abc87e78d6cd35cb683f9faef26 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Tue, 10 Dec 2024 02:30:27 +0000 Subject: [PATCH 07/13] chore: Update generation configuration at Tue Dec 10 02:30:19 UTC 2024 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index 7acfea399..de437da2b 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 template_excludes: - .gitignore From 397946df6daa47e9acc0027e106ff5b295467804 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Wed, 11 Dec 2024 02:29:44 +0000 Subject: [PATCH 08/13] chore: Update generation configuration at Wed Dec 11 02:29:32 UTC 2024 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index de437da2b..7664dedb1 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 template_excludes: - .gitignore From a38778e61fd4e3309dfb7cde9fb92f587667ab34 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Thu, 12 Dec 2024 02:29:37 +0000 Subject: [PATCH 09/13] chore: Update generation configuration at Thu Dec 12 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 7664dedb1..db1b3b2e2 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 template_excludes: - .gitignore From a1b753177fff1b4d93f6490eecdb114867f66e4d Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Fri, 13 Dec 2024 02:30:03 +0000 Subject: [PATCH 10/13] chore: Update generation configuration at Fri Dec 13 02:29:53 UTC 2024 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index db1b3b2e2..5b12f6857 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 template_excludes: - .gitignore From ecf38fd8142365cf6432868277ad912544142e42 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Sat, 14 Dec 2024 02:28:06 +0000 Subject: [PATCH 11/13] chore: Update generation configuration at Sat Dec 14 02:27:56 UTC 2024 --- generation_config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generation_config.yaml b/generation_config.yaml index 5b12f6857..d150ade6e 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ -gapic_generator_version: 2.50.0 -googleapis_commitish: 7d0c6bee2517d77635beb2a1dd6d6e7d4d943512 +gapic_generator_version: 2.51.0 +googleapis_commitish: f4eff5440fd07389f820d22d2a55690c6390dc6d libraries_bom_version: 26.51.0 template_excludes: - .gitignore From 38d125bdd56a159327d9131912c2d0e77609d38f Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 16 Dec 2024 18:47:30 -0500 Subject: [PATCH 12/13] update workflow script --- .github/scripts/update_generation_config.sh | 72 +++++++++------------ 1 file changed, 32 insertions(+), 40 deletions(-) diff --git a/.github/scripts/update_generation_config.sh b/.github/scripts/update_generation_config.sh index 93e1a47be..2acad0485 100644 --- a/.github/scripts/update_generation_config.sh +++ b/.github/scripts/update_generation_config.sh @@ -1,32 +1,12 @@ #!/bin/bash -set -ex +set -e # This script should be run at the root of the repository. -# This script is used to update googleapis_commitish, gapic_generator_version, -# and libraries_bom_version in generation configuration at the time of running -# and create a pull request. +# This script is used to update googleapis commit to latest in generation +# configuration at the time of running and create a pull request. # The following commands need to be installed before running the script: # 1. git # 2. gh -# 3. jq - -# Utility functions -# Get the latest released version of a Maven artifact. -function get_latest_released_version() { - local group_id=$1 - local artifact_id=$2 - latest=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json" | jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' | sort -V | tail -n 1) - echo "${latest}" -} - -# Update a key to a new value in the generation config. -function update_config() { - local key_word=$1 - local new_value=$2 - local file=$3 - echo "Update ${key_word} to ${new_value} in ${file}" - sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}" -} # The parameters of this script is: # 1. base_branch, the base branch of the result pull request. @@ -72,50 +52,62 @@ if [ -z "${generation_config}" ]; then fi current_branch="generate-libraries-${base_branch}" -title="chore: Update generation configuration at $(date)" +title="chore: update googleapis commit 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 latest_commit=$(git rev-parse HEAD) popd rm -rf tmp-googleapis -update_config "googleapis_commitish" "${latest_commit}" "${generation_config}" - -# 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 -latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom") -update_config "libraries_bom_version" "${latest_version}" "${generation_config}" +sed -i -e "s/^googleapis_commitish.*$/googleapis_commitish: ${latest_commit}/" "${generation_config}" git add "${generation_config}" changed_files=$(git diff --cached --name-only) if [[ "${changed_files}" == "" ]]; then - echo "The latest generation config is not changed." + echo "The latest googleapis commit 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 git push - gh pr edit "${pr_num}" --title "${title}" --body "${title}" fi From 34db810a51db4aae75834a87baa5e8622bbda998 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 16 Dec 2024 18:49:08 -0500 Subject: [PATCH 13/13] update renovate --- renovate.json | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/renovate.json b/renovate.json index 3c5874c1a..837f09eaa 100644 --- a/renovate.json +++ b/renovate.json @@ -73,11 +73,10 @@ }, { "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" + "groupName": "shared dependencies" } ], "regexManagers": [ @@ -109,16 +108,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" } ], "semanticCommits": true,