-
Notifications
You must be signed in to change notification settings - Fork 634
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 Play to 2.8.2 (bp #2887) #2934
Conversation
4b6baa1
to
f9c1674
Compare
@@ -552,7 +552,7 @@ lazy val `testkit-scaladsl` = (project in file("testkit/scaladsl")) | |||
`persistence-core` % "compile;test->test", | |||
`persistence-scaladsl` % "compile;test->test", | |||
`persistence-cassandra-scaladsl` % "compile->test;test->test", | |||
`persistence-jdbc-scaladsl` % Test | |||
`persistence-jdbc-scaladsl` % "compile;test->test" |
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.
I just realised that this looks wrong: If I am a Cassandra user I shouldn't get persistence-jdbc-scaladsl
as a transitive dependency.
Maybe it should be provided
? But then there'd be a runtime error for cassandra users invoking ServiceTest
since import com.lightbend.lagom.scaladsl.persistence.jdbc.SlickProviderComponents
will raise a ClassNotFound
.
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.
We discussed this approach offline and it sounded OK to me. But I'm not sure.
I guess it's the least bad of the options.
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.
Yes. I saw only 3 variants:
1)
Eagerly initialize slickProvider
in com.lightbend.lagom.scaladsl.persistence.jdbc.SlickProviderComponents
=> lazy property with unlazy behavior 😞
Was discussed in #2887
2)
Add eager initialization in com.lightbend.lagom.scaladsl.testkit.ServiceTest#startServer
=> testkit-scaladsl
depends on persistence-jdbc-scaladsl
for compile scope 😞
(But…. testkit
using only for tests and this artifact will not have in production classpath. And maybe it’s not a big problem for users if for tests will be loaded not used transitive dependency.)
3)
Try to implement a second approach by reflection
=> forget about beautiful source code 😂
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.
I think I'm beginning to lean towards Eagerly initialize slickProvider in com.lightbend.lagom.scaladsl.persistence.jdbc.SlickProviderComponents => lazy property with unlazy behavior 😞
// We should eagerly init SlickProvider before test a JDBC persistence | ||
if (setup.jdbc) Try(lagomApplication.asInstanceOf[SlickProviderComponents]).map(_.slickProvider) |
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.
what is the relation of this change with upgrading to Play v2.8.2?
Could we make it in another PR so we can track things better?
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.
Hmm, I see that this is a backport and it was on the original PR.
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.
Even if this is a backport, I had second thoughts (#2934 (comment)) wrt the impact this change has.
Now that's merged the question is: are we comfortable with the jdbc transitive dependency even for cassandra users? If not, we should roll this back and implement a different strategy. If yes, then we can move on to a 1.6.3 release.
No description provided.