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

fix(dependency): Forcing oci-java-sdk-objectstorage version for desired conflict resolution. #1096

Merged
merged 1 commit into from
Feb 26, 2022

Conversation

j-sandy
Copy link
Contributor

@j-sandy j-sandy commented Feb 25, 2022

While enforcing the direct and transitive dependencies strictly from kork-bom using "enforcedPlatform" in build.gradle as:

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

oci-java-sdk-bom:1.5.17 is overriding the oci-java-sdk-objectstorage:1.19.1 (transitive dependency) version, which is an older version coming from kork-bom mentioned in spinnaker-dependencies.gradle.
It is causing an error in front50-oracle module as given below:

> Task :front50-oracle:compileJava
/home/ubuntu/spinnaker-comp/sb-upgrade-2-3-12/front50/front50-oracle/src/main/java/com/netflix/spinnaker/front50/model/OracleStorageService.java:232: error: cannot find symbol
            buildObjectKey(objectType, summary.getName()), summary.getTimeModified().getTime());
                                                                  ^
  symbol:   method getTimeModified()
  location: variable summary of type ObjectSummary
Note: /home/ubuntu/spinnaker-comp/sb-upgrade-2-3-12/front50/front50-oracle/src/main/java/com/netflix/spinnaker/front50/model/OracleStorageService.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

> Task :front50-oracle:compileJava FAILED

FAILURE: Build failed with an exception.

In order to fix, we require oci-java-sdk-objectstorage:1.19.1 to force restore.
Forcing the specified version will take precedence during conflict resolution and provide desired version.

…ired conflict resolution.

While enforcing the direct and transitive dependencies strictly from kork-bom using "enforcedPlatform" in build.gradle as:

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

oci-java-sdk-bom:1.5.17 is overriding the oci-java-sdk-objectstorage:1.19.1 (transitive dependency) version, which is an older version coming from kork-bom mentioned in spinnaker-dependencies.gradle.
It is causing an error in front50-oracle module as given below:

> Task :front50-oracle:compileJava
/home/ubuntu/spinnaker-comp/sb-upgrade-2-3-12/front50/front50-oracle/src/main/java/com/netflix/spinnaker/front50/model/OracleStorageService.java:232: error: cannot find symbol
            buildObjectKey(objectType, summary.getName()), summary.getTimeModified().getTime());
                                                                  ^
  symbol:   method getTimeModified()
  location: variable summary of type ObjectSummary
Note: /home/ubuntu/spinnaker-comp/sb-upgrade-2-3-12/front50/front50-oracle/src/main/java/com/netflix/spinnaker/front50/model/OracleStorageService.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

> Task :front50-oracle:compileJava FAILED

FAILURE: Build failed with an exception.

In order to fix, we require oci-java-sdk-objectstorage:1.19.1 to force restore.
Forcing the specified version will take precedence during conflict resolution and provide desired version.
@j-sandy
Copy link
Contributor Author

j-sandy commented Feb 25, 2022

Dependency insight after applying "enforcedPlatform":

$ ./gradlew front50-oracle:dI --dependency oci-java-sdk-objectstorage
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :front50-oracle:dependencyInsight
com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.5.17
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes+resources)
      org.gradle.category            = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.version         = 11
   ]
   Selection reasons:
      - By constraint
      - Forced

com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.5.17
\--- io.spinnaker.kork:kork-bom:7.132.0
     \--- compileClasspath

com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.19.1 -> 1.5.17
\--- compileClasspath

com.oracle.oci.sdk:oci-java-sdk-objectstorage-extensions:1.5.17
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes+resources)
      org.gradle.category            = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.version         = 11
   ]

com.oracle.oci.sdk:oci-java-sdk-objectstorage-extensions:1.5.17
\--- com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.5.17
     +--- compileClasspath (requested com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.19.1)
     \--- io.spinnaker.kork:kork-bom:7.132.0
          \--- compileClasspath

com.oracle.oci.sdk:oci-java-sdk-objectstorage-generated:1.5.17
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes+resources)
      org.gradle.category            = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.version         = 11
   ]

com.oracle.oci.sdk:oci-java-sdk-objectstorage-generated:1.5.17
+--- com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.5.17
|    +--- compileClasspath (requested com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.19.1)
|    \--- io.spinnaker.kork:kork-bom:7.132.0
|         \--- compileClasspath
\--- com.oracle.oci.sdk:oci-java-sdk-objectstorage-extensions:1.5.17
     \--- com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.5.17 (*)

@j-sandy
Copy link
Contributor Author

j-sandy commented Feb 25, 2022

Dependency insight after applying "enforcedPlatform" and apply fix:

$ ./gradlew front50-oracle:dI --dependency oci-java-sdk-objectstorage

> Task :front50-oracle:dependencyInsight
com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.19.1
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes+resources)
      org.gradle.category            = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.version         = 11
   ]
   Selection reasons:
      - Forced
      - By constraint

com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.19.1
\--- compileClasspath

com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.5.17 -> 1.19.1
\--- io.spinnaker.kork:kork-bom:7.132.0
     \--- compileClasspath

com.oracle.oci.sdk:oci-java-sdk-objectstorage-extensions:1.19.1
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes+resources)
      org.gradle.category            = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.version         = 11
   ]

com.oracle.oci.sdk:oci-java-sdk-objectstorage-extensions:1.19.1
\--- com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.19.1
     +--- compileClasspath
     \--- io.spinnaker.kork:kork-bom:7.132.0 (requested com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.5.17)
          \--- compileClasspath

com.oracle.oci.sdk:oci-java-sdk-objectstorage-generated:1.19.1
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes+resources)
      org.gradle.category            = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.version         = 11
   ]

com.oracle.oci.sdk:oci-java-sdk-objectstorage-generated:1.19.1
+--- com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.19.1
|    +--- compileClasspath
|    \--- io.spinnaker.kork:kork-bom:7.132.0 (requested com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.5.17)
|         \--- compileClasspath
\--- com.oracle.oci.sdk:oci-java-sdk-objectstorage-extensions:1.19.1
     \--- com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.19.1 (*)

@j-sandy j-sandy changed the title fix(dependencies): Forcing oci-java-sdk-objectstorage version for desired conflict resolution. fix(dependency): Forcing oci-java-sdk-objectstorage version for desired conflict resolution. Feb 25, 2022
@dbyron-sf dbyron-sf added the ready to merge Approved and ready for merge label Feb 26, 2022
@mergify mergify bot added the auto merged label Feb 26, 2022
@mergify mergify bot merged commit 9813016 into spinnaker:master Feb 26, 2022
@j-sandy j-sandy deleted the sb-upgrade-2-3-12 branch February 28, 2022 04:58
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