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

chore(dependency): add testImplementation of groovy-json dependency while upgrading to groovy 3.x #1172

Merged
merged 3 commits into from
Sep 21, 2023

Conversation

j-sandy
Copy link
Contributor

@j-sandy j-sandy commented Sep 19, 2023

While upgrading groovy from 2.5.15 to 3.0.10, encountered following error during igor-web:test :

> Task :igor-web:compileTestGroovy
startup failed:
/igor/igor-web/src/test/groovy/com/netflix/spinnaker/igor/build/InfoControllerSpec.groovy: 32: unable to resolve class groovy.json.JsonSlurper
 @ line 32, column 1.
   import groovy.json.JsonSlurper
   ^
1 error
> Task :igor-web:compileTestGroovy FAILED

To resolve this issue added testImplementation of org.codehaus.groovy:groovy-json in igor-web.gradle.

…hile upgrading to groovy 3.x

While upgrading groovy from 2.5.15 to 3.0.10, encountered following error during igor-web:test :
```
> Task :igor-web:compileTestGroovy
startup failed:
/igor/igor-web/src/test/groovy/com/netflix/spinnaker/igor/build/InfoControllerSpec.groovy: 32: unable to resolve class groovy.json.JsonSlurper
 @ line 32, column 1.
   import groovy.json.JsonSlurper
   ^
1 error
> Task :igor-web:compileTestGroovy FAILED
```
To resolve this issue added testImplementation of org.codehaus.groovy:groovy-json in igor-web.gradle.
@j-sandy
Copy link
Contributor Author

j-sandy commented Sep 20, 2023

With groovy 2.5.15 and spockframework 1.3-groovy-2.5, groovy-json appears as transitive dependency of spockframework as shown below:

$ ./gradlew igor-web:dI --dependency groovy-json --configuration testCompileClasspath
Starting a Gradle Daemon, 1 incompatible and 28 stopped Daemons could not be reused, use --status for details

> Task :igor-web:dependencyInsight
org.codehaus.groovy:groovy-json:2.5.15
  Variant compile:
    | Attribute Name                 | Provided | Requested         |
    |--------------------------------|----------|-------------------|
    | org.gradle.status              | release  |                   |
    | org.gradle.category            | library  | library           |
    | org.gradle.libraryelements     | jar      | classes+resources |
    | org.gradle.usage               | java-api | java-api          |
    | org.gradle.dependency.bundling |          | external          |
    | org.gradle.jvm.environment     |          | standard-jvm      |
    | org.gradle.jvm.version         |          | 11                |
   Selection reasons:
      - By constraint
      - Forced

org.codehaus.groovy:groovy-json:2.5.15
\--- io.spinnaker.kork:kork-bom:7.190.0
     \--- testCompileClasspath

org.codehaus.groovy:groovy-json:2.5.4 -> 2.5.15
+--- org.spockframework:spock-core:1.3-groovy-2.5
|    +--- testCompileClasspath (requested org.spockframework:spock-core)
|    +--- io.spinnaker.kork:kork-bom:7.190.0
|    |    \--- testCompileClasspath
|    \--- org.spockframework:spock-spring:1.3-groovy-2.5
|         +--- testCompileClasspath (requested org.spockframework:spock-spring)
|         \--- io.spinnaker.kork:kork-bom:7.190.0 (*)
\--- org.spockframework:spock-spring:1.3-groovy-2.5 (*)

While upgrading groovy 3.0.10 and spockframework 2.0-groovy-3.0, groovy-json is not part of spockframework

@j-sandy j-sandy marked this pull request as ready for review September 20, 2023 12:01
@dbyron-sf dbyron-sf added the ready to merge Approved and ready for merge label Sep 20, 2023
@mergify mergify bot added the auto merged label Sep 20, 2023
@dbyron-sf
Copy link
Contributor

@j-sandy please rebase and this'll go in.

@mergify mergify bot merged commit aaa075c into spinnaker:master Sep 21, 2023
5 checks passed
@j-sandy j-sandy deleted the groovy3-upgrade branch September 21, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants