Skip to content

Commit 1ce1bc5

Browse files
authored
chore: migrate java-spanner to monorepo (#12098)
2 parents 7fdf9ff + 2e713be commit 1ce1bc5

File tree

1,776 files changed

+959669
-34
lines changed

Some content is hidden

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

1,776 files changed

+959669
-34
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
/java-vertexai/ @googleapis/vertexai-team @googleapis/cloud-sdk-java-team
1010
/java-bigquerystorage/ @googleapis/bigquery-team @googleapis/cloud-sdk-java-team
1111
/java-bigquery/ @googleapis/bigquery-team @googleapis/cloud-sdk-java-team
12+
/java-spanner/ @googleapis/spanner-team @googleapis/cloud-sdk-java-team
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
name: java-spanner integration-tests-against-emulator
7+
jobs:
8+
filter:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
library: ${{ steps.filter.outputs.library }}
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: dorny/paths-filter@v3
15+
id: filter
16+
with:
17+
filters: |
18+
library:
19+
- 'java-spanner/**'
20+
units:
21+
needs: filter
22+
if: ${{ needs.filter.outputs.library == 'true' }}
23+
runs-on: ubuntu-latest
24+
25+
services:
26+
emulator:
27+
image: gcr.io/cloud-spanner-emulator/emulator:latest
28+
ports:
29+
- 9010:9010
30+
- 9020:9020
31+
32+
steps:
33+
- uses: actions/checkout@v6
34+
- uses: actions/setup-java@v5
35+
with:
36+
distribution: temurin
37+
java-version: 11
38+
- name: Running tests
39+
run: .kokoro/build.sh
40+
env:
41+
JOB_TYPE: test
42+
BUILD_SUBDIR: java-spanner
43+
SPANNER_EMULATOR_HOST: localhost:9010
44+
GOOGLE_CLOUD_PROJECT: emulator-test-project
45+
SUREFIRE_JVM_OPT: '-Penable-integration-tests -DskipUnitTests=true -Dspanner.testenv.instance="" -Dmaven.main.skip=true'

.kokoro/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,12 @@ case ${JOB_TYPE} in
245245
if [ -f "${dir}/pom.xml" ] && [ "${dir}" != "." ]; then
246246
# Filter out directories not participating in the default formatting reactor:
247247
# - samples are handwritten by developers
248+
# - benchmarks are handwritten by developers
248249
# - proto-*/grpc-* are generated code and should use the compiler format
249250
# - *-bom/parents are POM-only and contain no Java source
250251
if [[ "${dir}" != *"samples"* ]] && \
251252
[[ "${dir}" != *"java-showcase"* ]] && \
253+
[[ "$(basename "${dir}")" != *"benchmark"* ]] && \
252254
[[ "$(basename "${dir}")" != "proto-google-"* ]] && \
253255
[[ "$(basename "${dir}")" != "grpc-google-"* ]] && \
254256
[[ "$(basename "${dir}")" != *"-bom" ]] && \

.kokoro/common.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ excluded_modules=(
2929
'sdk-platform-java/java-showcase'
3030
'sdk-platform-java/java-showcase-3.21.0'
3131
'sdk-platform-java/java-showcase-3.25.8'
32+
'java-spanner'
3233
)
3334

3435
function retry_with_backoff {
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Configure the docker image for kokoro-trampoline.
4+
env_vars: {
5+
key: "TRAMPOLINE_IMAGE"
6+
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.57.0" # {x-version-update:google-cloud-shared-dependencies:current}
7+
}
8+
9+
env_vars: {
10+
key: "JOB_TYPE"
11+
value: "graalvm-single"
12+
}
13+
14+
# TODO: remove this after we've migrated all tests and scripts
15+
env_vars: {
16+
key: "GCLOUD_PROJECT"
17+
value: "gcloud-devel"
18+
}
19+
20+
env_vars: {
21+
key: "GOOGLE_CLOUD_PROJECT"
22+
value: "gcloud-devel"
23+
}
24+
25+
env_vars: {
26+
key: "GOOGLE_APPLICATION_CREDENTIALS"
27+
value: "secret_manager/java-it-service-account"
28+
}
29+
30+
env_vars: {
31+
key: "SECRET_MANAGER_KEYS"
32+
value: "java-it-service-account"
33+
}
34+
35+
env_vars: {
36+
key: "IT_SERVICE_ACCOUNT_EMAIL"
37+
value: "it-service-account@gcloud-devel.iam.gserviceaccount.com"
38+
}
39+
env_vars: {
40+
key: "BUILD_SUBDIR"
41+
value: "java-spanner"
42+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Configure the docker image for kokoro-trampoline.
4+
env_vars: {
5+
key: "TRAMPOLINE_IMAGE"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/java11"
7+
}
8+
9+
env_vars: {
10+
key: "JOB_TYPE"
11+
value: "integration-single"
12+
}
13+
14+
# TODO: remove this after we've migrated all tests and scripts
15+
env_vars: {
16+
key: "GCLOUD_PROJECT"
17+
value: "gcloud-devel"
18+
}
19+
20+
env_vars: {
21+
key: "GOOGLE_CLOUD_PROJECT"
22+
value: "gcloud-devel"
23+
}
24+
25+
env_vars: {
26+
key: "GOOGLE_APPLICATION_CREDENTIALS"
27+
value: "secret_manager/java-it-service-account"
28+
}
29+
30+
env_vars: {
31+
key: "SECRET_MANAGER_KEYS"
32+
value: "java-it-service-account"
33+
}
34+
35+
36+
env_vars: {
37+
key: "BUILD_SUBDIR"
38+
value: "java-spanner"
39+
}

gapic-libraries-bom/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,13 @@
12421242
<type>pom</type>
12431243
<scope>import</scope>
12441244
</dependency>
1245+
<dependency>
1246+
<groupId>com.google.cloud</groupId>
1247+
<artifactId>google-cloud-spanner-bom</artifactId>
1248+
<version>6.112.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
1249+
<type>pom</type>
1250+
<scope>import</scope>
1251+
</dependency>
12451252
<dependency>
12461253
<groupId>com.google.cloud</groupId>
12471254
<artifactId>google-cloud-spanneradapter-bom</artifactId>

generation/check_non_release_please_versions.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ for pomFile in $(find . -mindepth 2 -name pom.xml | sort ); do
1313
[[ "${pomFile}" =~ .*java-logging-logback.* ]] || \
1414
[[ "${pomFile}" =~ .*java-bigquery.* ]] || \
1515
[[ "${pomFile}" =~ .*sdk-platform-java.* ]] || \
16+
[[ "${pomFile}" =~ .*java-spanner.* ]] || \
1617
[[ "${pomFile}" =~ .*.github*. ]]; then
1718
continue
1819
fi

generation_config.yaml

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -622,29 +622,6 @@ libraries:
622622
GAPICs:
623623
- proto_path: google/cloud/support/v2
624624
- proto_path: google/cloud/support/v2beta
625-
# - api_shortname: common-protos
626-
# name_pretty: Common Protos
627-
# product_documentation: https://github.com/googleapis/api-common-protos
628-
# api_description: Protobuf classes for Google's common protos.
629-
# release_level: stable
630-
# client_documentation: https://cloud.google.com/java/docs/reference/proto-google-common-protos/latest/history
631-
# distribution_name: com.google.api.grpc:proto-google-common-protos
632-
# excluded_dependencies: proto-google-common-protos,grpc-google-common-protos,proto-google-common-protos-parent
633-
# excluded_poms: proto-google-common-protos-bom,proto-google-common-protos
634-
# library_type: OTHER
635-
# GAPICs:
636-
# - proto_path: google/api
637-
# - proto_path: google/apps/card/v1
638-
# - proto_path: google/cloud
639-
# - proto_path: google/cloud/audit
640-
# - proto_path: google/cloud/location
641-
# - proto_path: google/geo/type
642-
# - proto_path: google/logging/type
643-
# - proto_path: google/longrunning
644-
# - proto_path: google/rpc
645-
# - proto_path: google/rpc/context
646-
# - proto_path: google/shopping/type
647-
# - proto_path: google/type
648625
- api_shortname: compute
649626
name_pretty: Compute Engine
650627
product_documentation: https://cloud.google.com/compute/
@@ -2490,15 +2467,32 @@ libraries:
24902467
- proto_path: google/shopping/merchant/reviews/v1beta
24912468
requires_billing: true
24922469
library_name: shopping-merchant-reviews
2493-
# - api_shortname: showcase
2494-
# excluded_poms: gapic-showcase-bom
2495-
# name_pretty: Showcase
2496-
# api_description: Showcase module
2497-
# product_documentation: https://cloud.google.com/dummy
2498-
# distribution_name: com.google.cloud:gapic-showcase
2499-
# library_type: OTHER
2500-
# GAPICs:
2501-
# - proto_path: schema/google/showcase/v1beta1
2470+
- api_shortname: spanner
2471+
name_pretty: Cloud Spanner
2472+
product_documentation: https://cloud.google.com/spanner/docs/
2473+
client_documentation: https://cloud.google.com/java/docs/reference/google-cloud-spanner/latest/history
2474+
api_description: is a fully managed, mission-critical, relational database service
2475+
that offers transactional consistency at global scale, schemas, SQL (ANSI 2011
2476+
with extensions), and automatic, synchronous replication for high availability.
2477+
Be sure to activate the Cloud Spanner API on the Developer's Console to use Cloud
2478+
Spanner from your project.
2479+
issue_tracker: https://issuetracker.google.com/issues?q=componentid:190851%2B%20status:open
2480+
release_level: stable
2481+
language: java
2482+
min_java_version: 8
2483+
distribution_name: com.google.cloud:google-cloud-spanner
2484+
api_id: spanner.googleapis.com
2485+
transport: grpc
2486+
requires_billing: true
2487+
codeowner_team: '@googleapis/spanner-team'
2488+
library_type: GAPIC_COMBO
2489+
excluded_poms: google-cloud-spanner-bom,google-cloud-spanner
2490+
recommended_package: com.google.cloud.spanner
2491+
GAPICs:
2492+
- proto_path: google/spanner/admin/database/v1
2493+
- proto_path: google/spanner/admin/instance/v1
2494+
- proto_path: google/spanner/executor/v1
2495+
- proto_path: google/spanner/v1
25022496
- api_shortname: spanneradapter
25032497
name_pretty: Cloud Spanner Adapter API
25042498
product_documentation: https://cloud.google.com/java/docs/reference/google-cloud-spanneradapter/latest/overview

java-spanner/.OwlBot-hermetic.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright 2021 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+
15+
deep-remove-regex:
16+
- /java-spanner/grpc-google-.*/src
17+
- /java-spanner/proto-google-.*/src
18+
- /java-spanner/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1
19+
- /java-spanner/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin
20+
deep-preserve-regex:
21+
- /java-spanner/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java
22+
- /java-spanner/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CryptoKeyName.java
23+
- /java-spanner/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CryptoKeyVersionName.java
24+
deep-copy-regex:
25+
- source: /google/spanner/(v.*)/.*-java/proto-google-.*/src
26+
dest: /owl-bot-staging/java-spanner/$1/proto-google-cloud-spanner-$1/src
27+
- source: /google/spanner/(v.*)/.*-java/grpc-google-.*/src
28+
dest: /owl-bot-staging/java-spanner/$1/grpc-google-cloud-spanner-$1/src
29+
- source: /google/spanner/(v.*)/.*-java/gapic-google-.*/src
30+
dest: /owl-bot-staging/java-spanner/$1/google-cloud-spanner/src/
31+
- source: /google/spanner/admin/database/(v.*)/.*-java/proto-google-.*/src
32+
dest: /owl-bot-staging/java-spanner/$1/proto-google-cloud-spanner-admin-database-$1/src
33+
- source: /google/spanner/admin/database/(v.*)/.*-java/grpc-google-.*/src
34+
dest: /owl-bot-staging/java-spanner/$1/grpc-google-cloud-spanner-admin-database-$1/src
35+
- source: /google/spanner/admin/database/(v.*)/.*-java/gapic-google-.*/src
36+
dest: /owl-bot-staging/java-spanner/$1/google-cloud-spanner/src/
37+
- source: /google/spanner/admin/instance/(v.*)/.*-java/proto-google-.*/src
38+
dest: /owl-bot-staging/java-spanner/$1/proto-google-cloud-spanner-admin-instance-$1/src
39+
- source: /google/spanner/admin/instance/(v.*)/.*-java/grpc-google-.*/src
40+
dest: /owl-bot-staging/java-spanner/$1/grpc-google-cloud-spanner-admin-instance-$1/src
41+
- source: /google/spanner/admin/instance/(v.*)/.*-java/gapic-google-.*/src
42+
dest: /owl-bot-staging/java-spanner/$1/google-cloud-spanner/src/
43+
- source: /google/spanner/executor/(v.*)/.*-java/proto-google-.*/src
44+
dest: /owl-bot-staging/java-spanner/$1/proto-google-cloud-spanner-executor-$1/src
45+
- source: /google/spanner/executor/(v.*)/.*-java/grpc-google-.*/src
46+
dest: /owl-bot-staging/java-spanner/$1/grpc-google-cloud-spanner-executor-$1/src
47+
- source: /google/spanner/executor/(v.*)/.*-java/gapic-google-.*/src
48+
dest: /owl-bot-staging/java-spanner/$1/google-cloud-spanner-executor/src/

0 commit comments

Comments
 (0)