Skip to content

Conversation

holly-cummins
Copy link
Contributor

@holly-cummins holly-cummins commented Jul 21, 2025

Historically, the dev services extension has a deployment module, but no runtime one. Adding a runtime module is non-trivial, because as soon as the runtime module exists, the quarkus extension maven plugin will insist that every extension which uses the deployment module has a dependency on the runtime module. Why not just do the one-time change and add the runtime dependency to the poms? That would work for quarkus core repo, but not for the ecosystem. A breaking change like that would be inconvenient for extension authors, but annoying for users, since extensions would only work with 3.26 or 3.25, and not both.

Instead, we decided to special-case this module and tolerate missing dependencies. The new module isn't needed for old-style dev services, only new ones. So the goal is that if dev services on the new model are missing the dependency, they should fail with a clear message and early. Ideally, they'd fail at build time, but if not, quickly. Dev services not using the new model should continue to work.

It's not visible in CI, because I fixed it (obviously), but I've confirmed that if I don't have the runtime dependency on a new-style devservice, I get this failure:

[ERROR] TestEngine with ID 'junit-jupiter' encountered a critical issue during test discovery:
[ERROR] 
[ERROR] (1) [ERROR] ClassSelector [className = 'io.quarkus.redis.devservices.it.DevServicesRedisNonUniquePortTest', classLoader = null] resolution failed
[ERROR]     Source: ClassSource [className = 'io.quarkus.redis.devservices.it.DevServicesRedisNonUniquePortTest', filePosition = null]
[ERROR]             at io.quarkus.redis.devservices.it.DevServicesRedisNonUniquePortTest.<no-method>(SourceFile:0)
[ERROR]     Cause: org.junit.platform.commons.PreconditionViolationException: Could not load class with name: io.quarkus.redis.devservices.it.DevServicesRedisNonUniquePortTest
[ERROR]         at org.junit.platform.engine.discovery.ClassSelector.lambda$getJavaClass$0(ClassSelector.java:98)
...
[ERROR] Caused by: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.redis.deployment.client.DevServicesRedisProcessor#startRedisContainers threw an exception: java.lang.RuntimeException: java.lang.IllegalStateException: Extension error. Please add the io.quarkus:quarkus-devservices runtime dependency to the extension's runtime module.
[ERROR]         at io.quarkus.redis.deployment.client.DevServicesRedisProcessor.startRedisContainers(DevServicesRedisProcessor.java:106)
[ERROR]         at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:873)

I moved some runtime classes over, but not all. I couldn’t move the crossclassloader classes over because the StartupImpl needs the registry build item, and the build item needs all the crossclassloader classes. We could switch to reflective access and some interfaces to allow them to move over if we think it’s worth it. That can be a follow-on PR, though, if we do want to do it. It reduces the runtime module size (yay), but adds reflection on the dev service path (boo).

I didn’t do a runtime-dev module because dev services are used by integration and native tests, so I think it needs to be a full runtime module (annoyingly).

So we don't lose track of it, I've raised #49026 as follow-on PR to undo the exemption for Quarkus 4.

@holly-cummins holly-cummins marked this pull request as draft July 21, 2025 17:10
@quarkus-bot quarkus-bot bot added area/amazon-lambda area/core area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/documentation area/kafka area/redis labels Jul 21, 2025
Copy link

github-actions bot commented Jul 21, 2025

🎊 PR Preview d035ae3 has been successfully built and deployed to https://quarkus-pr-main-49025-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

@holly-cummins holly-cummins force-pushed the devservices-runtime-module branch from cdb421d to 9e7cd87 Compare July 21, 2025 19:00
@holly-cummins holly-cummins marked this pull request as ready for review July 21, 2025 19:31
@holly-cummins holly-cummins force-pushed the devservices-runtime-module branch 2 times, most recently from ac55bd6 to dd18e29 Compare July 21, 2025 19:52

This comment has been minimized.

@holly-cummins holly-cummins force-pushed the devservices-runtime-module branch from dd18e29 to 2fcd309 Compare July 21, 2025 21:18
Copy link

quarkus-bot bot commented Jul 21, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 2fcd309.

✅ 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.

Warning

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

Copy link

quarkus-bot bot commented Jul 22, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 2fcd309.

✅ 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 21

📦 extensions/smallrye-reactive-messaging/deployment

io.quarkus.smallrye.reactivemessaging.hotreload.ConnectorChangeTest.testUpdatingConnector - History

  • Expecting actual: ["-6","-7","-9","-10","-11","-12","-13","-14"] to start with: ["-6", "-7", "-8", "-9"] - java.lang.AssertionError
java.lang.AssertionError: 

Expecting actual:
  ["-6","-7","-9","-10","-11","-12","-13","-14"]
to start with:
  ["-6", "-7", "-8", "-9"]

	at io.quarkus.smallrye.reactivemessaging.hotreload.ConnectorChangeTest.testUpdatingConnector(ConnectorChangeTest.java:41)

⚙️ JVM Integration Tests - JDK 17

📦 integration-tests/opentelemetry-grpc-only

io.quarkus.it.opentelemetry.grpc.HelloGrpcClientTest.testHello - History

  • java.lang.RuntimeException: Failed to start quarkus - java.lang.RuntimeException
java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:668)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:763)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)

Copy link
Member

@aloubyansky aloubyansky left a comment

Choose a reason for hiding this comment

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

I didn’t do a runtime-dev module because dev services are used by integration and native tests, so I think it needs to be a full runtime module (annoyingly).

Aren't integration (and native) tests are supposed to be LaunchMode.RUN now?

@holly-cummins
Copy link
Contributor Author

I didn’t do a runtime-dev module because dev services are used by integration and native tests, so I think it needs to be a full runtime module (annoyingly).

Aren't integration (and native) tests are supposed to be LaunchMode.RUN now?

Oh, possibly! I haven't been following closely. Although I think that makes a runtime-dev less likely to work in that scenario, doesn't it?

@aloubyansky
Copy link
Member

LaunchMode.RUN would need to be added as another condition for the relevant dependencies to be activated.

@holly-cummins
Copy link
Contributor Author

LaunchMode.RUN would need to be added as another condition for the relevant dependencies to be activated.

Ohh, I see! That might be worth doing, but it would be a big change, potentially (and possibly one for discussion in #48688). I guess it's sort of allowed by https://github.com/quarkusio/quarkus/pull/48688/files#diff-7b080592c913461229fbbb3fa790210bc36e76d33de9ae965bff9061667fb90eR195, but it might be worth being explicit.

@aloubyansky
Copy link
Member

Yeah, it's not an immediately available alternative at the moment.

@holly-cummins holly-cummins merged commit d1cd98c into quarkusio:main Aug 26, 2025
59 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.28 - main milestone Aug 26, 2025
@holly-cummins
Copy link
Contributor Author

I realised too late that this will mess up quarkiverse extensions; they'll work with 3.27 (if they don't declare a dependency on the runtime module), or 3.28 (if they do), but not both. @aloubyansky, would it would for extensions to mark the dependency optional or would that have all sorts of unforeseen consequences?

@aloubyansky
Copy link
Member

AFAIU, extensions not declaring a dependency on the runtime module will still work in all versions. It's just those that do declare a dependency on the runtime module won't work in versions where this refactoring was not applied?
Have you actually tried it?

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

Labels

area/amazon-lambda area/core area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/documentation area/kafka area/redis triage/flaky-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a quarkus-devservices runtime module

2 participants