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

Add shared support for MongoDB Dev Services container #39787

Merged

Conversation

patrox
Copy link
Contributor

@patrox patrox commented Mar 29, 2024

No description provided.

This comment has been minimized.

This comment has been minimized.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. It looks very nice.

I added a few minor gripes inline as to preferring MongoDB/mongodb over mongo. I'm not sure it makes sense in all circumstances so feel free to push back if it doesn't.

Could you also squash all your commits when done?

Thanks!

*/
private static final String DEV_SERVICE_LABEL = "quarkus-dev-service-mongo";

private static final ContainerLocator mongoContainerLocator = new ContainerLocator(DEV_SERVICE_LABEL, MONGO_EXPOSED_PORT);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constant should probably be named like a constant.

@@ -45,4 +45,30 @@ public class DevServicesBuildTimeConfig {
@ConfigItem
public Map<String, String> containerEnv;

/**
* Indicates if the Mongo server managed by Quarkus Dev Services is shared.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make sure you use MongoDB instead of Mongo in the javadoc of the configuration properties? They are published on the website.
(Note that other properties might not comply but let's not add more :))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will fix it. Naming is so hard ;)


If you need multiple (shared) servers, you can configure the `quarkus.mongo.devservices.service-name` attribute and indicate the server name.
It looks for a container with the same value, or starts a new one if none can be found.
The default service name is `mongo`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we could make it mongodb or it is a convention and we should keep it that way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be changed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrox are you sure you pushed your changes? I don't see my comments addressed and also you said you squashed everything and the commits are not.

Thanks for your feedback!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrox are you sure you pushed your changes? I don't see my comments addressed and also you said you squashed everything and the commits are not.

Thanks for your feedback!

Yeah sorry, it looks like I messed things up during rebase. Now it should be fine :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsmet Now all requested changes should be in place, the commits were squashed and the branch is up-to-date with the current main, so it looks ready!

docs/src/main/asciidoc/mongodb-dev-services.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/mongodb-dev-services.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/mongodb-dev-services.adoc Outdated Show resolved Hide resolved
@patrox patrox force-pushed the add_shared_mongo_dev_services_container branch 2 times, most recently from 9f7f050 to dc6c454 Compare April 4, 2024 15:48

This comment has been minimized.

This comment has been minimized.

@patrox patrox force-pushed the add_shared_mongo_dev_services_container branch from dc6c454 to b4a7148 Compare April 4, 2024 18:21

This comment has been minimized.

This comment has been minimized.

@patrox patrox force-pushed the add_shared_mongo_dev_services_container branch from dbc053e to 4ec256d Compare April 4, 2024 18:57

This comment has been minimized.

This comment has been minimized.

@patrox
Copy link
Contributor Author

patrox commented Apr 4, 2024

Thanks for this PR. It looks very nice.

I added a few minor gripes inline as to preferring MongoDB/mongodb over mongo. I'm not sure it makes sense in all circumstances so feel free to push back if it doesn't.

Could you also squash all your commits when done?

Thanks!

@gsmet I've addressed all your suggestions/comments and squashed all commits after rebasing to the current main.

@patrox patrox force-pushed the add_shared_mongo_dev_services_container branch from 4ec256d to 996c099 Compare April 18, 2024 08:47
@patrox patrox requested a review from gsmet April 18, 2024 09:11

This comment has been minimized.

Copy link

github-actions bot commented Apr 18, 2024

🙈 The PR is closed and the preview is expired.

This comment has been minimized.

@patrox patrox force-pushed the add_shared_mongo_dev_services_container branch from bdd3edd to 96f4627 Compare April 22, 2024 12:56

This comment has been minimized.

This comment has been minimized.

@patrox patrox force-pushed the add_shared_mongo_dev_services_container branch 3 times, most recently from 96f4627 to 58778e6 Compare April 25, 2024 09:43

This comment has been minimized.

This comment has been minimized.

@patrox patrox force-pushed the add_shared_mongo_dev_services_container branch from 58778e6 to 5f06435 Compare June 6, 2024 12:22

This comment has been minimized.

This comment has been minimized.

@gsmet gsmet force-pushed the add_shared_mongo_dev_services_container branch from 5f06435 to 164e21b Compare June 6, 2024 17:18
@quarkus-bot quarkus-bot bot added the area/core label Jun 6, 2024
Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I amended your commit to fix DEV_SERVICE_LABEL that was still the mongo version.

LGTM, let's merge when CI is green.

Sorry it took so much time for me to get back to it :).

@gsmet gsmet added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jun 6, 2024
Copy link

quarkus-bot bot commented Jun 6, 2024

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 164e21b.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

⚠️ There are other workflow runs running, you probably need to wait for their status before merging.

@patrox
Copy link
Contributor Author

patrox commented Jun 6, 2024

I amended your commit to fix DEV_SERVICE_LABEL that was still the mongo version.

LGTM, let's merge when CI is green.

Sorry it took so much time for me to get back to it :).

Thank you @gsmet, will wait for the CI to become 🟢

Copy link

quarkus-bot bot commented Jun 7, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 164e21b.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17

📦 extensions/micrometer/deployment

io.quarkus.micrometer.deployment.binder.VertxTcpMetricsTest.testTcpMetrics - History

  • event executor terminated - java.util.concurrent.RejectedExecutionException
java.util.concurrent.RejectedExecutionException: event executor terminated
	at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:934)
	at io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:351)
	at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:344)
	at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:836)
	at io.netty.util.concurrent.SingleThreadEventExecutor.execute0(SingleThreadEventExecutor.java:827)
	at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:817)
	at io.vertx.core.impl.EventLoopExecutor.execute(EventLoopExecutor.java:35)

📦 extensions/smallrye-reactive-messaging-kafka/deployment

io.quarkus.smallrye.reactivemessaging.kafka.deployment.dev.KafkaDevServicesDevModeTestCase.sseStream - History

  • Assertion condition defined as a Lambda expression in io.quarkus.smallrye.reactivemessaging.kafka.deployment.dev.KafkaDevServicesDevModeTestCase 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 defined as a Lambda expression in io.quarkus.smallrye.reactivemessaging.kafka.deployment.dev.KafkaDevServicesDevModeTestCase 
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)

⚙️ JVM Tests - JDK 21

📦 integration-tests/reactive-messaging-kafka

io.quarkus.it.kafka.KafkaConnectorTest.testFruits - History

  • Assertion condition defined as a Lambda expression in io.quarkus.it.kafka.KafkaConnectorTest expected: <6> but was: <5> within 10 seconds. - org.awaitility.core.ConditionTimeoutException
org.awaitility.core.ConditionTimeoutException: Assertion condition defined as a Lambda expression in io.quarkus.it.kafka.KafkaConnectorTest expected: <6> but was: <5> 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)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1006)
	at org.awaitility.core.ConditionFactory.untilAsserted(ConditionFactory.java:790)
	at io.quarkus.it.kafka.KafkaConnectorTest.testFruits(KafkaConnectorTest.java:63)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)

⚙️ Maven Tests - JDK 17

📦 integration-tests/maven

io.quarkus.maven.it.RemoteDevMojoIT.testThatTheApplicationIsReloadedOnConfigChange - History

  • org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in io.quarkus.maven.it.RunAndCheckWithAgentMojoTestBase was not fulfilled within 1 minutes. - java.lang.RuntimeException
java.lang.RuntimeException: org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in io.quarkus.maven.it.RunAndCheckWithAgentMojoTestBase was not fulfilled within 1 minutes.
	at io.quarkus.maven.it.RunAndCheckWithAgentMojoTestBase.runAndCheck(RunAndCheckWithAgentMojoTestBase.java:86)
	at io.quarkus.maven.it.RemoteDevMojoIT.testThatTheApplicationIsReloadedOnConfigChange(RemoteDevMojoIT.java:100)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in io.quarkus.maven.it.RunAndCheckWithAgentMojoTestBase was not fulfilled within 1 minutes.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)

io.quarkus.maven.it.RemoteDevMojoIT.testThatTheApplicationIsReloadedOnConfigChange - History

  • org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in io.quarkus.maven.it.RunAndCheckWithAgentMojoTestBase was not fulfilled within 1 minutes. - java.lang.RuntimeException
java.lang.RuntimeException: org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in io.quarkus.maven.it.RunAndCheckWithAgentMojoTestBase was not fulfilled within 1 minutes.
	at io.quarkus.maven.it.RunAndCheckWithAgentMojoTestBase.runAndCheck(RunAndCheckWithAgentMojoTestBase.java:86)
	at io.quarkus.maven.it.RemoteDevMojoIT.testThatTheApplicationIsReloadedOnConfigChange(RemoteDevMojoIT.java:100)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in io.quarkus.maven.it.RunAndCheckWithAgentMojoTestBase was not fulfilled within 1 minutes.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)

@gsmet gsmet merged commit 85afbe7 into quarkusio:main Jun 7, 2024
55 checks passed
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jun 7, 2024
@quarkus-bot quarkus-bot bot added this to the 3.12 - main milestone Jun 7, 2024
@gsmet gsmet changed the title Add shared mongo dev services container Add shared support for MongoDB Dev Services container Jun 7, 2024
@gsmet
Copy link
Member

gsmet commented Jun 7, 2024

@patrox thanks for your contribution, it's going to be part of 3.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

2 participants