Skip to content

Commit 8ce5f4d

Browse files
authored
chore: migrate java-bigquery to monorepo (#12059)
chore: migrate java-bigquery to monorepo
2 parents aa2c249 + b9de9dd commit 8ce5f4d

File tree

658 files changed

+448722
-36
lines changed

Some content is hidden

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

658 files changed

+448722
-36
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
# java-vertexai has maintainers
99
/java-vertexai/ @googleapis/vertexai-team @googleapis/cloud-sdk-java-team
1010
/java-bigquerystorage/ @googleapis/bigquery-team @googleapis/cloud-sdk-java-team
11+
/java-bigquery/ @googleapis/bigquery-team @googleapis/cloud-sdk-java-team

.github/workflows/ci.yaml

Lines changed: 1 addition & 34 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, 25]
28+
java: [8, 11, 17, 21, 25]
2929
steps:
3030
- name: Get current week within the year
3131
id: date
@@ -45,39 +45,6 @@ jobs:
4545
env:
4646
JOB_TYPE: test
4747
JOB_NAME: units-${{matrix.java}}
48-
units-8-runtime:
49-
runs-on: ubuntu-latest
50-
name: "units (8)"
51-
steps:
52-
- name: Get current week within the year
53-
id: date
54-
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
55-
- uses: actions/checkout@v4
56-
- uses: actions/setup-java@v4
57-
with:
58-
java-version: 11
59-
distribution: temurin
60-
cache: maven
61-
- run: java -version
62-
- uses: actions/cache@v4
63-
id: mvn-cache
64-
with:
65-
path: ~/.m2/repository
66-
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
67-
- name: Install all modules using Java 11
68-
shell: bash
69-
run: |
70-
mvn -V -B -ntp clean install -DskipTests -Dfmt.skip -Dclirr.skip -Denforcer.skip -Dcheckstyle.skip -Dflatten.skip -Danimal-sniffer.skip -Djacoco.skip
71-
- uses: actions/setup-java@v4
72-
with:
73-
java-version: 8
74-
distribution: temurin
75-
- run: java -version
76-
- name: Run tests in Java 8 with the source compiled in Java 11
77-
run: .kokoro/build.sh
78-
env:
79-
JOB_TYPE: test
80-
JOB_NAME: units-11-runtime-8
8148
windows:
8249
runs-on: windows-latest
8350
steps:

.github/workflows/generated_files_sync.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,15 @@ jobs:
164164
165165
# java/com/google : This is the standard package
166166
# samples : Samples are not shipped as a library
167+
# benchmark : Benchmarking tests are not shipped as a library
167168
# grafeas : java-grafeas is known to have special package name
168169
# cloud-build v2 : java_package was not configured when we published
169170
# the Cloud Build V2 client library
170171
# the rest : the same as above
171172
invalid_files=$(find . -name '*.java' \
172173
|grep --invert-match 'java/com/google' \
173174
|grep --invert-match samples \
175+
|grep --invert-match benchmark \
174176
|grep --invert-match grafeas \
175177
|grep --invert-match 'cloud-build.*v2' \
176178
|grep --invert-match 'google/monitoring/v3/DroppedLabelsOuterClass.java' \
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Copyright 2022 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+
on:
17+
push:
18+
branches:
19+
- main
20+
pull_request:
21+
name: java-bigquery ci
22+
env:
23+
BUILD_SUBDIR: java-bigquery
24+
jobs:
25+
filter:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
library: ${{ steps.filter.outputs.library }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: dorny/paths-filter@v3
32+
id: filter
33+
with:
34+
filters: |
35+
library:
36+
- 'java-bigquery/**'
37+
units:
38+
needs: filter
39+
if: ${{ needs.filter.outputs.library == 'true' }}
40+
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
java: [11, 17, 21, 25]
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: actions/setup-java@v4
48+
with:
49+
distribution: temurin
50+
java-version: ${{matrix.java}}
51+
- run: java -version
52+
- run: .kokoro/build.sh
53+
env:
54+
JOB_TYPE: test
55+
units-java8:
56+
needs: filter
57+
if: ${{ needs.filter.outputs.library == 'true' }}
58+
# Building using Java 17 and run the tests with Java 8 runtime
59+
name: "units (8)"
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: actions/setup-java@v4
64+
with:
65+
java-version: 8
66+
distribution: temurin
67+
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
68+
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
69+
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
70+
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java -P !java17" >> $GITHUB_ENV
71+
shell: bash
72+
- uses: actions/setup-java@v4
73+
with:
74+
java-version: 17
75+
distribution: temurin
76+
- run: .kokoro/build.sh
77+
env:
78+
JOB_TYPE: test
79+
windows:
80+
needs: filter
81+
if: ${{ needs.filter.outputs.library == 'true' }}
82+
runs-on: windows-latest
83+
steps:
84+
- name: Support longpaths
85+
run: git config --system core.longpaths true
86+
- name: Support longpaths
87+
run: git config --system core.longpaths true
88+
- uses: actions/checkout@v4
89+
- uses: actions/setup-java@v4
90+
with:
91+
distribution: temurin
92+
java-version: 8
93+
- run: java -version
94+
- run: .kokoro/build.sh
95+
env:
96+
JOB_TYPE: test
97+
dependencies:
98+
needs: filter
99+
if: ${{ needs.filter.outputs.library == 'true' }}
100+
runs-on: ubuntu-latest
101+
strategy:
102+
matrix:
103+
java: [17]
104+
steps:
105+
- uses: actions/checkout@v4
106+
- uses: actions/setup-java@v4
107+
with:
108+
distribution: temurin
109+
java-version: ${{matrix.java}}
110+
- run: java -version
111+
- run: .kokoro/dependencies.sh
112+
javadoc:
113+
needs: filter
114+
if: ${{ needs.filter.outputs.library == 'true' }}
115+
runs-on: ubuntu-latest
116+
steps:
117+
- uses: actions/checkout@v4
118+
- uses: actions/setup-java@v4
119+
with:
120+
distribution: temurin
121+
java-version: 17
122+
- run: java -version
123+
- run: .kokoro/build.sh
124+
env:
125+
JOB_TYPE: javadoc
126+
lint:
127+
needs: filter
128+
if: ${{ needs.filter.outputs.library == 'true' }}
129+
runs-on: ubuntu-latest
130+
steps:
131+
- uses: actions/checkout@v4
132+
with:
133+
fetch-depth: 0
134+
- uses: actions/setup-java@v4
135+
with:
136+
distribution: temurin
137+
java-version: 17
138+
- run: java -version
139+
- run: .kokoro/build.sh
140+
env:
141+
JOB_TYPE: lint
142+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
143+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
name: java-bigquery Scorecard supply-chain security
6+
on:
7+
# For Branch-Protection check. Only the default branch is supported. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
9+
branch_protection_rule:
10+
# To guarantee Maintained check is occasionally updated. See
11+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
12+
schedule:
13+
- cron: '0 0 * * *'
14+
push:
15+
branches: [ "main" ]
16+
17+
# Declare default permissions as read only.
18+
permissions: read-all
19+
20+
env:
21+
BUILD_SUBDIR: java-bigquery
22+
jobs:
23+
filter:
24+
runs-on: ubuntu-latest
25+
outputs:
26+
library: ${{ steps.filter.outputs.library }}
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: dorny/paths-filter@v3
30+
id: filter
31+
with:
32+
filters: |
33+
library:
34+
- 'java-bigquery/**'
35+
analysis:
36+
needs: filter
37+
if: ${{ needs.filter.outputs.library == 'true' }}
38+
name: Scorecard analysis
39+
runs-on: ubuntu-latest
40+
permissions:
41+
# Needed to upload the results to code-scanning dashboard.
42+
security-events: write
43+
# Needed to publish results and get a badge (see publish_results below).
44+
id-token: write
45+
# Uncomment the permissions below if installing in a private repository.
46+
# contents: read
47+
# actions: read
48+
49+
steps:
50+
- name: "Checkout code"
51+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
52+
with:
53+
persist-credentials: false
54+
55+
- name: "Run analysis"
56+
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
57+
with:
58+
results_file: results.sarif
59+
results_format: sarif
60+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
61+
# - you want to enable the Branch-Protection check on a *public* repository, or
62+
# - you are installing Scorecard on a *private* repository
63+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
64+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
65+
66+
# Public repositories:
67+
# - Publish results to OpenSSF REST API for easy access by consumers
68+
# - Allows the repository to include the Scorecard badge.
69+
# - See https://github.com/ossf/scorecard-action#publishing-results.
70+
# For private repositories:
71+
# - `publish_results` will always be set to `false`, regardless
72+
# of the value entered here.
73+
publish_results: true
74+
75+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
76+
# format to the repository Actions tab.
77+
- name: "Upload artifact"
78+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
79+
with:
80+
name: SARIF file
81+
path: results.sarif
82+
retention-days: 5
83+
84+
# Upload the results to GitHub's code scanning dashboard.
85+
- name: "Upload to code-scanning"
86+
uses: github/codeql-action/upload-sarif@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2.28.1
87+
with:
88+
sarif_file: results.sarif

.kokoro/build.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,19 @@ case ${JOB_TYPE} in
269269
exit 1
270270
fi
271271

272+
# The lint property is to activate the benchmark profile that declares the
273+
# benchmark module in java-bigquery/benchmark. This module is not needed during
274+
# other builds or releases.
272275
mvn -B -ntp \
273276
-T 1C \
274277
${MODULE_FILTER} \
278+
-Dlint \
275279
com.spotify.fmt:fmt-maven-plugin:check
276-
mvn -B -ntp ${MODULE_FILTER} checkstyle:check@checkstyle
280+
mvn -B -ntp \
281+
-T 1C \
282+
${MODULE_FILTER} \
283+
-Dlint \
284+
checkstyle:check@checkstyle
277285

278286
if [[ -n "${BUILD_SUBDIR}" ]]
279287
then

.kokoro/common.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ excluded_modules=(
1919
'google-cloud-pom-parent'
2020
'java-vertexai'
2121
'java-logging'
22+
'java-bigquery'
2223
'java-bigquerystorage'
2324
'java-datastore'
2425
'java-logging-logback'
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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"
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: "ENABLE_FLAKYBOT"
37+
value: "false"
38+
}
39+
env_vars: {
40+
key: "BUILD_SUBDIR"
41+
value: "java-bigquery"
42+
}
43+
44+
env_vars: {
45+
key: "INTEGRATION_TEST_ARGS"
46+
value: "-pl !google-cloud-bigquery-jdbc"
47+
}

0 commit comments

Comments
 (0)