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

Upgrade AWS Java SDK to 1.12.228 #334

Merged
merged 1 commit into from
May 27, 2022

Conversation

NathanielRN
Copy link
Contributor

@NathanielRN NathanielRN commented May 25, 2022

Issue #, if available: #333

Description of changes:

Upgrade AWS SDK for Java to version 1.12.228. This was inspired by the same changes we made in #256.

We fixed several issues along the way:

  • All of a sudden when we updated to AWS SDK version 1.12.228, many dependencies could not be resolved even though they were definitely there. Worked with a colleague to find out that this is a Gradle 6 issue. Updating gradle with ./gradlew wrapper --gradle-version=7.4.2 fixed the issue 🥳
    • This was the error we were seeing which we were able to Google:
       What went wrong:
       Execution failed for task ':aws-xray-recorder-sdk-core:dependencies'.
       > Could not resolve all dependencies for configuration ':aws-xray-recorder-sdk-core:testCompileClasspath'.
       > Problems reading data from Binary store in /private/var/folders/5s/kz556x054vz8l7204yh4j9krq6bwmm/T/gradle9062832512095609875.bin offset 29727 exists? true
      
    • The reason is:

      it's an issue with the binary serialization that occurs when the dependency graphs are resolved, and our project triggered one of them when we upgrade to AWS Java SDK 1.12.x for some reason.

  • We had to update the junit-bom to version 5.8.2 because its dependencies do not support junit version 1.12 which is another package we pull in
  • Once we upgrade Gradle to version 7, a package that checks our license version started failing due to missing annotations. This was fixed in version 0.16.1 of that package so we updated it here.

Cool thing I learned:

Your first instinct should be to check if all dependencies resolved when working with gradle.

i.e. ./gradlew :a-x-r-s-c:dependencies

a-x-r-s-c is short for aws-xray-recorder-sdk-core.

and then google whatever failure comes out 🙂

Fixes #333

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@NathanielRN NathanielRN requested a review from a team as a code owner May 25, 2022 18:54
@NathanielRN NathanielRN force-pushed the upgrade-aws-java-sdk-1.12.x branch 2 times, most recently from 79c08df to 464a415 Compare May 26, 2022 08:18
@codecov-commenter
Copy link

codecov-commenter commented May 26, 2022

Codecov Report

Merging #334 (a160a74) into master (2dcd09e) will increase coverage by 0.05%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master     #334      +/-   ##
============================================
+ Coverage     58.86%   58.92%   +0.05%     
  Complexity     1206     1206              
============================================
  Files           131      131              
  Lines          5066     5066              
  Branches        593      593              
============================================
+ Hits           2982     2985       +3     
+ Misses         1809     1806       -3     
  Partials        275      275              
Impacted Files Coverage Δ
...in/java/com/amazonaws/xray/sql/SqlSubsegments.java 89.58% <ø> (ø)
.../java/com/amazonaws/xray/entities/SegmentImpl.java 91.13% <0.00%> (+3.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2dcd09e...a160a74. Read the comment docs.

@NathanielRN NathanielRN force-pushed the upgrade-aws-java-sdk-1.12.x branch from 464a415 to 9cd4bd7 Compare May 26, 2022 08:35
@NathanielRN NathanielRN force-pushed the upgrade-aws-java-sdk-1.12.x branch from 9cd4bd7 to 2dcd09e Compare May 27, 2022 19:54
@NathanielRN NathanielRN changed the title Upgrade AWS Java SDK to 1.12.227 Upgrade AWS Java SDK to 1.12.228 May 27, 2022
@NathanielRN NathanielRN reopened this May 27, 2022
@@ -18,14 +18,12 @@
import com.amazonaws.xray.AWSXRay;
import com.amazonaws.xray.entities.Namespace;
import com.amazonaws.xray.entities.Subsegment;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These formatting changes were failing the build, although I don't agree with them, added them for now and we can revisit the linter later.

"com.fasterxml.jackson:jackson-bom:2.11.0",
"org.junit:junit-bom:5.6.2"
"com.amazonaws:aws-java-sdk-bom:1.12.228",
"com.fasterxml.jackson:jackson-bom:2.12.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to remove this jackson reference and the one below, but it failed to find them at compileOnly time. I was hoping it would get it through the com.amazonaws:aws-java-sdk-bom dependency which requires them.

However, now my theory is that it won't see them because com.amazonaws:aws-java-sdk-bom doesn't import them in a way that is visible to downstream packages. So we will have to continue updating it for future AWS Java SDK updates.

Copy link

Choose a reason for hiding this comment

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

v1.12.x shadows Jackson dependencies since customers were relying on the version that came with the SDK, preventing the team from upgrading from insecure versions to newer ones without introducing breaking changes.

Hence the change in v1.12.x which forces customers to bring their own Jackson version.

Copy link
Contributor

@willarmiros willarmiros left a comment

Choose a reason for hiding this comment

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

Awesome! Looks like a great fix 🤠

@NathanielRN NathanielRN merged commit 5730d71 into aws:master May 27, 2022
@NathanielRN NathanielRN deleted the upgrade-aws-java-sdk-1.12.x branch May 27, 2022 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update of dependencies to comply with Whitesource security scan
5 participants