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

Commit e7a78d4

Browse files
Merge branch 'main' into centralize-native-config
2 parents cf3f37d + f0537fc commit e7a78d4

619 files changed

Lines changed: 77725 additions & 12414 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: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,59 @@
11
#!/bin/bash
2-
set -e
2+
set -ex
33
# This script should be run at the root of the repository.
4-
# This script is used to update googleapis commit to latest in generation
5-
# configuration at the time of running and create a pull request.
4+
# This script is used to update googleapis_commitish, gapic_generator_version,
5+
# and libraries_bom_version in generation configuration at the time of running
6+
# and create a pull request.
67

78
# The following commands need to be installed before running the script:
89
# 1. git
910
# 2. gh
11+
# 3. jq
12+
13+
# Utility functions
14+
# Get the latest released version of a Maven artifact.
15+
function get_latest_released_version() {
16+
local group_id=$1
17+
local artifact_id=$2
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
29+
}
30+
31+
# Update a key to a new value in the generation config.
32+
function update_config() {
33+
local key_word=$1
34+
local new_value=$2
35+
local file=$3
36+
echo "Update ${key_word} to ${new_value} in ${file}"
37+
sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}"
38+
}
39+
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+
}
1049

1150
# The parameters of this script is:
1251
# 1. base_branch, the base branch of the result pull request.
1352
# 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java
1453
# 3. [optional] generation_config, the path to the generation configuration,
1554
# 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.
1657
while [[ $# -gt 0 ]]; do
1758
key="$1"
1859
case "${key}" in
@@ -28,6 +69,10 @@ case "${key}" in
2869
generation_config="$2"
2970
shift
3071
;;
72+
--workflow)
73+
workflow="$2"
74+
shift
75+
;;
3176
*)
3277
echo "Invalid option: [$1]"
3378
exit 1
@@ -51,8 +96,13 @@ if [ -z "${generation_config}" ]; then
5196
echo "Use default generation config: ${generation_config}"
5297
fi
5398

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+
54104
current_branch="generate-libraries-${base_branch}"
55-
title="chore: update googleapis commit at $(date)"
105+
title="chore: Update generation configuration at $(date)"
56106

57107
git checkout "${base_branch}"
58108
# Try to find a open pull request associated with the branch
@@ -80,12 +130,25 @@ git pull
80130
latest_commit=$(git rev-parse HEAD)
81131
popd
82132
rm -rf tmp-googleapis
83-
sed -i -e "s/^googleapis_commitish.*$/googleapis_commitish: ${latest_commit}/" "${generation_config}"
133+
update_config "googleapis_commitish" "${latest_commit}" "${generation_config}"
134+
135+
# Update gapic-generator-java version to the latest
136+
latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java")
137+
update_config "gapic_generator_version" "${latest_version}" "${generation_config}"
138+
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
145+
latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom")
146+
update_config "libraries_bom_version" "${latest_version}" "${generation_config}"
84147

85-
git add "${generation_config}"
148+
git add "${generation_config}" "${workflow}"
86149
changed_files=$(git diff --cached --name-only)
87150
if [[ "${changed_files}" == "" ]]; then
88-
echo "The latest googleapis commit is not changed."
151+
echo "The latest generation config is not changed."
89152
echo "Skip committing to the pull request."
90153
else
91154
git commit -m "${title}"
@@ -110,4 +173,5 @@ if [ -z "${pr_num}" ]; then
110173
gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}"
111174
else
112175
git push
176+
gh pr edit "${pr_num}" --title "${title}" --body "${title}"
113177
fi

.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, 24]
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.54.0
40+
- uses: googleapis/sdk-platform-java/.github/scripts@v2.61.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.44.0
17+
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.52.0
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)