Skip to content

Commit 55ae26e

Browse files
authored
Merge branch 'main' into maven-fast-profile
2 parents 43fe441 + a9198ee commit 55ae26e

File tree

6,732 files changed

+1236301
-27889
lines changed

Some content is hidden

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

6,732 files changed

+1236301
-27889
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@
1212
/java-spanner/ @googleapis/spanner-team @googleapis/cloud-sdk-java-team
1313
/java-spanner-jdbc/ @googleapis/spanner-team @googleapis/cloud-sdk-java-team
1414
/google-auth-library-java/ @googleapis/cloud-sdk-auth-team @googleapis/cloud-sdk-java-team
15+
/java-storage/ @googleapis/gcs-team @googleapis/cloud-sdk-java-team
16+
/java-storage-nio/ @googleapis/gcs-team @googleapis/cloud-sdk-java-team

.github/header-checker-lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
allowedCopyrightHolders:
22
- 'Google LLC'
3+
- 'Google Inc'
34
- 'The Grafeas Authors'

.github/requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
requests==2.32.4
1+
requests==2.33.0

.github/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ idna==3.7 \
104104
--hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \
105105
--hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0
106106
# via requests
107-
requests==2.32.4 \
108-
--hash=sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c \
109-
--hash=sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422
107+
requests==2.33.0 \
108+
--hash=sha256:3324635456fa185245e24865e810cecec7b4caf933d7eb133dcde67d48cee69b \
109+
--hash=sha256:c7ebc5e8b0f21837386ad0e1c8fe8b829fa5f544d8df3b2253bff14ef29d7652
110110
# via -r requirements.in
111111
urllib3==2.6.3 \
112112
--hash=sha256:1b62b6884944a57dbe321509ab94fd4d3b307075e0c2eae991ac71ee15ad38ed \
4.68 KB
Binary file not shown.

.github/scripts/release_manager_merge_bot.go

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,16 @@ func main() {
213213
}
214214

215215
state = *status.State
216-
log.Printf("Overall status: %s", state)
216+
log.Printf("Overall commit status: %s", state)
217+
if pr.MergeableState != nil {
218+
log.Printf("PR mergeable state: %s", *pr.MergeableState)
219+
if *pr.MergeableState == "dirty" {
220+
fatalError("PR #%d has merge conflicts (dirty).", prNumber)
221+
}
222+
if *pr.MergeableState == "draft" {
223+
fatalError("PR #%d is a draft.", prNumber)
224+
}
225+
}
217226

218227
switch state {
219228
case "failure":
@@ -230,7 +239,19 @@ func main() {
230239
}
231240
retryCount++
232241
case "success":
233-
log.Println("All checks have passed. Merging the pull request...")
242+
// Check if the PR is truly mergeable. MergeableState can be "blocked" if required
243+
// check runs (e.g. GitHub Actions) or reviews are missing, even if CombinedStatus is "success".
244+
// If it's nil, GitHub is still calculating mergeability.
245+
if pr.MergeableState == nil || *pr.MergeableState == "blocked" || *pr.MergeableState == "behind" {
246+
stateStr := "nil"
247+
if pr.MergeableState != nil {
248+
stateStr = *pr.MergeableState
249+
}
250+
log.Printf("Commit status is success, but PR mergeable state is %q. Waiting...", stateStr)
251+
goto wait
252+
}
253+
254+
log.Println("All checks have passed and PR is mergeable. Merging the pull request...")
234255
commitMessage := fmt.Sprintf("Merge pull request #%d from %s/%s", prNumber, owner, repo)
235256
mergeResult, _, err := client.PullRequests.Merge(ctx, owner, repo, prNumber, commitMessage, &github.PullRequestOptions{
236257
MergeMethod: "squash",

.github/workflows/ci.yaml

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,33 @@ on:
2020
pull_request:
2121
name: ci
2222
jobs:
23+
# detect whether or note we should run "bulk" (non-handwritten) unit tests
24+
bulk-filter:
25+
runs-on: ubuntu-latest
26+
permissions:
27+
pull-requests: read
28+
# Set job outputs to values from filter step
29+
outputs:
30+
src: ${{ steps.filter.outputs.src }}
31+
ci: ${{ steps.filter.outputs.ci }}
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: dorny/paths-filter@v3
35+
id: filter
36+
with:
37+
# we want to run tests if source code is changed or the scripts
38+
# used to run the unit tests
39+
filters: |
40+
src:
41+
- '**/*.java'
42+
- '**/pom.xml'
43+
ci:
44+
- '.github/workflows/ci.yaml'
45+
- '.kokoro/**'
46+
# these unit tests are "bulk" (non-handwritten) libraries
2347
units:
2448
runs-on: ubuntu-latest
49+
needs: bulk-filter
2550
strategy:
2651
fail-fast: false
2752
matrix:
@@ -42,11 +67,13 @@ jobs:
4267
path: ~/.m2/repository
4368
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
4469
- run: .kokoro/build.sh
70+
if: ${{ needs.bulk-filter.outputs.src == 'true' || needs.bulk-filter.outputs.ci == 'true' }}
4571
env:
4672
JOB_TYPE: test
4773
JOB_NAME: units-${{matrix.java}}
4874
units-8-runtime:
4975
runs-on: ubuntu-latest
76+
needs: bulk-filter
5077
name: "units (8)"
5178
steps:
5279
- name: Get current week within the year
@@ -73,6 +100,7 @@ jobs:
73100
path: ~/.m2/repository
74101
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
75102
- run: .kokoro/build.sh
103+
if: ${{ needs.bulk-filter.outputs.src == 'true' || needs.bulk-filter.outputs.ci == 'true' }}
76104
shell: bash
77105
env:
78106
JOB_TYPE: test
@@ -92,9 +120,10 @@ jobs:
92120
java-bigquery: java-bigquery/**
93121
java-bigquerystorage: java-bigquerystorage/**
94122
java-datastore: java-datastore/**
95-
java-logging: java-logging/**
96123
java-logging-logback: java-logging-logback/**
124+
java-logging: java-logging/**
97125
java-spanner: java-spanner/**
126+
java-storage: java-storage/**
98127
sdk-platform-java: sdk-platform-java/**
99128
split-units:
100129
runs-on: ubuntu-latest
@@ -215,8 +244,9 @@ jobs:
215244
cache: maven
216245
- run: java -version
217246
- name: Install Maven modules to local Maven repository
218-
run: |
219-
mvn install -B -ntp -T 1C -Pquick-build -DskipTests
247+
run: .kokoro/build.sh
248+
env:
249+
JOB_TYPE: install
220250
- run: java -version
221251
- run: mvn -B -ntp enforcer:enforce@enforce -T 1C
222252
gapic-libraries-bom:
@@ -229,10 +259,11 @@ jobs:
229259
distribution: temurin
230260
cache: maven
231261
- name: Install Maven modules to local Maven repository
232-
run: |
233-
mvn install -B -ntp -T 1C -Pquick-build -DskipTests
262+
run: .kokoro/build.sh
263+
env:
264+
JOB_TYPE: install
234265
- name: Validate gapic-libraries-bom
235-
uses: googleapis/java-cloud-bom/tests/validate-bom@v26.54.0
266+
uses: googleapis/java-cloud-bom/tests/validate-bom@v26.79.0
236267
with:
237268
bom-path: gapic-libraries-bom/pom.xml
238269
generation-config-check:

.github/workflows/hermetic_library_generation.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ jobs:
4343
base_ref: ${{ github.base_ref }}
4444
head_ref: ${{ github.head_ref }}
4545
token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
46+
force_regenerate_all: ${{ github.event.pull_request.head.ref == 'generate-libraries-main' }}
4647
image_tag: 2.68.1-SNAPSHOT # {x-version-update:gapic-generator-java:current}
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-storage-nio ci
22+
env:
23+
BUILD_SUBDIR: java-storage-nio
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-storage-nio/**'
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 }}

.github/workflows/sdk-platform-java-dependency_compatibility_test.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ jobs:
6969

7070
# Set up local showcase server to run the showcase ITs
7171
- name: Parse showcase version
72-
working-directory: sdk-plaform-java/java-showcase/gapic-showcase
72+
working-directory: sdk-platform-java/java-showcase/gapic-showcase
7373
run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV"
74-
working-directory: sdk-platform-java
7574
- name: Install showcase server
7675
run: |
7776
sudo mkdir -p /usr/src/showcase
@@ -89,8 +88,8 @@ jobs:
8988
# Need to cd out of the directory to get the scripts as this step is run inside the java-showcase directory
9089
run: |
9190
if [[ -n "${{ env.DEPENDENCIES_LIST }}" ]]; then
92-
../sdk-platform-java/.github/scripts/test_dependency_compatibility.sh -l ${{ env.DEPENDENCIES_LIST }}
91+
../.github/scripts/test_dependency_compatibility.sh -l ${{ env.DEPENDENCIES_LIST }}
9392
else
94-
../sdk-platform-java/.github/scripts/test_dependency_compatibility.sh -f ../dependencies.txt
93+
../.github/scripts/test_dependency_compatibility.sh -f ../dependencies.txt
9594
fi
9695
working-directory: sdk-platform-java/java-showcase

0 commit comments

Comments
 (0)