Skip to content

Commit 4f2543a

Browse files
author
Sagar Agarwal
committed
Merge remote-tracking branch 'refs/remotes/origin/interval_support' into interval_support
2 parents ba90228 + 100a43b commit 4f2543a

File tree

811 files changed

+31832
-6761
lines changed

Some content is hidden

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

811 files changed

+31832
-6761
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@
44
# For syntax help see:
55
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
66

7-
# The @googleapis/api-spanner-java is the default owner for changes in this repo
8-
* @googleapis/yoshi-java @googleapis/api-spanner-java
9-
**/*.java @googleapis/api-spanner-java
10-
11-
# The java-samples-reviewers team is the default owner for samples changes
12-
samples/**/*.java @googleapis/java-samples-reviewers @googleapis/api-spanner-java
7+
# The @googleapis/spanner-client-libraries-java is the default owner for changes in this repo
8+
* @googleapis/yoshi-java @googleapis/spanner-client-libraries-java

.github/release-please.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@ branches:
4242
bumpMinorPreMajor: true
4343
handleGHRelease: true
4444
branch: 6.66.x
45+
- releaseType: java-backport
46+
bumpMinorPreMajor: true
47+
handleGHRelease: true
48+
branch: 6.88.x

.github/scripts/update_generation_config.sh

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,23 @@ function update_config() {
2828
sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}"
2929
}
3030

31+
# Update an action to a new version in GitHub action.
32+
function update_action() {
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+
# use a different delimiter because the key_word contains "/".
38+
sed -i -e "s|${key_word}@v.*$|${key_word}@v${new_value}|" "${file}"
39+
}
40+
3141
# The parameters of this script is:
3242
# 1. base_branch, the base branch of the result pull request.
3343
# 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java
3444
# 3. [optional] generation_config, the path to the generation configuration,
3545
# the default value is generation_config.yaml in the repository root.
46+
# 4. [optional] workflow, the library generation workflow file,
47+
# the default value is .github/workflows/hermetic_library_generation.yaml.
3648
while [[ $# -gt 0 ]]; do
3749
key="$1"
3850
case "${key}" in
@@ -48,6 +60,10 @@ case "${key}" in
4860
generation_config="$2"
4961
shift
5062
;;
63+
--workflow)
64+
workflow="$2"
65+
shift
66+
;;
5167
*)
5268
echo "Invalid option: [$1]"
5369
exit 1
@@ -71,21 +87,34 @@ if [ -z "${generation_config}" ]; then
7187
echo "Use default generation config: ${generation_config}"
7288
fi
7389

90+
if [ -z "${workflow}" ]; then
91+
workflow=".github/workflows/hermetic_library_generation.yaml"
92+
echo "Use default library generation workflow file: ${workflow}"
93+
fi
94+
7495
current_branch="generate-libraries-${base_branch}"
7596
title="chore: Update generation configuration at $(date)"
7697

77-
# try to find a open pull request associated with the branch
98+
git checkout "${base_branch}"
99+
# Try to find a open pull request associated with the branch
78100
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
101+
# Create a branch if there's no open pull request associated with the
80102
# branch; otherwise checkout the pull request.
81103
if [ -z "${pr_num}" ]; then
82104
git checkout -b "${current_branch}"
105+
# Push the current branch to remote so that we can
106+
# compare the commits later.
107+
git push -u origin "${current_branch}"
83108
else
84109
gh pr checkout "${pr_num}"
85110
fi
86111

112+
# Only allow fast-forward merging; exit with non-zero result if there's merging
113+
# conflict.
114+
git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}"
115+
87116
mkdir tmp-googleapis
88-
# use partial clone because only commit history is needed.
117+
# Use partial clone because only commit history is needed.
89118
git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis
90119
pushd tmp-googleapis
91120
git pull
@@ -94,25 +123,43 @@ popd
94123
rm -rf tmp-googleapis
95124
update_config "googleapis_commitish" "${latest_commit}" "${generation_config}"
96125

97-
# update gapic-generator-java version to the latest
126+
# Update gapic-generator-java version to the latest
98127
latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java")
99128
update_config "gapic_generator_version" "${latest_version}" "${generation_config}"
100129

101-
# update libraries-bom version to the latest
130+
# Update composite action version to latest gapic-generator-java version
131+
update_action "googleapis/sdk-platform-java/.github/scripts" \
132+
"${latest_version}" \
133+
"${workflow}"
134+
135+
# Update libraries-bom version to the latest
102136
latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom")
103137
update_config "libraries_bom_version" "${latest_version}" "${generation_config}"
104138

105-
git add "${generation_config}"
139+
git add "${generation_config}" "${workflow}"
106140
changed_files=$(git diff --cached --name-only)
107141
if [[ "${changed_files}" == "" ]]; then
108142
echo "The latest generation config is not changed."
109143
echo "Skip committing to the pull request."
144+
else
145+
git commit -m "${title}"
146+
fi
147+
148+
# There are potentially at most two commits: merge commit and change commit.
149+
# We want to exit the script if no commit happens (otherwise this will be an
150+
# infinite loop).
151+
# `git cherry` is a way to find whether the local branch has commits that are
152+
# not in the remote branch.
153+
# If we find any such commit, push them to remote branch.
154+
unpushed_commit=$(git cherry -v "origin/${current_branch}" | wc -l)
155+
if [[ "${unpushed_commit}" -eq 0 ]]; then
156+
echo "No unpushed commits, exit"
110157
exit 0
111158
fi
112-
git commit -m "${title}"
159+
113160
if [ -z "${pr_num}" ]; then
114161
git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git"
115-
git fetch -q --unshallow remote_repo
162+
git fetch -q remote_repo
116163
git push -f remote_repo "${current_branch}"
117164
gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}"
118165
else

.github/sync-repo-settings.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ branchProtectionRules:
2121
- compile (11)
2222
- units-with-multiplexed-session (8)
2323
- units-with-multiplexed-session (11)
24+
- unmanaged_dependency_check
25+
- library_generation
2426
- pattern: 3.3.x
2527
isAdminEnforced: true
2628
requiredApprovingReviewCount: 1
@@ -159,6 +161,27 @@ branchProtectionRules:
159161
- compile (11)
160162
- units-with-multiplexed-session (8)
161163
- units-with-multiplexed-session (11)
164+
- pattern: 6.88.x
165+
isAdminEnforced: true
166+
requiredApprovingReviewCount: 1
167+
requiresCodeOwnerReviews: true
168+
requiresStrictStatusChecks: false
169+
requiredStatusCheckContexts:
170+
- dependencies (17)
171+
- lint
172+
- javadoc
173+
- units (8)
174+
- units (11)
175+
- 'Kokoro - Test: Integration'
176+
- 'Kokoro - Test: Integration with Multiplexed Sessions'
177+
- cla/google
178+
- checkstyle
179+
- compile (8)
180+
- compile (11)
181+
- units-with-multiplexed-session (8)
182+
- units-with-multiplexed-session (11)
183+
- unmanaged_dependency_check
184+
- library_generation
162185
permissionRules:
163186
- team: yoshi-admins
164187
permission: admin

.github/workflows/ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ jobs:
5353
env:
5454
JOB_TYPE: test
5555
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS: true
56+
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS: true
57+
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW: true
5658
units-java8:
5759
# Building using Java 17 and run the tests with Java 8 runtime
5860
name: "units (8)"
@@ -92,6 +94,8 @@ jobs:
9294
env:
9395
JOB_TYPE: test
9496
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS: true
97+
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS: true
98+
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW: true
9599
windows:
96100
runs-on: windows-latest
97101
steps:

.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.47.0
40+
- uses: googleapis/sdk-platform-java/.github/scripts@v2.54.0
4141
if: env.SHOULD_RUN == 'true'
4242
with:
4343
base_ref: ${{ github.base_ref }}

.github/workflows/integration-tests-against-emulator-with-multiplexed-session.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ jobs:
3939
env:
4040
JOB_TYPE: test
4141
SPANNER_EMULATOR_HOST: localhost:9010
42-
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS: true
42+
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS: true

.github/workflows/unmanaged_dependency_check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
# repository
1818
.kokoro/build.sh
1919
- name: Unmanaged dependency check
20-
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.37.0
20+
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.44.0
2121
with:
2222
bom-path: google-cloud-spanner-bom/pom.xml

.kokoro/build.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ integration-directpath-enabled)
113113
-Dclirr.skip=true \
114114
-Denforcer.skip=true \
115115
-Dmaven.main.skip=true \
116-
-Dspanner.gce.config.project_id=gcloud-devel \
117-
-Dspanner.testenv.instance=projects/gcloud-devel/instances/java-client-integration-tests-directpath \
116+
-Dspanner.testenv.instance=projects/span-cloud-testing/instances/spanner-java-client-directpath \
117+
-Dspanner.gce.config.project_id=span-cloud-testing \
118118
-fae \
119119
verify
120120
RETURN_CODE=$?
@@ -206,12 +206,17 @@ slowtests)
206206
verify
207207
RETURN_CODE=$?
208208
;;
209-
samples)
209+
samples|samples-slow-tests)
210210
SAMPLES_DIR=samples
211+
PROFILES=''
211212
# only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise.
212213
if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]]
213214
then
214215
SAMPLES_DIR=samples/snapshot
216+
elif [[ ${JOB_TYPE} = 'samples-slow-tests' ]]
217+
then
218+
SAMPLES_DIR=samples/snippets
219+
PROFILES='-Pslow-tests,!integration-tests'
215220
fi
216221

217222
if [[ -f ${SAMPLES_DIR}/pom.xml ]]
@@ -227,6 +232,7 @@ samples)
227232
-DtrimStackTrace=false \
228233
-Dclirr.skip=true \
229234
-Denforcer.skip=true \
235+
${PROFILES} \
230236
-fae \
231237
verify
232238
RETURN_CODE=$?

.kokoro/continuous/integration-cloud-devel-directpath-enabled.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ env_vars: {
2727
}
2828

2929
env_vars: {
30-
key: "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
30+
key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS"
3131
value: "true"
3232
}

.kokoro/continuous/integration-cloud-staging-directpath-enabled.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ env_vars: {
2727
}
2828

2929
env_vars: {
30-
key: "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
30+
key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS"
3131
value: "true"
3232
}

.kokoro/continuous/java8.cfg

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

.kokoro/nightly/integration-cloud-devel-directpath-enabled.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ env_vars: {
2222
}
2323

2424
env_vars: {
25-
key: "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
25+
key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS"
2626
value: "true"
2727
}
28-

.kokoro/nightly/integration-cloud-staging-directpath-enabled.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ env_vars: {
2222
}
2323

2424
env_vars: {
25-
key: "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
25+
key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS"
2626
value: "true"
2727
}

.kokoro/nightly/integration-directpath-enabled.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ env_vars: {
2828

2929
env_vars: {
3030
key: "GOOGLE_APPLICATION_CREDENTIALS"
31-
value: "secret_manager/java-it-service-account"
31+
value: "secret_manager/java-client-testing"
3232
}
3333

3434
env_vars: {
3535
key: "SECRET_MANAGER_KEYS"
36-
value: "java-it-service-account"
36+
value: "java-client-testing"
3737
}
3838

3939
env_vars: {
40-
key: "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
40+
key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS"
4141
value: "true"
4242
}

.kokoro/presubmit/java11-samples.cfg renamed to .kokoro/nightly/java11-samples-slow-tests.cfg

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ env_vars: {
88

99
env_vars: {
1010
key: "JOB_TYPE"
11-
value: "samples"
11+
value: "samples-slow-tests"
1212
}
1313

1414
# TODO: remove this after we've migrated all tests and scripts
@@ -32,3 +32,8 @@ env_vars: {
3232
value: "java-it-service-account"
3333
}
3434

35+
env_vars: {
36+
key: "ENABLE_BUILD_COP"
37+
value: "true"
38+
}
39+

.kokoro/nightly/java7.cfg

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

.kokoro/nightly/java8-win.cfg

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

.kokoro/presubmit/clirr.cfg

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

.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.37.0"
6+
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.44.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.37.0"
6+
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.44.0"
77
}
88

99
env_vars: {

0 commit comments

Comments
 (0)