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 Play to 2.8.2 (bp #2887) #2934

Merged
merged 2 commits into from
Jul 8, 2020

Conversation

ihostage
Copy link
Contributor

@ihostage ihostage commented Jul 7, 2020

No description provided.

@@ -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"
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

@ihostage ihostage Jul 8, 2020

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 😂

Copy link
Contributor

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 😞

@ihostage ihostage requested a review from octonato July 8, 2020 15:54
Comment on lines +347 to +348
// We should eagerly init SlickProvider before test a JDBC persistence
if (setup.jdbc) Try(lagomApplication.asInstanceOf[SlickProviderComponents]).map(_.slickProvider)
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor

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.

@octonato octonato merged commit 55e4b3f into lagom:1.6.x Jul 8, 2020
@ihostage ihostage deleted the update_play_2_8_2_to_1_6_X branch July 8, 2020 16:31
@ennru ennru mentioned this pull request Jul 10, 2020
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.

Bump play to 2.8.2
4 participants