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

Update json4s version to 4.0.3 and factor into val #297

Closed
wants to merge 1 commit into from

Conversation

ggrossman
Copy link
Contributor

@ggrossman ggrossman commented Dec 6, 2021

Problem

The latest version of json4s is 4.0.3.

util-jackson depends on json4s 3.6.11, and util-validator depends on json4s 3.6.7. (Seems like an accident that these are different.)

Other popular libraries, such as jwt-scala, now depend on json4s 4.0.3. This creates binary compatibility problems when Twitter Util is used in conjunction with these libraries:

[error] java.lang.RuntimeException: found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[error] 
[error] 	* org.json4s:json4s-core_2.12:4.0.3 (early-semver) is selected over {3.6.11, 3.6.7}
[error] 	    +- com.github.jwt-scala:jwt-json4s-common_2.12:9.0.2  (depends on 4.0.3)
[error] 	    +- com.twitter:util-validator_2.12:21.11.0            (depends on 3.6.7)
[error] 	    +- com.twitter:util-jackson_2.12:21.11.0              (depends on 3.6.11)
[error] 

Solution

Twitter Util should bump to json4s 4.0.3. I know that all libraries in the Twitter Stack bump these dependencies at the same time, so I have also provided a PR for Finatra. bijection is already on json4s 4.0.3. scrooge and finagle do not depend on json4s.

sbt test succeeds with json4s 4.0.3 and no other code changes.

I took the liberty of creating a val json4sVersion instead of having the version number separately in util-jackson and util-validator... this should help to keep them in sync in the future.

@CLAassistant
Copy link

CLAassistant commented Dec 6, 2021

CLA assistant check
All committers have signed the CLA.

@joybestourous
Copy link
Contributor

hey @ggrossman, please sign the contributor license agreement so we can get started on merging this. Thanks!

@ggrossman
Copy link
Contributor Author

Hi @joybestourous , thanks for looking at this. We'll sign the CLA as soon as possible. Our legal department is reviewing the CLA. Happy holidays!

@ggrossman
Copy link
Contributor Author

@joybestourous CLA is signed!

@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2021

Codecov Report

Merging #297 (2fb4579) into develop (86c9f42) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #297      +/-   ##
===========================================
- Coverage    52.63%   52.61%   -0.02%     
===========================================
  Files          318      318              
  Lines        16870    16870              
  Branches      1046     1036      -10     
===========================================
- Hits          8879     8876       -3     
- Misses        7991     7994       +3     
Impacted Files Coverage Δ
util-core/src/main/scala/com/twitter/io/Buf.scala 93.09% <0.00%> (-0.71%) ⬇️
...core/src/main/scala/com/twitter/util/Promise.scala 77.73% <0.00%> (ø)
...ore/src/main/scala/com/twitter/util/Duration.scala 85.39% <0.00%> (+0.56%) ⬆️

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 86c9f42...2fb4579. Read the comment docs.

finaglehelper pushed a commit to twitter/finatra that referenced this pull request Dec 17, 2021
**Problem**
The latest version of json4s is 4.0.3.

finatra depends on json4s 3.6.11.
util-jackson depends on json4s 3.6.11, and util-validator depends on json4s 3.6.7. (Seems like an accident that these are different.)

Other popular libraries, such as jwt-scala, now depend on json4s 4.0.3. This creates binary compatibility problems when Twitter Util is used in conjunction with these libraries:

```
[error] 	* org.json4s:json4s-core_2.12:4.0.3 (early-semver) is selected over {3.6.11, 3.6.11, 3.6.11, 3.6.7}
[error] 	    +- com.github.jwt-scala:jwt-json4s-common_2.12:9.0.2  (depends on 4.0.3)
[error] 	    +- com.twitter:util-validator_2.12:21.11.0            (depends on 3.6.7)
[error] 	    +- com.twitter:util-jackson_2.12:21.11.0              (depends on 3.6.11)
[error] 	    +- com.twitter:finatra-validation_2.12:21.11.0        (depends on 3.6.11)
[error] 	    +- com.twitter:finatra-jackson_2.12:21.11.0           (depends on 3.6.11)
[error]
```

**Solution**
Twitter Util should bump to json4s 4.0.3. I know that all libraries in the Twitter Stack bump these dependencies at the same time, so I have also provided a PR for Finatra. bijection is already on json4s 4.0.3. scrooge and finagle do not depends on json4s.

sbt test succeeds with json4s 4.0.3 and no other code changes.

I took the liberty of creating a val json4sVersion instead of having the version number separately in util-jackson and util-validator... this should help to keep them in sync in the future.

**Result**
Closes twitter/util#297
Closes #572

Signed-off-by: Joy Bestourous <jbestourous@twitter.com>

Differential Revision: https://phabricator.twitter.biz/D803847
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants