-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Use FileSystemStaticHandler for all webjars #23030
Conversation
4c90d8d
to
ae78856
Compare
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building ae78856
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 11 #- Failing: extensions/smallrye-reactive-messaging-kafka/deployment
! Skipped: integration-tests/kafka-oauth-keycloak integration-tests/kafka-sasl-elytron integration-tests/kubernetes/quarkus-standard-way-kafka and 2 more 📦 extensions/smallrye-reactive-messaging-kafka/deployment✖
|
ae78856
to
ed0e5f5
Compare
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.
Looks good to me and a nice cleanup.
I just added a small open question.
@@ -136,6 +136,7 @@ public void getSwaggerUiFinalDestination( | |||
byte[] indexHtmlContent = generateIndexHtml(openApiPath, swaggerUiPath, swaggerUiConfig, indexRootPathBuildItem); | |||
webJarBuildProducer.produce( | |||
WebJarBuildItem.builder().artifactKey(SWAGGER_UI_WEBJAR_ARTIFACT_KEY) // | |||
.onlyCopyNonArtifactFiles(true) |
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.
Why this change? Shouldn't it be the default if we generalize it?
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.
BTW, it's an open question, you're the one with the most knowledge of this stuff so I'm curious to hear your opinion.
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.
Setting onlyCopyNonArtifactFiles
to default as true
, could break quarkiverse members that have already updated to the new webjar infrastructure with 2.7.0.CR1.
I (personally) don't believe a .Final should intentionally break extensions.
WDYT?
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, if making it the default makes sense, I prefer we do it now rather than after because it will be far more of a pain to change it later.
Now, I don't know if it makes sense to make it the default - I will let you decide what makes more sense on this - but, if it does, let's do it now.
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.
Yep, defaulting to true makes sense, and is easy enough to change if one needs to.
Done.
ed0e5f5
to
e24dd1c
Compare
I fixed the vert.x 4.2.4 deprecations in WebJarStaticHandler, and disallowed rootfilesystemaccess. /cc @cescoffier |
e24dd1c
to
d6da278
Compare
d6da278
to
4bbaa52
Compare
Failing Jobs - Building 4bbaa52
Full information is available in the Build summary check run. Failures⚙️ Gradle Tests - JDK 11 Windows #- Failing: integration-tests/gradle
📦 integration-tests/gradle✖
|
Test failures in CustomQuarkusDevModeConfigurationTest do not look related |
I'm testing this locally and will merge if things are OK. |
Thanks @Postremus , very nice work! |
return new SmallRyeGraphQLStaticHandler(graphqlUiFinalDestination, graphqlUiPath); | ||
WebJarStaticHandler handler = new WebJarStaticHandler(graphqlUiFinalDestination, graphqlUiPath, | ||
webRootConfigurations); | ||
shutdownContext.addShutdownTask(new ShutdownContext.CloseRunnable(handler)); |
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.
@mkouba @cescoffier I was going back to this patch and was wondering why we needed to do that? Shouldn't the handler be closed by Vert.x itself?
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.
This is the handler in question which should be closed.
At first, I also hopped that a instance of Closeable is automaticly closed.
I set a breakpoint in the close method. Never got invoked though.
This is why I decided to add the shutdownhandlers.
Is there any better / automatic way with Vert.x?
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.
Ah OK, I missed you specifically implemented Closeable
. Maybe @mkouba will have some ideas about how we could improve it and close Closeable
handlers automatically.
If not, that's not a biggy.
I was going through this patch again to move Quarkus GitHub App to this new pattern.
The changes in this PR prevent copying all static resources needed for webjars (smallrye-health, swaggerui, graphql), and serves them directly from the jar instead.
I also replaced the extension specific handlers (e.g. SwaggerUiNotFoundHandler, SwaggerUiStaticHandler) with general purpose implementation (WebJarNotFoundHandler, WebJarStaticHandler) in vertx-http.
Same idea as in #22525.
This saves about 30ms of dev mode startup time.
Relates to #21552