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

New Route SPI not requiring Vert.x HTTP #38143

Merged
merged 1 commit into from Jan 13, 2024
Merged

Conversation

cescoffier
Copy link
Member

@cescoffier cescoffier commented Jan 11, 2024

Unlike the current one, this SPI allows declaring routes without having
to depend on Quarkus Vert.x HTTP. Thus, if an extension declares a route
with this SPI if Quarkus Vert.x HTTP is not present, then the route is ignored.
However, if Quarkus Vert.x HTTP is present, then the route is registered.

I changed the info and openapi extensions to verify that the new SPI is correctly handled.

\CC @yrodiere

Fix #37144.

@yrodiere
Copy link
Member

Thanks @cescoffier!

@marko-bekhta could you try rebasing your PR on this one and see if you can sort out the dependencies now? I mean your PR that adds a management interface to Hibernate Search.

@marko-bekhta
Copy link
Contributor

@yrodiere done 😃 I've tried these changes locally and it seems to be working OK, so I've also pushed it to see if the CI will also be happy #35065
@cescoffier thanks! 😃

Unlike the current one, this SPI allows declaring routes without having
to depend on Quarkus Vert.x HTTP. Thus, if an extension declares a route
with this SPI, and Quarkus Vert.x HTTP is not present, the route is ignored.
However, if Quarkus Vert.x HTTP is present, the route is registered.
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 12, 2024

Failing Jobs - Building 50c898b

Status Name Step Failures Logs Raw logs Build scan
✔️ JVM Tests - JDK 17 🔍
JVM Tests - JDK 21 Build Failures Logs Raw logs 🔍

Full information is available in the Build summary check run.
You can consult the Develocity build scans.

Failures

⚙️ JVM Tests - JDK 21 #

- Failing: extensions/scheduler/deployment 
! Skipped: extensions/quartz/deployment extensions/spring-scheduled/deployment integration-tests/main and 7 more

📦 extensions/scheduler/deployment

io.quarkus.scheduler.test.PausedSchedulerTest.testSchedulerPauseResume line 47 - More details - Source on GitHub

org.opentest4j.AssertionFailedError: expected: <false> but was: <true>
	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.AssertFalse.failNotFalse(AssertFalse.java:63)
	at org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:36)
	at org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:31)
	at org.junit.jupiter.api.Assertions.assertFalse(Assertions.java:231)
	at io.quarkus.scheduler.test.PausedSchedulerTest.testSchedulerPauseResume(PausedSchedulerTest.java:47)

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 added a question that I want us to sort out before merging.

It might just be me being overcautious :).

Comment on lines +21 to +25

<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
</dependency>
Copy link
Member

Choose a reason for hiding this comment

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

Do we really want to add this dependency? The idea would be to not depend on anything Vert.x right?

Copy link
Member

Choose a reason for hiding this comment

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

I don't know if it's necessary, but as far as I'm concerned, it's fine. A mandatory dependency in the deployment artifact is acceptable as long as it can be optional at runtime (and from what I see in Marko 's PR, it can be).

Copy link
Member

Choose a reason for hiding this comment

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

(to clarify, the initial goal was to make the dependency optional at runtime, though Clément may have gone a bit further here)

@gsmet gsmet merged commit e75a8c6 into quarkusio:main Jan 13, 2024
64 of 65 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Jan 13, 2024
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Jan 13, 2024
@cescoffier cescoffier deleted the route-spi branch January 15, 2024 12:47
ABSOLUTE_ROUTE
}

private RouteType typeOfRoute = RouteType.APPLICATION_ROUTE;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, I believe that build items should be immutable. In theory, the build item producer can (even mistakenly) modify the build item through the builder after it's produced and that may lead to unexpected errors.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right. I did that for simplicity, but I should use the builder to keep everything and build an immutable route build item.

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

Successfully merging this pull request may close these issues.

Allow integration with quarkus-vertx-http without a "hard" dependency
5 participants