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

Commit 053e3eb

Browse files
Merge branch 'main' into patch-1
2 parents b40e73a + 33195d3 commit 053e3eb

744 files changed

Lines changed: 119584 additions & 18116 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.
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
15-
docker:
16-
image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest"
17-
1814
deep-remove-regex:
1915
- "/grpc-google-.*/src"
2016
- "/proto-google-.*/src"
@@ -34,4 +30,4 @@ deep-copy-regex:
3430
- source: "/google/bigtable/admin/(v\\d)/.*-java/grpc-google-.*/src"
3531
dest: "/owl-bot-staging/$1/grpc-google-cloud-bigtable-admin-$1/src"
3632
- source: "/google/bigtable/admin/(v\\d)/.*-java/gapic-google-.*/src"
37-
dest: "/owl-bot-staging/$1/google-cloud-bigtable/src"
33+
dest: "/owl-bot-staging/$1/google-cloud-bigtable/src"

.github/.OwlBot.lock.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.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
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
#!/bin/bash
2+
set -ex
3+
# This script should be run at the root of the repository.
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.
7+
8+
# The following commands need to be installed before running the script:
9+
# 1. git
10+
# 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+
}
49+
50+
# The parameters of this script is:
51+
# 1. base_branch, the base branch of the result pull request.
52+
# 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java
53+
# 3. [optional] generation_config, the path to the generation configuration,
54+
# 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.
57+
while [[ $# -gt 0 ]]; do
58+
key="$1"
59+
case "${key}" in
60+
--base_branch)
61+
base_branch="$2"
62+
shift
63+
;;
64+
--repo)
65+
repo="$2"
66+
shift
67+
;;
68+
--generation_config)
69+
generation_config="$2"
70+
shift
71+
;;
72+
--workflow)
73+
workflow="$2"
74+
shift
75+
;;
76+
*)
77+
echo "Invalid option: [$1]"
78+
exit 1
79+
;;
80+
esac
81+
shift
82+
done
83+
84+
if [ -z "${base_branch}" ]; then
85+
echo "missing required argument --base_branch"
86+
exit 1
87+
fi
88+
89+
if [ -z "${repo}" ]; then
90+
echo "missing required argument --repo"
91+
exit 1
92+
fi
93+
94+
if [ -z "${generation_config}" ]; then
95+
generation_config="generation_config.yaml"
96+
echo "Use default generation config: ${generation_config}"
97+
fi
98+
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+
104+
current_branch="generate-libraries-${base_branch}"
105+
title="chore: Update generation configuration at $(date)"
106+
107+
git checkout "${base_branch}"
108+
# Try to find a open pull request associated with the branch
109+
pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number")
110+
# Create a branch if there's no open pull request associated with the
111+
# branch; otherwise checkout the pull request.
112+
if [ -z "${pr_num}" ]; then
113+
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}"
117+
else
118+
gh pr checkout "${pr_num}"
119+
fi
120+
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+
125+
mkdir tmp-googleapis
126+
# Use partial clone because only commit history is needed.
127+
git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis
128+
pushd tmp-googleapis
129+
git pull
130+
latest_commit=$(git rev-parse HEAD)
131+
popd
132+
rm -rf tmp-googleapis
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}"
147+
148+
git add "${generation_config}" "${workflow}"
149+
changed_files=$(git diff --cached --name-only)
150+
if [[ "${changed_files}" == "" ]]; then
151+
echo "The latest generation config is not changed."
152+
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"
166+
exit 0
167+
fi
168+
169+
if [ -z "${pr_num}" ]; then
170+
git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git"
171+
git fetch -q remote_repo
172+
git push -f remote_repo "${current_branch}"
173+
gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}"
174+
else
175+
git push
176+
gh pr edit "${pr_num}" --title "${title}" --body "${title}"
177+
fi

.github/sync-repo-settings.yaml

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ branchProtectionRules:
1515
- units (11)
1616
- 'Kokoro - Test: Integration'
1717
- cla/google
18-
- OwlBot Post Processor
19-
- 'Kokoro - Test: Java GraalVM Native Image'
20-
- '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'
2121
- javadoc
2222
- conformance
23+
- library_generation
24+
- unmanaged_dependency_check
2325
- pattern: 1.22.0-sp
2426
isAdminEnforced: true
2527
requiredApprovingReviewCount: 1
@@ -105,7 +107,6 @@ branchProtectionRules:
105107
- units (11)
106108
- 'Kokoro - Test: Integration'
107109
- cla/google
108-
- OwlBot Post Processor
109110
- 'Kokoro - Test: Java GraalVM Native Image'
110111
- 'Kokoro - Test: Java 17 GraalVM Native Image'
111112
- pattern: 2.25.x
@@ -121,7 +122,6 @@ branchProtectionRules:
121122
- units (11)
122123
- 'Kokoro - Test: Integration'
123124
- cla/google
124-
- OwlBot Post Processor
125125
- 'Kokoro - Test: Java GraalVM Native Image'
126126
- 'Kokoro - Test: Java 17 GraalVM Native Image'
127127
- pattern: 2.30.x
@@ -137,7 +137,6 @@ branchProtectionRules:
137137
- units (11)
138138
- 'Kokoro - Test: Integration'
139139
- cla/google
140-
- OwlBot Post Processor
141140
- 'Kokoro - Test: Java GraalVM Native Image'
142141
- 'Kokoro - Test: Java 17 GraalVM Native Image'
143142
- javadoc
@@ -155,11 +154,71 @@ branchProtectionRules:
155154
- units (11)
156155
- 'Kokoro - Test: Integration'
157156
- cla/google
158-
- OwlBot Post Processor
159157
- 'Kokoro - Test: Java GraalVM Native Image'
160158
- 'Kokoro - Test: Java 17 GraalVM Native Image'
161159
- javadoc
162160
- 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
163222
permissionRules:
164223
- team: yoshi-admins
165224
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:

0 commit comments

Comments
 (0)