Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove failures from ./gradlew dependencies #6136

Merged
merged 8 commits into from
Jan 8, 2024

Conversation

dbyron-sf
Copy link
Contributor

@dbyron-sf dbyron-sf commented Jan 8, 2024

Various gradle cleanups with the goal of removing failures from $ ./gradlew dependencies output from all clouddriver modules. Happily, all the failures are gone.

FWIW, I often use this to poke around for dependency changes

alias gradle-all-deps='./gradlew --no-parallel --stacktrace dependencies $(./gradlew -q projects \
    | grep -Fe ---\ Project \
    | sed -Ee "s/^.+--- Project '"'([^']+)'/\1:dependencies/"'" | sort)'

inspired by https://stackoverflow.com/a/65945289

Before this PR, build.gradle had:

      implementation enforcedPlatform("io.spinnaker.kork:kork-bom:$korkVersion")

which applies to all submodules other than clouddriver-api and clouddriver-bom.

Other references to io.spinnaker.kork:kork-bom used

platform("io.spinnaker.kork:kork-bom:$korkVersion")

This changes all references to use enforcedPlatform with the idea that kork-bom really is supposed to govern.  There were no differences in the output of

$ ./gradle clouddriver-bom:dependencies

with this change.

There were differences in the output of

$ ./gradle clouddriver-api:dependencies

though.  Before:

|    +--- org.yaml:snakeyaml:1.27 -> 1.28 (c)

|    +--- org.apache.tomcat.embed:tomcat-embed-core:9.0.69 -> 9.0.75 (c)
|    +--- org.apache.tomcat.embed:tomcat-embed-el:9.0.69 -> 9.0.75 (c)
|    +--- org.apache.tomcat.embed:tomcat-embed-websocket:9.0.69 -> 9.0.75 (c)

after:

|    +--- org.yaml:snakeyaml:1.27 (c)

|    +--- org.apache.tomcat.embed:tomcat-embed-core:9.0.69 (c)
|    +--- org.apache.tomcat.embed:tomcat-embed-el:9.0.69 (c)
|    +--- org.apache.tomcat.embed:tomcat-embed-websocket:9.0.69 (c)

and note that kork does currently specify snakeyaml 1.27 [here](https://github.com/spinnaker/kork/blob/caabf0864e5d73f7af4e40ef61665ff9b1ab02c6/spinnaker-dependencies/spinnaker-dependencies.gradle#L176), and tomcat 9.0.69 [here](https://github.com/spinnaker/kork/blob/caabf0864e5d73f7af4e40ef61665ff9b1ab02c6/spinnaker-dependencies/spinnaker-dependencies.gradle#L35).
to remove failures from e.g. ./gradlew clouddriver-web:dependencies

testRuntimeOnlyDependenciesMetadata
\--- org.junit.jupiter:junit-jupiter-engine FAILED

similar to spinnaker/kork#1126
build.gradle applies the same to all subprojects so there's no need to specify it again.
No change to `$ ./gradle cats:cats-core:dependencies`, and no change to the number of
tests executed: 129.

Same for cats-redis with 71 tests, and cats-test which has no tests.
build.gradle declares these dependencies

annotationProcessor "org.projectlombok:lombok"
testAnnotationProcessor "org.projectlombok:lombok"

to all subprojects other than clouddriver-api and clouddriver-bom, so there's no need to declare them in the subprojects.

No change to `./gradlew dependencies` output in any of these subprojects.
to all subprojects other than clouddriver-api and clouddriver-bom.

This removes failures from ./gradlew dependencies output for projects that need versions from kork-bom for api dependencies, e.g. clouddriver-api-tck.

before:

api - API dependencies for compilation 'main' (target  (jvm)). (n)
+--- org.springframework.boot:spring-boot-starter-test (n)
\--- dev.minutest:minutest (n)

apiDependenciesMetadata
+--- org.springframework.boot:spring-boot-starter-test FAILED
+--- dev.minutest:minutest FAILED
\--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.32
     +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.32
     |    +--- org.jetbrains:annotations:13.0
     |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.5.32
     \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.32
          \--- org.jetbrains.kotlin:kotlin-stdlib:1.5.32 (*)

after:

api - API dependencies for compilation 'main' (target  (jvm)). (n)
+--- io.spinnaker.kork:kork-bom:7.209.0 (n)
+--- org.springframework.boot:spring-boot-starter-test (n)
\--- dev.minutest:minutest (n)

apiDependenciesMetadata
+--- io.spinnaker.kork:kork-bom:7.209.0
|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.32 (c)
|    +--- org.springframework.boot:spring-boot-starter-test:2.5.15 (c)
|    +--- dev.minutest:minutest:1.13.0 (c)
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.32 (c)
|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.32 (c)
|    +--- org.springframework.boot:spring-boot-starter:2.5.15 (c)
|    +--- org.springframework.boot:spring-boot-test:2.5.15 (c)
|    +--- org.springframework.boot:spring-boot-test-autoconfigure:2.5.15 (c)
|    +--- com.jayway.jsonpath:json-path:2.5.0 (c)
|    +--- jakarta.xml.bind:jakarta.xml.bind-api:2.3.3 (c)
|    +--- org.assertj:assertj-core:3.19.0 (c)
|    +--- org.hamcrest:hamcrest:2.2 (c)
|    +--- org.junit.jupiter:junit-jupiter:5.8.2 (c)
|    +--- org.mockito:mockito-core:3.9.0 (c)
|    +--- org.mockito:mockito-junit-jupiter:3.9.0 (c)
|    +--- org.skyscreamer:jsonassert:1.5.1 (c)
|    +--- org.springframework:spring-core:5.3.27 (c)
|    +--- org.springframework:spring-test:5.3.27 (c)
|    +--- org.xmlunit:xmlunit-core:2.8.4 (c)
|    +--- org.jetbrains:annotations:19.0.0 (c)
|    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.5.32 (c)
|    +--- org.springframework.boot:spring-boot:2.5.15 (c)
|    +--- org.springframework.boot:spring-boot-autoconfigure:2.5.15 (c)
|    +--- org.springframework.boot:spring-boot-starter-logging:2.5.15 (c)
|    +--- jakarta.annotation:jakarta.annotation-api:1.3.5 (c)
|    +--- org.yaml:snakeyaml:1.27 (c)
|    +--- net.minidev:json-smart:2.4.10 (c)
|    +--- org.slf4j:slf4j-api:1.7.36 (c)
|    +--- jakarta.activation:jakarta.activation-api:1.2.2 (c)
|    +--- org.junit.jupiter:junit-jupiter-api:5.8.2 (c)
|    +--- org.junit.jupiter:junit-jupiter-params:5.8.2 (c)
|    +--- net.bytebuddy:byte-buddy:1.10.22 (c)
|    +--- net.bytebuddy:byte-buddy-agent:1.10.22 (c)
|    +--- org.objenesis:objenesis:2.5.1 (c)
|    +--- org.springframework:spring-jcl:5.3.27 (c)
|    +--- org.springframework:spring-context:5.3.27 (c)
|    +--- ch.qos.logback:logback-classic:1.2.12 (c)
|    +--- org.apache.logging.log4j:log4j-to-slf4j:2.20.0 (c)
|    +--- org.slf4j:jul-to-slf4j:1.7.36 (c)
|    +--- org.junit.platform:junit-platform-commons:1.8.2 (c)
|    +--- org.springframework:spring-aop:5.3.27 (c)
|    +--- org.springframework:spring-beans:5.3.27 (c)
|    +--- org.springframework:spring-expression:5.3.27 (c)
|    +--- ch.qos.logback:logback-core:1.2.12 (c)
|    \--- org.apache.logging.log4j:log4j-api:2.20.0 (c)
+--- org.springframework.boot:spring-boot-starter-test -> 2.5.15
|    +--- org.springframework.boot:spring-boot-starter:2.5.15
|    |    +--- org.springframework.boot:spring-boot:2.5.15
|    |    |    +--- org.springframework:spring-core:5.3.27
|    |    |    |    \--- org.springframework:spring-jcl:5.3.27
|    |    |    \--- org.springframework:spring-context:5.3.27
|    |    |         +--- org.springframework:spring-aop:5.3.27
|    |    |         |    +--- org.springframework:spring-beans:5.3.27
|    |    |         |    |    \--- org.springframework:spring-core:5.3.27 (*)
|    |    |         |    \--- org.springframework:spring-core:5.3.27 (*)
|    |    |         +--- org.springframework:spring-beans:5.3.27 (*)
|    |    |         +--- org.springframework:spring-core:5.3.27 (*)
|    |    |         \--- org.springframework:spring-expression:5.3.27
|    |    |              \--- org.springframework:spring-core:5.3.27 (*)
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.5.15
|    |    |    \--- org.springframework.boot:spring-boot:2.5.15 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging:2.5.15
|    |    |    +--- ch.qos.logback:logback-classic:1.2.12
|    |    |    |    +--- ch.qos.logback:logback-core:1.2.12
|    |    |    |    \--- org.slf4j:slf4j-api:1.7.32 -> 1.7.36
|    |    |    +--- org.apache.logging.log4j:log4j-to-slf4j:2.17.2 -> 2.20.0
|    |    |    |    +--- org.apache.logging.log4j:log4j-api:2.20.0
|    |    |    |    \--- org.slf4j:slf4j-api:1.7.36
|    |    |    \--- org.slf4j:jul-to-slf4j:1.7.36
|    |    |         \--- org.slf4j:slf4j-api:1.7.36
|    |    +--- jakarta.annotation:jakarta.annotation-api:1.3.5
|    |    +--- org.springframework:spring-core:5.3.27 (*)
|    |    \--- org.yaml:snakeyaml:1.28 -> 1.27
|    +--- org.springframework.boot:spring-boot-test:2.5.15
|    |    \--- org.springframework.boot:spring-boot:2.5.15 (*)
|    +--- org.springframework.boot:spring-boot-test-autoconfigure:2.5.15
|    |    +--- org.springframework.boot:spring-boot:2.5.15 (*)
|    |    +--- org.springframework.boot:spring-boot-test:2.5.15 (*)
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:2.5.15 (*)
|    +--- com.jayway.jsonpath:json-path:2.5.0
|    |    +--- net.minidev:json-smart:2.3 -> 2.4.10
|    |    |    \--- net.minidev:accessors-smart:2.4.9
|    |    |         \--- org.ow2.asm:asm:9.3
|    |    \--- org.slf4j:slf4j-api:1.7.30 -> 1.7.36
|    +--- jakarta.xml.bind:jakarta.xml.bind-api:2.3.3
|    |    \--- jakarta.activation:jakarta.activation-api:1.2.2
|    +--- org.assertj:assertj-core:3.19.0
|    +--- org.hamcrest:hamcrest:2.2
|    +--- org.junit.jupiter:junit-jupiter:5.7.2 -> 5.8.2
|    |    +--- org.junit:junit-bom:5.8.2
|    |    |    +--- org.junit.jupiter:junit-jupiter:5.8.2 (c)
|    |    |    +--- org.junit.jupiter:junit-jupiter-api:5.8.2 (c)
|    |    |    +--- org.junit.jupiter:junit-jupiter-params:5.8.2 (c)
|    |    |    \--- org.junit.platform:junit-platform-commons:1.8.2 (c)
|    |    +--- org.junit.jupiter:junit-jupiter-api:5.8.2
|    |    |    +--- org.junit:junit-bom:5.8.2 (*)
|    |    |    +--- org.opentest4j:opentest4j:1.2.0
|    |    |    +--- org.junit.platform:junit-platform-commons:1.8.2
|    |    |    |    +--- org.junit:junit-bom:5.8.2 (*)
|    |    |    |    \--- org.apiguardian:apiguardian-api:1.1.2
|    |    |    \--- org.apiguardian:apiguardian-api:1.1.2
|    |    \--- org.junit.jupiter:junit-jupiter-params:5.8.2
|    |         +--- org.junit:junit-bom:5.8.2 (*)
|    |         +--- org.junit.jupiter:junit-jupiter-api:5.8.2 (*)
|    |         \--- org.apiguardian:apiguardian-api:1.1.2
|    +--- org.mockito:mockito-core:3.9.0
|    |    +--- net.bytebuddy:byte-buddy:1.10.20 -> 1.10.22
|    |    +--- net.bytebuddy:byte-buddy-agent:1.10.20 -> 1.10.22
|    |    \--- org.objenesis:objenesis:3.2 -> 2.5.1
|    +--- org.mockito:mockito-junit-jupiter:3.9.0
|    |    \--- org.mockito:mockito-core:3.9.0 (*)
|    +--- org.skyscreamer:jsonassert:1.5.1
|    |    \--- com.vaadin.external.google:android-json:0.0.20131108.vaadin1
|    +--- org.springframework:spring-core:5.3.27 (*)
|    +--- org.springframework:spring-test:5.3.27
|    |    \--- org.springframework:spring-core:5.3.27 (*)
|    \--- org.xmlunit:xmlunit-core:2.8.4
+--- dev.minutest:minutest -> 1.13.0
\--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.32
     +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.32
     |    +--- org.jetbrains:annotations:13.0 -> 19.0.0
     |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.5.32
     \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.32
          \--- org.jetbrains.kotlin:kotlin-stdlib:1.5.32 (*)

In addition to removing those failures, it does change ./gradlew dependencies output for modules with no api dependencies (e.g. cats:cats-core).

before:

api - API dependencies for compilation 'main' (target  (jvm)). (n)
No dependencies

apiDependenciesMetadata
\--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.32
     +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.32
     |    +--- org.jetbrains:annotations:13.0
     |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.5.32
     \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.32
          \--- org.jetbrains.kotlin:kotlin-stdlib:1.5.32 (*)

after:

api - API dependencies for compilation 'main' (target  (jvm)). (n)
\--- io.spinnaker.kork:kork-bom:7.209.0 (n)

apiDependenciesMetadata
+--- io.spinnaker.kork:kork-bom:7.209.0
|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.32 (c)
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.32 (c)
|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.32 (c)
|    +--- org.jetbrains:annotations:19.0.0 (c)
|    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.5.32 (c)
\--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.32
     +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.32
     |    +--- org.jetbrains:annotations:13.0 -> 19.0.0
     |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.5.32
     \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.32
          \--- org.jetbrains.kotlin:kotlin-stdlib:1.5.32 (*)
…n lombok

to all submodules except clouddriver-api and clouddriver-bom in build.gradle, to reduce duplication.  As well, declare dependencies on kork-bom for compileOnly and testCompileOnly to remove failures from ./gradlew dependencies output.  No other changes to dependencies output except removing these failures.

before:

compileOnly - Compile only dependencies for compilation 'main' (target  (jvm)).
\--- org.projectlombok:lombok FAILED

compileOnlyDependenciesMetadata
\--- org.projectlombok:lombok FAILED

after:

compileOnly - Compile only dependencies for compilation 'main' (target  (jvm)).
+--- io.spinnaker.kork:kork-bom:7.209.0
|    \--- org.projectlombok:lombok:1.18.26 (c)
\--- org.projectlombok:lombok -> 1.18.26

compileOnlyDependenciesMetadata
+--- io.spinnaker.kork:kork-bom:7.209.0
|    \--- org.projectlombok:lombok:1.18.26 (c)
\--- org.projectlombok:lombok -> 1.18.26
Copy link
Contributor

@jvz jvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's repetitive stuff like this where Maven really shines compared to Gradle. :D

@dbyron-sf dbyron-sf added the ready to merge Approved and ready for a merge label Jan 8, 2024
@mergify mergify bot added the auto merged Merged automatically by a bot label Jan 8, 2024
@mergify mergify bot merged commit 0678d33 into spinnaker:master Jan 8, 2024
16 checks passed
@dbyron-sf dbyron-sf deleted the gradle-cleanups branch January 8, 2024 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for a merge target-release/1.34
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants