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

refactor(dependency): add explicit dependency of google-http-client-jackson2 while upgrading spockframework 2.3 #1061

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

j-sandy
Copy link
Contributor

@j-sandy j-sandy commented Oct 2, 2024

While upgrading spockframework 2.3-groovy-4.0, encountered below error during the build process of kayenta-google module:

/kayenta/kayenta-google/src/main/java/com/netflix/kayenta/google/security/GoogleClientFactory.java:24: error: package com.google.api.client.json.jackson2 does not exist
import com.google.api.client.json.jackson2.JacksonFactory;

Further, dependency insight does not show the dependency of google-http-client-jackson2:

> Task :kayenta-google:dependencyInsight
No dependencies matching given input were found in configuration ':kayenta-google:compileClasspath'

Whereas, before the spockframework upgrade this dependency transitively appears in insight:

> Task :kayenta-google:dependencyInsight
com.google.http-client:google-http-client-jackson2:1.41.7
  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

com.google.http-client:google-http-client-jackson2:1.41.7
\--- io.spinnaker.orca:orca-bom:8.55.0
     \--- compileClasspath

com.google.http-client:google-http-client-jackson2:1.36.0 -> 1.41.7
\--- com.google.api-client:google-api-client:1.30.10
     +--- io.spinnaker.orca:orca-bom:8.55.0
     |    \--- compileClasspath
     +--- com.google.apis:google-api-services-monitoring:v3-rev477-1.25.0 (requested com.google.api-client:google-api-client:1.25.0)
     |    +--- compileClasspath (requested com.google.apis:google-api-services-monitoring)
     |    \--- io.spinnaker.orca:orca-bom:8.55.0 (*)
     \--- com.google.apis:google-api-services-storage:v1-rev141-1.25.0 (requested com.google.api-client:google-api-client:1.25.0)
          +--- compileClasspath (requested com.google.apis:google-api-services-storage)
          \--- io.spinnaker.orca:orca-bom:8.55.0 (*)

So, adding explicit dependency of google-http-client-jackson2 in kayenta-google.gradle

Dependency insight after refactor:

> Task :kayenta-google:dependencyInsight
com.google.http-client:google-http-client-jackson2:1.41.7
  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

com.google.http-client:google-http-client-jackson2:1.41.7
\--- io.spinnaker.orca:orca-bom:spock-2-3-SNAPSHOT
     \--- compileClasspath

com.google.http-client:google-http-client-jackson2 -> 1.41.7
\--- compileClasspath

…ackson2 in kayenta-google while upgrading spockframework 2.3

While upgrading spockframework 2.3-groovy-4.0, encountered below error during the build process of kayenta-google module:
```
/kayenta/kayenta-google/src/main/java/com/netflix/kayenta/google/security/GoogleClientFactory.java:24: error: package com.google.api.client.json.jackson2 does not exist
import com.google.api.client.json.jackson2.JacksonFactory;
```
Further, dependency insight does not show the dependency of `google-http-client-jackson2`:
```
> Task :kayenta-google:dependencyInsight
No dependencies matching given input were found in configuration ':kayenta-google:compileClasspath'
```

Whereas, before the spockframework upgrade this dependency transitively appears in insight:
```
> Task :kayenta-google:dependencyInsight
com.google.http-client:google-http-client-jackson2:1.41.7
  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

com.google.http-client:google-http-client-jackson2:1.41.7
\--- io.spinnaker.orca:orca-bom:8.55.0
     \--- compileClasspath

com.google.http-client:google-http-client-jackson2:1.36.0 -> 1.41.7
\--- com.google.api-client:google-api-client:1.30.10
     +--- io.spinnaker.orca:orca-bom:8.55.0
     |    \--- compileClasspath
     +--- com.google.apis:google-api-services-monitoring:v3-rev477-1.25.0 (requested com.google.api-client:google-api-client:1.25.0)
     |    +--- compileClasspath (requested com.google.apis:google-api-services-monitoring)
     |    \--- io.spinnaker.orca:orca-bom:8.55.0 (*)
     \--- com.google.apis:google-api-services-storage:v1-rev141-1.25.0 (requested com.google.api-client:google-api-client:1.25.0)
          +--- compileClasspath (requested com.google.apis:google-api-services-storage)
          \--- io.spinnaker.orca:orca-bom:8.55.0 (*)
```
So, adding explicit dependency of `google-http-client-jackson2` in kayenta-google.gradle

Dependency insight after refactor:
```
> Task :kayenta-google:dependencyInsight
com.google.http-client:google-http-client-jackson2:1.41.7
  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

com.google.http-client:google-http-client-jackson2:1.41.7
\--- io.spinnaker.orca:orca-bom:spock-2-3-SNAPSHOT
     \--- compileClasspath

com.google.http-client:google-http-client-jackson2 -> 1.41.7
\--- compileClasspath
```
@dbyron-sf dbyron-sf added the ready to merge Reviewed and ready for merge label Oct 2, 2024
@mergify mergify bot added the auto merged label Oct 2, 2024
@mergify mergify bot merged commit 0f0c30b into spinnaker:master Oct 2, 2024
11 checks passed
@j-sandy j-sandy deleted the spock-2-3 branch October 2, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants