Skip to content

Commit 2edff22

Browse files
committed
Merge branch 'ci/optimize-fmt' into test-fmt-change
2 parents 6d350ad + 42303ca commit 2edff22

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

.github/workflows/java-bigquerystorage-ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,5 @@ jobs:
122122
- run: .kokoro/build.sh
123123
env:
124124
JOB_TYPE: lint
125+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
126+
BASE_SHA: ${{ github.event.pull_request.base.sha }}

.github/workflows/java-datastore-ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,5 @@ jobs:
145145
- run: .kokoro/build.sh
146146
env:
147147
JOB_TYPE: lint
148+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
149+
BASE_SHA: ${{ github.event.pull_request.base.sha }}

.github/workflows/java-logging-ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,5 @@ jobs:
137137
- run: .kokoro/build.sh
138138
env:
139139
JOB_TYPE: lint
140+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
141+
BASE_SHA: ${{ github.event.pull_request.base.sha }}

.github/workflows/java-logging-logback-ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,5 @@ jobs:
137137
- run: .kokoro/build.sh
138138
env:
139139
JOB_TYPE: lint
140+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
141+
BASE_SHA: ${{ github.event.pull_request.base.sha }}

.kokoro/build.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ case ${JOB_TYPE} in
199199

200200
if [ -n "${BASE_SHA}" ] && [ -n "${HEAD_SHA}" ]; then
201201
# Optimize the build by identifying ONLY the Maven modules that contain changed Java source files.
202-
# Format those specific modules instead of the entire codebase.
202+
# Format those specific modules instead of the entire codebase, reducing format check time.
203203
changed_file_list=$(git diff --name-only "${BASE_SHA}" "${HEAD_SHA}")
204204
echo "${changed_file_list}"
205205

@@ -231,8 +231,12 @@ case ${JOB_TYPE} in
231231
dir=$(dirname "${dir}")
232232
done
233233
if [ -f "${dir}/pom.xml" ] && [ "${dir}" != "." ]; then
234-
# Filter out samples, directories with no Java source code, and generated protobuf/gRPC code
234+
# Filter out directories not participating in the default formatting reactor:
235+
# - samples/tutorials are wrapped in the include-samples profile
236+
# - proto-*/grpc-* are generated code and should not be formatted manually
237+
# - *-bom/parents are POM-only and contain no Java source
235238
if [[ "${dir}" != *"samples"* ]] && \
239+
[[ "${dir}" != *"tutorials"* ]] && \
236240
[[ "$(basename "${dir}")" != "proto-google-"* ]] && \
237241
[[ "$(basename "${dir}")" != "grpc-google-"* ]] && \
238242
[[ "$(basename "${dir}")" != *"-bom" ]] && \

0 commit comments

Comments
 (0)