-
Notifications
You must be signed in to change notification settings - Fork 327
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
Replace play-json with nanojson, leave play-json tests for now. #892
Replace play-json with nanojson, leave play-json tests for now. #892
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call on first changing only the code
It would be nice to refactor the tests too, but I'll let it slide if you insist on being lazy :D
Should we shade the nanojson dep, like kamon-status-page does?
I think we should, but I just published this locally, and I don't see nanojson included in the jar ¯\(ツ)/¯
All in all, great PR, thanks for the contrib! 🎉
reporters/kamon-datadog/src/main/scala/kamon/datadog/DatadogSpanReporter.scala
Show resolved
Hide resolved
LGTM, I'll merge tomorrow when the tests finish running, and someone else checks out the sbt changes |
Laziness aside, the two JSON libs have different requirements for the different contexts. In the actual code, we want something fast, reliable, small, and non-conflicting. In the tests, we really only care about correctness and ease of use - a difficult-to-use JSON lib will discourage test-writing or make the tests difficult to understand. So, I think there's an actual case for leaving |
Awesome, thanks for the quick turnaround and feedback on this! |
Well when you put it that way, I agree that it's better to leave tests as is! |
When I published |
Ok, we're almost there, please just remove the shading part, it's not necessary, and we can merge 🎉 |
👍 done! |
Done! Oh, and for the future, you don't have to push an empty commit to rerun tests, the reviewer can (and should) do that for you |
This is a follow-up from #888. The PR removes the dependency on
play-json
and instead writes JSON using https://github.com/mmastrac/nanojson, which is already required by thekamon-status-page
module.Since
play-json
is widely used in the Scala community, there's potential for dependency conflicts when a user pulls in bothkamon-datadog
and their ownplay-json
. This PR avoids that situation.A few questions for the maintainers:
nanojson
dep, likekamon-status-page
does?play-json
. Should we put in the work to port them tonanojson
? I haven't yet for a few reasons:play-json
has some niceties when working in Scala thatnanojson
does not, so replacing it there would be a bit annoying (and I'm lazy :-D )play-json
can be moved to a test dep so conflicts will no longer be an issue