Skip to content

Commit 0b4785a

Browse files
Merge branch 'main' into renovate/io.grpc-protoc-gen-grpc-java-1.x
2 parents 6a95b93 + 012aa27 commit 0b4785a

File tree

435 files changed

+8333
-3277
lines changed

Some content is hidden

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

435 files changed

+8333
-3277
lines changed

.github/.OwlBot.yaml renamed to .github/.OwlBot-hermetic.yaml

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.
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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+
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}"
20+
}
21+
22+
# Update a key to a new value in the generation config.
23+
function update_config() {
24+
local key_word=$1
25+
local new_value=$2
26+
local file=$3
27+
echo "Update ${key_word} to ${new_value} in ${file}"
28+
sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}"
29+
}
30+
31+
# The parameters of this script is:
32+
# 1. base_branch, the base branch of the result pull request.
33+
# 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java
34+
# 3. [optional] generation_config, the path to the generation configuration,
35+
# the default value is generation_config.yaml in the repository root.
36+
while [[ $# -gt 0 ]]; do
37+
key="$1"
38+
case "${key}" in
39+
--base_branch)
40+
base_branch="$2"
41+
shift
42+
;;
43+
--repo)
44+
repo="$2"
45+
shift
46+
;;
47+
--generation_config)
48+
generation_config="$2"
49+
shift
50+
;;
51+
*)
52+
echo "Invalid option: [$1]"
53+
exit 1
54+
;;
55+
esac
56+
shift
57+
done
58+
59+
if [ -z "${base_branch}" ]; then
60+
echo "missing required argument --base_branch"
61+
exit 1
62+
fi
63+
64+
if [ -z "${repo}" ]; then
65+
echo "missing required argument --repo"
66+
exit 1
67+
fi
68+
69+
if [ -z "${generation_config}" ]; then
70+
generation_config="generation_config.yaml"
71+
echo "Use default generation config: ${generation_config}"
72+
fi
73+
74+
current_branch="generate-libraries-${base_branch}"
75+
title="chore: Update generation configuration at $(date)"
76+
77+
# try to find a open pull request associated with the branch
78+
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
80+
# branch; otherwise checkout the pull request.
81+
if [ -z "${pr_num}" ]; then
82+
git checkout -b "${current_branch}"
83+
else
84+
gh pr checkout "${pr_num}"
85+
fi
86+
87+
mkdir tmp-googleapis
88+
# use partial clone because only commit history is needed.
89+
git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis
90+
pushd tmp-googleapis
91+
git pull
92+
latest_commit=$(git rev-parse HEAD)
93+
popd
94+
rm -rf tmp-googleapis
95+
update_config "googleapis_commitish" "${latest_commit}" "${generation_config}"
96+
97+
# update gapic-generator-java version to the latest
98+
latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java")
99+
update_config "gapic_generator_version" "${latest_version}" "${generation_config}"
100+
101+
# update libraries-bom version to the latest
102+
latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom")
103+
update_config "libraries_bom_version" "${latest_version}" "${generation_config}"
104+
105+
git add "${generation_config}"
106+
changed_files=$(git diff --cached --name-only)
107+
if [[ "${changed_files}" == "" ]]; then
108+
echo "The latest generation config is not changed."
109+
echo "Skip committing to the pull request."
110+
exit 0
111+
fi
112+
git commit -m "${title}"
113+
if [ -z "${pr_num}" ]; then
114+
git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git"
115+
git fetch -q --unshallow remote_repo
116+
git push -f remote_repo "${current_branch}"
117+
gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}"
118+
else
119+
git push
120+
gh pr edit "${pr_num}" --title "${title}" --body "${title}"
121+
fi

.github/sync-repo-settings.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ branchProtectionRules:
1515
- units (11)
1616
- 'Kokoro - Test: Integration'
1717
- cla/google
18-
- OwlBot Post Processor
1918
- 'Kokoro - Test: Java GraalVM Native Image'
2019
- 'Kokoro - Test: Java 17 GraalVM Native Image'
2120
- javadoc
2221
- conformance
22+
- library_generation
23+
- unmanaged_dependency_check
2324
- pattern: 1.22.0-sp
2425
isAdminEnforced: true
2526
requiredApprovingReviewCount: 1
@@ -105,7 +106,6 @@ branchProtectionRules:
105106
- units (11)
106107
- 'Kokoro - Test: Integration'
107108
- cla/google
108-
- OwlBot Post Processor
109109
- 'Kokoro - Test: Java GraalVM Native Image'
110110
- 'Kokoro - Test: Java 17 GraalVM Native Image'
111111
- pattern: 2.25.x
@@ -121,7 +121,6 @@ branchProtectionRules:
121121
- units (11)
122122
- 'Kokoro - Test: Integration'
123123
- cla/google
124-
- OwlBot Post Processor
125124
- 'Kokoro - Test: Java GraalVM Native Image'
126125
- 'Kokoro - Test: Java 17 GraalVM Native Image'
127126
- pattern: 2.30.x
@@ -137,7 +136,6 @@ branchProtectionRules:
137136
- units (11)
138137
- 'Kokoro - Test: Integration'
139138
- cla/google
140-
- OwlBot Post Processor
141139
- 'Kokoro - Test: Java GraalVM Native Image'
142140
- 'Kokoro - Test: Java 17 GraalVM Native Image'
143141
- javadoc
@@ -155,7 +153,6 @@ branchProtectionRules:
155153
- units (11)
156154
- 'Kokoro - Test: Integration'
157155
- cla/google
158-
- OwlBot Post Processor
159156
- 'Kokoro - Test: Java GraalVM Native Image'
160157
- 'Kokoro - Test: Java 17 GraalVM Native Image'
161158
- javadoc
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# GitHub action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
name: Hermetic library generation upon generation config change through pull requests
17+
on:
18+
pull_request:
19+
20+
env:
21+
REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }}
22+
GITHUB_REPOSITORY: ${{ github.repository }}
23+
jobs:
24+
library_generation:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Determine whether the pull request comes from a fork
28+
run: |
29+
if [[ "${GITHUB_REPOSITORY}" != "${REPO_FULL_NAME}" ]]; then
30+
echo "This PR comes from a fork. Skip library generation."
31+
echo "SHOULD_RUN=false" >> $GITHUB_ENV
32+
else
33+
echo "SHOULD_RUN=true" >> $GITHUB_ENV
34+
fi
35+
- uses: actions/checkout@v4
36+
if: env.SHOULD_RUN == 'true'
37+
with:
38+
fetch-depth: 0
39+
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
40+
- uses: googleapis/sdk-platform-java/.github/[email protected]
41+
if: env.SHOULD_RUN == 'true'
42+
with:
43+
base_ref: ${{ github.base_ref }}
44+
head_ref: ${{ github.head_ref }}
45+
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}

.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.33.0
17+
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.40.0
1818
with:
1919
bom-path: google-cloud-bigtable-bom/pom.xml
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# GitHub action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
name: Update generation configuration
17+
on:
18+
schedule:
19+
- cron: '0 2 * * *'
20+
workflow_dispatch:
21+
22+
jobs:
23+
update-generation-config:
24+
runs-on: ubuntu-22.04
25+
env:
26+
# the branch into which the pull request is merged
27+
base_branch: main
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
32+
- name: Update params in generation config to latest
33+
shell: bash
34+
run: |
35+
set -ex
36+
[ -z "$(git config user.email)" ] && git config --global user.email "[email protected]"
37+
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
38+
bash .github/scripts/update_generation_config.sh \
39+
--base_branch "${base_branch}"\
40+
--repo ${{ github.repository }}
41+
env:
42+
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}

.kokoro/build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ retry_with_backoff 3 10 \
3333
-DskipTests=true \
3434
-Dclirr.skip=true \
3535
-Denforcer.skip=true \
36+
-Dcheckstyle.skip=true \
3637
-Dmaven.javadoc.skip=true \
3738
-Dgcloud.download.skip=true \
3839
-T 1C
@@ -66,7 +67,8 @@ integration)
6667
-DtrimStackTrace=false \
6768
-Dclirr.skip=true \
6869
-Denforcer.skip=true \
69-
-fae \
70+
-Dcheckstyle.skip=true \
71+
-DskipUnitTests=true \
7072
verify
7173
RETURN_CODE=$?
7274
;;

.kokoro/presubmit/graalvm-native-17.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure the docker image for kokoro-trampoline.
44
env_vars: {
55
key: "TRAMPOLINE_IMAGE"
6-
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.33.0"
6+
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.40.0"
77
}
88

99
env_vars: {

.kokoro/presubmit/graalvm-native.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure the docker image for kokoro-trampoline.
44
env_vars: {
55
key: "TRAMPOLINE_IMAGE"
6-
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.33.0"
6+
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.40.0"
77
}
88

99
env_vars: {

.repo-metadata.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22
"api_shortname": "bigtable",
33
"name_pretty": "Cloud Bigtable",
44
"product_documentation": "https://cloud.google.com/bigtable",
5+
"api_description": "API for reading and writing the contents of Bigtables associated with a cloud project.",
56
"client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/history",
6-
"issue_tracker": "https://issuetracker.google.com/savedsearches/559777",
77
"release_level": "stable",
8+
"transport": "grpc",
89
"language": "java",
910
"repo": "googleapis/java-bigtable",
1011
"repo_short": "java-bigtable",
1112
"distribution_name": "com.google.cloud:google-cloud-bigtable",
12-
"codeowner_team": "@googleapis/api-bigtable @googleapis/api-bigtable-partners",
1313
"api_id": "bigtable.googleapis.com",
1414
"library_type": "GAPIC_COMBO",
15-
"extra_versioned_modules": "google-cloud-bigtable-emulator,google-cloud-bigtable-emulator-core",
15+
"requires_billing": true,
16+
"codeowner_team": "@googleapis/api-bigtable @googleapis/api-bigtable-partners",
1617
"excluded_poms": "google-cloud-bigtable-bom",
18+
"issue_tracker": "https://issuetracker.google.com/savedsearches/559777",
19+
"extra_versioned_modules": "google-cloud-bigtable-emulator,google-cloud-bigtable-emulator-core",
1720
"recommended_package": "com.google.cloud.bigtable"
18-
}
21+
}

0 commit comments

Comments
 (0)