Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit b5ba6b8

Browse files
Merge branch 'main' into renovate/io.grpc-protoc-gen-grpc-java-1.x
2 parents 0b4785a + 33195d3 commit b5ba6b8

701 files changed

Lines changed: 112055 additions & 15626 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/generated-files-bot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ externalManifests:
66
file: '.github/readme/synth.metadata/synth.metadata'
77
jsonpath: '$.generatedFiles[*]'
88
ignoreAuthors:
9+
- 'cloud-java-bot'
910
- 'renovate-bot'
1011
- 'yoshi-automation'
1112
- 'release-please[bot]'

.github/release-please.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,26 @@ branches:
6565
- >-
6666
google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java
6767
branch: 2.39.x
68+
- bumpMinorPreMajor: true
69+
handleGHRelease: true
70+
releaseType: java-backport
71+
extraFiles:
72+
- >-
73+
google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java
74+
branch: 2.54.x
75+
- bumpMinorPreMajor: true
76+
handleGHRelease: true
77+
releaseType: java-backport
78+
extraFiles:
79+
- >-
80+
google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java
81+
branch: 2.61.x
82+
- bumpMinorPreMajor: true
83+
handleGHRelease: true
84+
releaseType: java-backport
85+
extraFiles:
86+
- >-
87+
google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java
88+
branch: 2.60.x
6889
extraFiles:
6990
- google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java

.github/scripts/update_generation_config.sh

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,17 @@ set -ex
1515
function get_latest_released_version() {
1616
local group_id=$1
1717
local artifact_id=$2
18-
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)
19-
echo "${latest}"
18+
group_id_url_path="$(sed 's|\.|/|g' <<< "${group_id}")"
19+
url="https://repo1.maven.org/maven2/${group_id_url_path}/${artifact_id}/maven-metadata.xml"
20+
xml_content=$(curl -s --fail "${url}")
21+
latest=$(xmllint --xpath 'metadata/versioning/latest/text()' - <<< "${xml_content}")
22+
if [[ -z "${latest}" ]]; then
23+
echo "The latest version of ${group_id}:${artifact_id} is empty."
24+
echo "The returned json from maven.org is invalid: ${json_content}"
25+
exit 1
26+
else
27+
echo "${latest}"
28+
fi
2029
}
2130

2231
# Update a key to a new value in the generation config.
@@ -28,11 +37,23 @@ function update_config() {
2837
sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}"
2938
}
3039

40+
# Update an action to a new version in GitHub action.
41+
function update_action() {
42+
local key_word=$1
43+
local new_value=$2
44+
local file=$3
45+
echo "Update ${key_word} to ${new_value} in ${file}"
46+
# use a different delimiter because the key_word contains "/".
47+
sed -i -e "s|${key_word}@v.*$|${key_word}@v${new_value}|" "${file}"
48+
}
49+
3150
# The parameters of this script is:
3251
# 1. base_branch, the base branch of the result pull request.
3352
# 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java
3453
# 3. [optional] generation_config, the path to the generation configuration,
3554
# the default value is generation_config.yaml in the repository root.
55+
# 4. [optional] workflow, the library generation workflow file,
56+
# the default value is .github/workflows/hermetic_library_generation.yaml.
3657
while [[ $# -gt 0 ]]; do
3758
key="$1"
3859
case "${key}" in
@@ -48,6 +69,10 @@ case "${key}" in
4869
generation_config="$2"
4970
shift
5071
;;
72+
--workflow)
73+
workflow="$2"
74+
shift
75+
;;
5176
*)
5277
echo "Invalid option: [$1]"
5378
exit 1
@@ -71,21 +96,34 @@ if [ -z "${generation_config}" ]; then
7196
echo "Use default generation config: ${generation_config}"
7297
fi
7398

99+
if [ -z "${workflow}" ]; then
100+
workflow=".github/workflows/hermetic_library_generation.yaml"
101+
echo "Use default library generation workflow file: ${workflow}"
102+
fi
103+
74104
current_branch="generate-libraries-${base_branch}"
75105
title="chore: Update generation configuration at $(date)"
76106

77-
# try to find a open pull request associated with the branch
107+
git checkout "${base_branch}"
108+
# Try to find a open pull request associated with the branch
78109
pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number")
79-
# create a branch if there's no open pull request associated with the
110+
# Create a branch if there's no open pull request associated with the
80111
# branch; otherwise checkout the pull request.
81112
if [ -z "${pr_num}" ]; then
82113
git checkout -b "${current_branch}"
114+
# Push the current branch to remote so that we can
115+
# compare the commits later.
116+
git push -u origin "${current_branch}"
83117
else
84118
gh pr checkout "${pr_num}"
85119
fi
86120

121+
# Only allow fast-forward merging; exit with non-zero result if there's merging
122+
# conflict.
123+
git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}"
124+
87125
mkdir tmp-googleapis
88-
# use partial clone because only commit history is needed.
126+
# Use partial clone because only commit history is needed.
89127
git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis
90128
pushd tmp-googleapis
91129
git pull
@@ -94,25 +132,43 @@ popd
94132
rm -rf tmp-googleapis
95133
update_config "googleapis_commitish" "${latest_commit}" "${generation_config}"
96134

97-
# update gapic-generator-java version to the latest
135+
# Update gapic-generator-java version to the latest
98136
latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java")
99137
update_config "gapic_generator_version" "${latest_version}" "${generation_config}"
100138

101-
# update libraries-bom version to the latest
139+
# Update composite action version to latest gapic-generator-java version
140+
update_action "googleapis/sdk-platform-java/.github/scripts" \
141+
"${latest_version}" \
142+
"${workflow}"
143+
144+
# Update libraries-bom version to the latest
102145
latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom")
103146
update_config "libraries_bom_version" "${latest_version}" "${generation_config}"
104147

105-
git add "${generation_config}"
148+
git add "${generation_config}" "${workflow}"
106149
changed_files=$(git diff --cached --name-only)
107150
if [[ "${changed_files}" == "" ]]; then
108151
echo "The latest generation config is not changed."
109152
echo "Skip committing to the pull request."
153+
else
154+
git commit -m "${title}"
155+
fi
156+
157+
# There are potentially at most two commits: merge commit and change commit.
158+
# We want to exit the script if no commit happens (otherwise this will be an
159+
# infinite loop).
160+
# `git cherry` is a way to find whether the local branch has commits that are
161+
# not in the remote branch.
162+
# If we find any such commit, push them to remote branch.
163+
unpushed_commit=$(git cherry -v "origin/${current_branch}" | wc -l)
164+
if [[ "${unpushed_commit}" -eq 0 ]]; then
165+
echo "No unpushed commits, exit"
110166
exit 0
111167
fi
112-
git commit -m "${title}"
168+
113169
if [ -z "${pr_num}" ]; then
114170
git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git"
115-
git fetch -q --unshallow remote_repo
171+
git fetch -q remote_repo
116172
git push -f remote_repo "${current_branch}"
117173
gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}"
118174
else

.github/sync-repo-settings.yaml

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ branchProtectionRules:
1515
- units (11)
1616
- 'Kokoro - Test: Integration'
1717
- cla/google
18-
- 'Kokoro - Test: Java GraalVM Native Image'
19-
- 'Kokoro - Test: Java 17 GraalVM Native Image'
18+
- 'Kokoro - Test: Java GraalVM Native Image A'
19+
- 'Kokoro - Test: Java GraalVM Native Image B'
20+
- 'Kokoro - Test: Java GraalVM Native Image C'
2021
- javadoc
2122
- conformance
2223
- library_generation
@@ -157,6 +158,67 @@ branchProtectionRules:
157158
- 'Kokoro - Test: Java 17 GraalVM Native Image'
158159
- javadoc
159160
- conformance
161+
- pattern: 2.54.x
162+
isAdminEnforced: true
163+
requiredApprovingReviewCount: 1
164+
requiresCodeOwnerReviews: true
165+
requiresStrictStatusChecks: false
166+
requiredStatusCheckContexts:
167+
- dependencies (17)
168+
- lint
169+
- clirr
170+
- units (8)
171+
- units (11)
172+
- 'Kokoro - Test: Integration'
173+
- cla/google
174+
- 'Kokoro - Test: Java GraalVM Native Image'
175+
- 'Kokoro - Test: Java 17 GraalVM Native Image'
176+
- javadoc
177+
- conformance
178+
- library_generation
179+
- unmanaged_dependency_check
180+
- pattern: 2.61.x
181+
isAdminEnforced: true
182+
requiredApprovingReviewCount: 1
183+
requiresCodeOwnerReviews: true
184+
requiresStrictStatusChecks: false
185+
requiredStatusCheckContexts:
186+
- dependencies (17)
187+
- lint
188+
- clirr
189+
- units (8)
190+
- units (11)
191+
- 'Kokoro - Test: Integration'
192+
- cla/google
193+
- 'Kokoro - Test: Java GraalVM Native Image A'
194+
- 'Kokoro - Test: Java GraalVM Native Image B'
195+
- 'Kokoro - Test: Java GraalVM Native Image C'
196+
- javadoc
197+
- conformance
198+
- library_generation
199+
- unmanaged_dependency_check
200+
- pattern: 2.60.x
201+
isAdminEnforced: true
202+
requiredApprovingReviewCount: 1
203+
requiresCodeOwnerReviews: true
204+
requiresStrictStatusChecks: false
205+
requiredStatusCheckContexts:
206+
- dependencies (17)
207+
- lint
208+
- clirr
209+
- units (11)
210+
- units (17)
211+
- units (21)
212+
- units (24)
213+
- 'Kokoro - Test: Integration'
214+
- cla/google
215+
- 'Kokoro - Test: Java GraalVM Native Image A'
216+
- 'Kokoro - Test: Java GraalVM Native Image B'
217+
- 'Kokoro - Test: Java GraalVM Native Image C'
218+
- javadoc
219+
- conformance
220+
- library_generation
221+
- unmanaged_dependency_check
160222
permissionRules:
161223
- team: yoshi-admins
162224
permission: admin

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
java: [11, 17, 21]
28+
java: [11, 17, 21, 25]
2929
steps:
3030
- uses: actions/checkout@v4
3131
- uses: actions/setup-java@v4
@@ -104,7 +104,7 @@ jobs:
104104
- uses: actions/setup-java@v4
105105
with:
106106
distribution: temurin
107-
java-version: 11
107+
java-version: 17
108108
- run: java -version
109109
- run: .kokoro/build.sh
110110
env:

.github/workflows/hermetic_library_generation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
fetch-depth: 0
3939
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
40-
- uses: googleapis/sdk-platform-java/.github/scripts@v2.50.0
40+
- uses: googleapis/sdk-platform-java/.github/scripts@v2.63.0
4141
if: env.SHOULD_RUN == 'true'
4242
with:
4343
base_ref: ${{ github.base_ref }}

.github/workflows/renovate_config_check.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
renovate_bot_config_validation:
10-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-24.04
1111

1212
steps:
1313
- name: Checkout code
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Node.js
1717
uses: actions/setup-node@v4
1818
with:
19-
node-version: '20'
19+
node-version: '22'
2020

2121
- name: Install Renovate and Config Validator
2222
run: |

.github/workflows/samples.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: actions/setup-java@v4
2525
with:
2626
distribution: temurin
27-
java-version: 8
27+
java-version: 17
2828
- name: Run checkstyle
2929
run: mvn -P lint --quiet --batch-mode checkstyle:check
3030
working-directory: samples/snippets

.github/workflows/unmanaged_dependency_check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
shell: bash
1515
run: .kokoro/build.sh
1616
- name: Unmanaged dependency check
17-
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.40.0
17+
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.54.1
1818
with:
1919
bom-path: google-cloud-bigtable-bom/pom.xml

.github/workflows/update_generation_config.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,27 @@ on:
2121

2222
jobs:
2323
update-generation-config:
24-
runs-on: ubuntu-22.04
24+
runs-on: ubuntu-24.04
2525
env:
2626
# the branch into which the pull request is merged
2727
base_branch: main
2828
steps:
2929
- uses: actions/checkout@v4
3030
with:
31+
fetch-depth: 0
3132
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
33+
- name: Install Dependencies
34+
shell: bash
35+
run: sudo apt-get update && sudo apt-get install -y libxml2-utils
3236
- name: Update params in generation config to latest
3337
shell: bash
3438
run: |
35-
set -ex
39+
set -x
3640
[ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com"
3741
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
3842
bash .github/scripts/update_generation_config.sh \
39-
--base_branch "${base_branch}"\
43+
--base_branch "${base_branch}" \
4044
--repo ${{ github.repository }}
4145
env:
4246
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
47+

0 commit comments

Comments
 (0)