-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Hibernate Reactive: don't make transaction-related beans as unremovable and fail on unconfigured datasource #39005
Hibernate Reactive: don't make transaction-related beans as unremovable and fail on unconfigured datasource #39005
Conversation
CC @FroMage |
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.
Thanks, but the diff would have been much easier to read if you didn't move the method around xD I don't know why we even have a dedicated processor class for CDI stuff anyway, we don't do that for anything else.
So for others wondering, the key is the addition of capabilities.isMissing(Capability.HIBERNATE_REACTIVE))
. I suppose you noticed a problem somewhere and discussed that on Zulip... ?
The other change about failing the build makes sense too since we don't support using Hibernate ORM + reactive in the same app (yet), but I wonder how you even got to that point 🤔
Regardless... +1 from me but I think there's a mistake, see below.
...m/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmCdiProcessor.java
Outdated
Show resolved
Hide resolved
Well, I moved the build step because it seems to be the only one related to CDI but placed in the
Not a problem. I just noticed in the Dev UI of the HR panache quickstart that we register those beans for no reason...
Stef had a project with no PU configured... https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/hibernate.20reactive/near/423364478
|
e4628ff
to
5e42f55
Compare
Wait, you mean with no entity? That's actually allowed, and we have a test to check it remains that way: Is it wise? Not if you ask me. Do we have a general expectations for extensions to not break an application if they are added to the build but are pointless? Yes we do... I'd mention @gsmet but I think I can probably sum up his answer with "it's been decided that way for good reasons, and if we want to change it we need a team discussion". So... I think I'd revert that part of your changes for now. |
@FroMage's use case was a bit different - he had an entity, but forgot to add datasource or something like that... basically empty
Hm, I do understand but I'm not so sure it's the same type of problem. Maybe we should only fail the build if some entities are present? |
5e42f55
to
f3ff2c7
Compare
You mean if there are entities, but no datasource? Yes we do fail in that case with the Hibernate ORM extension, so we should for Reactive too. I think we'll want to make this code in the HR extension closer to the Hibernate ORM extension: Lines 162 to 196 in 8abb590
Here's the (better) reference in the Hibernate ORM extension: Lines 1128 to 1204 in 3b35908
Not sure it'll be easy though; it might require some hacking. With the Hibernate ORM extension we have access to the full list of datasources configured in Agroal, but I'm not sure the Hibernate Reactive extension has access to similar information for reactive clients, which are a bit more heterogeneous. |
This comment has been minimized.
This comment has been minimized.
@yrodiere This test is weird: |
@mkouba Yes that's just a non-regression test, added to check the behavior doesn't change when I worked on an unrelated feature. |
f3ff2c7
to
cd30e19
Compare
@yrodiere the |
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.
Well, I've added questions, but perhaps that's just because I don't understand how DEV services affect configuration and I'm misguided. I do share @yrodiere 's remarks, though, so if he says we're good, I'll follow :)
...yment/src/main/java/io/quarkus/hibernate/reactive/deployment/HibernateReactiveProcessor.java
Show resolved
Hide resolved
...yment/src/main/java/io/quarkus/hibernate/reactive/deployment/HibernateReactiveProcessor.java
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
I've aligned the |
cd30e19
to
532fd26
Compare
532fd26
to
50073a7
Compare
This comment has been minimized.
This comment has been minimized.
- fail the build if the default datasource is not configured and Dev Services are disabled - fail the build unless exactly one persistent unit is configured
50073a7
to
70a11af
Compare
Hm, according to the |
Status for workflow
|
Status | Name | Step | Failures | Logs | Raw logs | Build scan |
---|---|---|---|---|---|---|
✖ | Native Tests - Data5 | Build |
Failures | Logs | Raw logs | 🚧 |
Full information is available in the Build summary check run.
Failures
⚙️ Native Tests - Data5 #
- Failing: integration-tests/jpa-postgresql-withxml
📦 integration-tests/jpa-postgresql-withxml
✖ io.quarkus.it.jpa.postgresql.ImageMetricsITCase.verifyImageMetrics
line 15
- History - More details - Source on GitHub
org.opentest4j.AssertionFailedError: Expected analysis_results.fields.reflection to be within range [163 +- 3%] but was 168 ==> expected: <true> but was: <false>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:214)
at io.quarkus.test.junit.nativeimage.NativeBuildOutputExtension.assertValueWithinRange(NativeBuildOutputExtension.java:90)
at io.quarkus.test.junit.nativeimage.NativeBuildOutputExtension.lambda$verifyImageMetrics$0(NativeBuildOutputExtension.java:66)
Flaky tests - Develocity
⚙️ JVM Tests - JDK 21
📦 extensions/smallrye-reactive-messaging-kafka/deployment
✖ io.quarkus.smallrye.reactivemessaging.kafka.deployment.dev.KafkaDevServicesDevModeTestCase.sseStream
- History
Assertion condition Expecting size of: [] to be greater than or equal to 2 but was 0 within 10 seconds.
-org.awaitility.core.ConditionTimeoutException
org.awaitility.core.ConditionTimeoutException:
Assertion condition
Expecting size of:
[]
to be greater than or equal to 2 but was 0 within 10 seconds.
at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)
⚙️ Native Tests - Misc4
📦 integration-tests/gradle
✖ io.quarkus.gradle.nativeimage.BasicJavaNativeBuildIT.shouldBuildNativeImageWithCustomName
- History
Gradle build failed with exit code 137
-java.lang.AssertionError
java.lang.AssertionError: Gradle build failed with exit code 137
at io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:140)
at io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:57)
at io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:52)
at io.quarkus.gradle.nativeimage.QuarkusNativeGradleITBase.runGradleWrapper(QuarkusNativeGradleITBase.java:36)
at io.quarkus.gradle.nativeimage.BasicJavaNativeBuildIT.shouldBuildNativeImageWithCustomName(BasicJavaNativeBuildIT.java:51)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
...te/reactive/config/datasource/EntitiesInDefaultPUWithExplicitUnconfiguredDatasourceTest.java
Show resolved
Hide resolved
...yment/src/main/java/io/quarkus/hibernate/reactive/deployment/HibernateReactiveProcessor.java
Show resolved
Hide resolved
...yment/src/main/java/io/quarkus/hibernate/reactive/deployment/HibernateReactiveProcessor.java
Show resolved
Hide resolved
...yment/src/main/java/io/quarkus/hibernate/reactive/deployment/HibernateReactiveProcessor.java
Show resolved
Hide resolved
...te/reactive/config/datasource/EntitiesInDefaultPUWithExplicitUnconfiguredDatasourceTest.java
Show resolved
Hide resolved
Merging, thanks. Will refine the solution in #39049. |
No description provided.