Skip to content

Commit d1585fc

Browse files
authored
ci: bring the dependencies check back (#12906)
This change adds the dependencies check back to the ci.yaml, google-auth-library-java-ci.yaml, and sdk-platform-java-ci.yaml. This pull request removes unnecessary java version matrix logic in existing dependencies check. Java 17 just works fine. This pull request removes the retry logic in dependencies.sh because at the time this Maven command runs Maven's dependency resolution, which may hit transient errors for network connection, is already done. ignoreNonCompile property is maven-dependency-plugin's property to skip non-compile dependencies. https://maven.apache.org/plugins/maven-dependency-plugin/analyze-only-mojo.html#ignorenoncompile > Ignore runtime/provided/test/system scopes for unused dependency analysis. This is useful to skip test scope dependencies because they do not go to library users' class path. Fixes #12895 b/505481903
1 parent 6f3a96b commit d1585fc

19 files changed

Lines changed: 289 additions & 41 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,6 @@ jobs:
251251
matrix:
252252
package: ${{ fromJSON(needs.changes.outputs.packages) }}
253253
steps:
254-
- name: Get current week within the year
255-
id: date
256-
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
257254
- uses: actions/checkout@v4
258255
- uses: actions/setup-java@v4
259256
with:
@@ -264,8 +261,23 @@ jobs:
264261
BUILD_SUBDIR: ${{matrix.package}}
265262
JOB_TYPE: clirr
266263
JOB_NAME: clirr-${{matrix.package}}
264+
split-dependencies:
265+
runs-on: ubuntu-latest
266+
needs: changes
267+
strategy:
268+
matrix:
269+
package: ${{ fromJSON(needs.changes.outputs.packages) }}
270+
steps:
271+
- uses: actions/checkout@v4
272+
- uses: actions/setup-java@v4
273+
with:
274+
distribution: temurin
275+
java-version: 17
276+
- run: .kokoro/dependencies.sh
277+
env:
278+
BUILD_SUBDIR: ${{matrix.package}}
267279
required:
268-
needs: [ changes, split-units, split-clirr ]
280+
needs: [ changes, split-units, split-clirr, split-dependencies ]
269281
name: conditional-required-check
270282
if: ${{ always() }} # Always run even if any "needs" jobs fail
271283
runs-on: ubuntu-22.04

.github/workflows/google-auth-library-java-ci.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,20 @@ jobs:
7070
env:
7171
JOB_TYPE: clirr
7272
BUILD_SUBDIR: google-auth-library-java
73+
dependencies:
74+
needs: filter
75+
if: ${{ needs.filter.outputs.library == 'true' }}
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: actions/checkout@v4
79+
- uses: actions/setup-java@v4
80+
with:
81+
distribution: temurin
82+
java-version: 17
83+
- run: .kokoro/dependencies.sh
7384

7485
required:
75-
needs: [ units-logging, clirr ]
86+
needs: [ units-logging, clirr, dependencies ]
7687
name: conditional-required-check
7788
if: ${{ always() }} # Always run even if any "needs" jobs fail
7889
runs-on: ubuntu-22.04

.github/workflows/java-spanner-jdbc-ci.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,12 @@ jobs:
104104
needs: filter
105105
if: ${{ needs.filter.outputs.library == 'true' }}
106106
runs-on: ubuntu-latest
107-
strategy:
108-
matrix:
109-
java: [17]
110107
steps:
111108
- uses: actions/checkout@v4
112109
- uses: actions/setup-java@v4
113110
with:
114111
distribution: temurin
115-
java-version: ${{matrix.java}}
116-
- run: java -version
112+
java-version: 17
117113
- run: .kokoro/dependencies.sh
118114
javadoc:
119115
needs: filter

.github/workflows/java-storage-nio-ci.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,12 @@ jobs:
104104
needs: filter
105105
if: ${{ needs.filter.outputs.library == 'true' }}
106106
runs-on: ubuntu-latest
107-
strategy:
108-
matrix:
109-
java: [17]
110107
steps:
111108
- uses: actions/checkout@v4
112109
- uses: actions/setup-java@v4
113110
with:
114111
distribution: temurin
115-
java-version: ${{matrix.java}}
116-
- run: java -version
112+
java-version: 17
117113
- run: .kokoro/dependencies.sh
118114
javadoc:
119115
needs: filter

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,20 @@ jobs:
6969
JOB_TYPE: clirr
7070
BUILD_SUBDIR: sdk-platform-java
7171

72+
dependencies:
73+
needs: filter
74+
if: ${{ needs.filter.outputs.library == 'true' }}
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v4
78+
- uses: actions/setup-java@v4
79+
with:
80+
distribution: temurin
81+
java-version: 17
82+
- run: .kokoro/dependencies.sh
83+
env:
84+
BUILD_SUBDIR: sdk-platform-java
85+
7286
sdk-platform-java-8:
7387
needs: filter
7488
if: ${{ needs.filter.outputs.library == 'true' }}

.kokoro/dependencies.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ then
5858
fi
5959

6060
# this should run maven enforcer
61-
retry_with_backoff 3 10 \
62-
mvn install -B -V -ntp \
63-
-Pquick-build -DskipTests=true -Dmaven.javadoc.skip=true -Denforcer.skip=false
61+
mvn install -B -V -ntp \
62+
-Pquick-build -DskipTests=true -Dmaven.javadoc.skip=true -Denforcer.skip=false
6463

6564
mvn -B dependency:analyze -Pquick-build -DfailOnWarning=true -Dmdep.analyze.skip=false
6665

google-auth-library-java/cab-token-generator/pom.xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
</properties>
2323

2424
<dependencies>
25+
<dependency>
26+
<groupId>com.google.guava</groupId>
27+
<artifactId>guava</artifactId>
28+
</dependency>
2529
<dependency>
2630
<groupId>com.google.auth</groupId>
2731
<artifactId>google-auth-library-oauth2-http</artifactId>
@@ -38,21 +42,19 @@
3842
<groupId>com.google.errorprone</groupId>
3943
<artifactId>error_prone_annotations</artifactId>
4044
</dependency>
41-
<dependency>
42-
<groupId>com.google.guava</groupId>
43-
<artifactId>guava</artifactId>
44-
</dependency>
4545
<dependency>
4646
<groupId>com.google.protobuf</groupId>
4747
<artifactId>protobuf-java</artifactId>
4848
</dependency>
4949
<dependency>
5050
<groupId>dev.cel</groupId>
5151
<artifactId>cel</artifactId>
52-
</dependency>
53-
<dependency>
54-
<groupId>com.google.code.findbugs</groupId>
55-
<artifactId>jsr305</artifactId>
52+
<exclusions>
53+
<exclusion>
54+
<groupId>com.google.code.findbugs</groupId>
55+
<artifactId>annotations</artifactId>
56+
</exclusion>
57+
</exclusions>
5658
</dependency>
5759
<dependency>
5860
<groupId>com.google.crypto.tink</groupId>

google-cloud-jar-parent/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
</parent>
2121
<properties>
2222
<skipUnitTests>false</skipUnitTests>
23+
<ignoreNonCompile>true</ignoreNonCompile><!-- maven-dependency-plugin:analyze to skip test scope dependencies -->
2324
</properties>
2425

2526
<dependencyManagement>

java-bigquery/google-cloud-bigquery-jdbc/pom.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3131
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
3232
<github.global.server>github</github.global.server>
33-
<site.installationModule>google-cloud-bigquery-jdbc
34-
</site.installationModule>
33+
<site.installationModule>google-cloud-bigquery-jdbc</site.installationModule>
3534
</properties>
3635

3736
<build>
@@ -278,6 +277,11 @@
278277
</dependency>
279278

280279
<!-- Test Dependencies -->
280+
<dependency>
281+
<groupId>junit</groupId>
282+
<artifactId>junit</artifactId>
283+
<scope>test</scope>
284+
</dependency>
281285
<dependency>
282286
<groupId>com.google.truth</groupId>
283287
<artifactId>truth</artifactId>
@@ -372,4 +376,4 @@
372376
</properties>
373377
</profile>
374378
</profiles>
375-
</project>
379+
</project>

java-showcase/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<checkstyle.skip>true</checkstyle.skip>
2525
<clirr.skip>true</clirr.skip>
2626
<enforcer.skip>true</enforcer.skip>
27+
<mdep.analyze.skip>true</mdep.analyze.skip><!-- The showcase modules are not meant for library customers. -->
2728
</properties>
2829

2930
<dependencyManagement>

0 commit comments

Comments
 (0)