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

Bump Micronaut to 4.3.0 and fix internal breakage #626

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
micronaut = "4.2.3"
micronaut = "4.3.0"
micronaut-docs = "2.0.0"
micronaut-test = "4.0.1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ public void service(ServletExchange<REQ, RES> exchange) {
final HttpRequest<Object> req = exchange.getRequest();
applicationContext.publishEvent(new HttpRequestReceivedEvent(req));

ServletRequestLifecycle lc = new ServletRequestLifecycle(routeExecutor, req);
ServletRequestLifecycle lc = new ServletRequestLifecycle(routeExecutor);

if (exchange.getRequest().isAsyncSupported()) {
exchange.getRequest().executeAsync(asyncExecution -> {
try (PropagatedContext.Scope ignore = PropagatedContext.getOrEmpty().plus(new ServerHttpRequestContext(req)).propagate()) {
lc.handleNormal()
.onComplete((response, throwable) -> onComplete(exchange, req, response, throwable, httpResponse -> {
lc.handleNormal(req)
.onComplete((response, throwable) -> onComplete(exchange, req, response.toMutableResponse(), throwable, httpResponse -> {
asyncExecution.complete();
requestTerminated.accept(httpResponse);
}));
Expand All @@ -219,10 +219,10 @@ public void service(ServletExchange<REQ, RES> exchange) {
} else {
try (PropagatedContext.Scope ignore = PropagatedContext.getOrEmpty().plus(new ServerHttpRequestContext(req)).propagate()) {
CompletableFuture<?> termination = new CompletableFuture<>();
lc.handleNormal()
lc.handleNormal(req)
.onComplete((response, throwable) -> {
try {
onComplete(exchange, req, response, throwable, requestTerminated);
onComplete(exchange, req, response.toMutableResponse(), throwable, requestTerminated);
} finally {
termination.complete(null);
}
Expand Down Expand Up @@ -501,17 +501,17 @@ private String getDefaultMediaType(Object result) {
}

private final class ServletRequestLifecycle extends RequestLifecycle {
ServletRequestLifecycle(RouteExecutor routeExecutor, HttpRequest<?> request) {
super(routeExecutor, request);
ServletRequestLifecycle(RouteExecutor routeExecutor) {
super(routeExecutor);
}

ExecutionFlow<MutableHttpResponse<?>> handleNormal() {
return normalFlow();
ExecutionFlow<HttpResponse<?>> handleNormal(HttpRequest<?> request) {
return normalFlow(request);
}

@Override
protected FileCustomizableResponseType findFile() {
return matchFile(request().getPath()).orElse(null);
protected FileCustomizableResponseType findFile(HttpRequest<?> request) {
return matchFile(request.getPath()).orElse(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"io.micronaut.http.server.tck.tests.filter.ClientResponseFilterTest", // responseFilterThrowableParameter fails under Graal https://ge.micronaut.io/s/ufuhtbe5sgmxi
"io.micronaut.http.server.tck.tests.FilterProxyTest", // see https://github.com/micronaut-projects/micronaut-core/issues/9725
"io.micronaut.http.server.tck.tests.LocalErrorReadingBodyTest", // Cannot read body as text once stream is exhausted trying to read it as a different type See https://github.com/micronaut-projects/micronaut-servlet/pull/548
"io.micronaut.http.server.tck.tests.filter.options.OptionsFilterTest" // needs https://github.com/micronaut-projects/micronaut-core/pull/10126
})
public class JettyHttpServerTestSuite {
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"io.micronaut.http.server.tck.tests.filter.ClientResponseFilterTest", // responseFilterThrowableParameter fails under Graal https://ge.micronaut.io/s/ufuhtbe5sgmxi
"io.micronaut.http.server.tck.tests.FilterProxyTest", // see https://github.com/micronaut-projects/micronaut-core/issues/9725
"io.micronaut.http.server.tck.tests.LocalErrorReadingBodyTest", // Cannot read body as text once stream is exhausted trying to read it as a different type See https://github.com/micronaut-projects/micronaut-servlet/pull/548
"io.micronaut.http.server.tck.tests.filter.options.OptionsFilterTest" // needs https://github.com/micronaut-projects/micronaut-core/pull/10126
})
public class TomcatHttpServerTestSuite {
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"io.micronaut.http.server.tck.tests.StreamTest", // The outputstream in Undertow is marked ready asynchronously, and we throw the error early, so sometimes there's no body for statusErrorAsFirstItem.
"io.micronaut.http.server.tck.tests.FilterProxyTest", // see https://github.com/micronaut-projects/micronaut-core/issues/9725
"io.micronaut.http.server.tck.tests.LocalErrorReadingBodyTest", // Cannot read body as text once stream is exhausted trying to read it as a different type See https://github.com/micronaut-projects/micronaut-servlet/pull/548
"io.micronaut.http.server.tck.tests.filter.options.OptionsFilterTest" // needs https://github.com/micronaut-projects/micronaut-core/pull/10126
})
public class UndertowHttpServerTestSuite {
}