Skip to content

Commit

Permalink
Merge pull request quarkusio#42340 from gsmet/3.13.1-backports-2
Browse files Browse the repository at this point in the history
[3.13] 3.13.1 backports 2
  • Loading branch information
gsmet authored Aug 7, 2024
2 parents 4ea2c67 + fd03825 commit 28e1bf1
Show file tree
Hide file tree
Showing 39 changed files with 618 additions and 229 deletions.
11 changes: 8 additions & 3 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<wildfly-elytron.version>2.5.0.Final</wildfly-elytron.version>
<jboss-marshalling.version>2.1.4.SP1</jboss-marshalling.version>
<jboss-threads.version>3.6.1.Final</jboss-threads.version>
<vertx.version>4.5.8</vertx.version>
<vertx.version>4.5.9</vertx.version>
<httpclient.version>4.5.14</httpclient.version>
<httpcore.version>4.4.16</httpcore.version>
<httpasync.version>4.1.5</httpasync.version>
Expand Down Expand Up @@ -143,7 +143,7 @@
<kafka3.version>3.7.1</kafka3.version>
<lz4.version>1.8.0</lz4.version> <!-- dependency of the kafka-clients that could be overridden by other imported BOMs in the platform -->
<snappy.version>1.1.10.5</snappy.version>
<strimzi-test-container.version>0.106.0</strimzi-test-container.version>
<strimzi-test-container.version>0.107.0</strimzi-test-container.version>
<!-- Scala is used by Kafka so we need to choose a compatible version -->
<scala.version>2.13.14</scala.version>
<aws-lambda-java.version>1.2.3</aws-lambda-java.version>
Expand All @@ -160,7 +160,7 @@
<awaitility.version>4.2.1</awaitility.version>
<jboss-logmanager.version>3.0.6.Final</jboss-logmanager.version>
<flyway.version>10.15.2</flyway.version>
<yasson.version>3.0.3</yasson.version>
<yasson.version>3.0.4</yasson.version>
<!-- liquibase-mongodb is not released everytime with liquibase anymore, but the two versions need to be compatible -->
<liquibase.version>4.27.0</liquibase.version>
<liquibase-mongodb.version>4.24.0</liquibase-mongodb.version>
Expand Down Expand Up @@ -5743,6 +5743,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>mutiny-zero</artifactId>
<version>${mutiny-zero.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>mutiny-zero-flow-adapters</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom/dev-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>Dependency management for dev-ui. Importable by third party extension developers.</description>

<properties>
<vaadin.version>24.4.2</vaadin.version>
<vaadin.version>24.4.5</vaadin.version>
<lit.version>3.1.4</lit.version>
<lit-element.version>4.0.6</lit-element.version>
<lit-html.version>3.1.4</lit-html.version>
Expand Down
2 changes: 1 addition & 1 deletion bom/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<jaxb-api.version>2.3.1</jaxb-api.version>

<rxjava1.version>1.3.8</rxjava1.version>
<strimzi-test-container.version>0.106.0</strimzi-test-container.version>
<strimzi-test-container.version>0.107.0</strimzi-test-container.version>

<opentelemetry-proto.version>1.0.0-alpha</opentelemetry-proto.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public Integer updateProject(TargetQuarkusVersionGroup targetQuarkusVersion, Rew
args.add("-DquarkusUpdateRecipes=" + rewrite.quarkusUpdateRecipes);
}
if (rewrite.additionalUpdateRecipes != null) {
args.add("-DadditionalUpdateRecipes" + rewrite.additionalUpdateRecipes);
args.add("-DadditionalUpdateRecipes=" + rewrite.additionalUpdateRecipes);
}
if (rewrite.dryRun) {
args.add("-DrewriteDryRun");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ImageOptions {

@CommandLine.Option(order = 3, names = {
"--group" }, description = "The group part of the container image. Defaults to the ${user.name}.")
public Optional<String> group = Optional.of(System.getProperty("user.name"));
public Optional<String> group = Optional.empty();

@CommandLine.Option(order = 4, names = {
"--name" }, description = "The name part of the container image. Defaults to the ${project.artifactId}.")
Expand Down
2 changes: 1 addition & 1 deletion devtools/gradle/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugin-publish = "1.2.1"

# updating Kotlin here makes QuarkusPluginTest > shouldNotFailOnProjectDependenciesWithoutMain(Path) fail
kotlin = "2.0.0"
smallrye-config = "3.8.3"
smallrye-config = "3.9.1"

junit5 = "5.10.3"
assertj = "3.26.3"
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/asciidoc/qute-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include::_attributes.adoc[]
:numbered:
:sectnums:
:sectnumlevels: 4
:toclevels: 3
:topics: templating,qute
:extensions: io.quarkus:quarkus-qute,io.quarkus:quarkus-resteasy-qute,io.quarkus:quarkus-rest-qute

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/scripting.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ The next lines

[source,java]
----
// //DEPS <dependency1> <dependency2>
//DEPS <dependency1> <dependency2>
----

illustrate how you add dependencies to this script. This is a feature of JBang.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,13 @@ public DevServicesResultBuildItem startKeycloakContainer(
StartupLogCompressor compressor = new StartupLogCompressor(
(launchMode.isTest() ? "(test) " : "") + "Keycloak Dev Services Starting:",
consoleInstalledBuildItem, loggingSetupBuildItem);
if (vertxInstance == null) {
vertxInstance = Vertx.vertx();
}
try {
List<String> errors = new ArrayList<>();

boolean useSharedNetwork = DevServicesSharedNetworkBuildItem.isSharedNetworkRequired(devServicesConfig,
devServicesSharedNetworkBuildItem);
RunningDevService newDevService = startContainer(dockerStatusBuildItem, keycloakBuildItemBuildProducer,
!devServicesSharedNetworkBuildItem.isEmpty(),
useSharedNetwork,
devServicesConfig.timeout,
errors);
if (newDevService == null) {
Expand Down Expand Up @@ -279,6 +278,12 @@ private Map<String, String> prepareConfiguration(

List<String> realmNames = new LinkedList<>();

// this needs to be only if we actually start the dev-service as it adds a shutdown hook
// whose TCCL is the Augmentation CL, which if not removed, causes a massive memory leaks
if (vertxInstance == null) {
vertxInstance = Vertx.vertx();
}

WebClient client = OidcDevServicesUtils.createWebClient(vertxInstance);
try {
String adminToken = getAdminToken(client, clientAuthServerBaseUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ ResultHandle findAll(BytecodeCreator creator, ResultHandle page, ResultHandle so
* Available number of pages given a page instance.
*
* @param creator Bytecode creator that should be used for implementation.
* @param page Page instance.
* @param page Page instance that should be used in a query.
* @param query HQL query to list entities.
* @param queryParams Map of parameters to use by the HQL query.
* @return int page count.
*/
ResultHandle pageCount(BytecodeCreator creator, ResultHandle page);
ResultHandle pageCount(BytecodeCreator creator, ResultHandle page, ResultHandle query, ResultHandle queryParams);

/**
* return the total number of entities.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,15 @@ public ResultHandle deleteById(BytecodeCreator creator, ResultHandle id) {
}

/**
* Implements <code>Entity.findAll().page(page).pageCount()</code>
* Implements <code>Entity.find(query, params).page(page).pageCount()</code>
*/
@Override
public ResultHandle pageCount(BytecodeCreator creator, ResultHandle page) {
ResultHandle query = creator.invokeStaticMethod(ofMethod(entityClassName, "findAll", PanacheQuery.class));
creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "page", PanacheQuery.class, Page.class), query,
public ResultHandle pageCount(BytecodeCreator creator, ResultHandle page, ResultHandle query, ResultHandle queryParams) {
ResultHandle panacheQuery = creator.invokeStaticMethod(ofMethod(entityClassName, "find", PanacheQuery.class,
String.class, Map.class), query, queryParams);
creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "page", PanacheQuery.class, Page.class), panacheQuery,
page);
return creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "pageCount", int.class), query);
return creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "pageCount", int.class), panacheQuery);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,15 @@ public ResultHandle deleteById(BytecodeCreator creator, ResultHandle id) {
}

/**
* Implements <code>repository.findAll().page(page).pageCount()</code>
* Implements <code>repository.find(query, params).page(page).pageCount()</code>
*/
@Override
public ResultHandle pageCount(BytecodeCreator creator, ResultHandle page) {
ResultHandle query = creator.invokeInterfaceMethod(ofMethod(PanacheRepositoryBase.class, "findAll", PanacheQuery.class),
getRepositoryInstance(creator));
creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "page", PanacheQuery.class, Page.class), query, page);
return creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "pageCount", int.class), query);
public ResultHandle pageCount(BytecodeCreator creator, ResultHandle page, ResultHandle query, ResultHandle queryParams) {
ResultHandle panacheQuery = creator
.invokeInterfaceMethod(ofMethod(PanacheRepositoryBase.class, "find", PanacheQuery.class,
String.class, Map.class), getRepositoryInstance(creator), query, queryParams);
creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "page", PanacheQuery.class, Page.class), panacheQuery, page);
return creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "pageCount", int.class), panacheQuery);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ private void implementListWithQuery(ClassCreator classCreator, DataAccessImpleme
*/
private void implementListPageCount(ClassCreator classCreator, DataAccessImplementor dataAccessImplementor) {
MethodCreator methodCreator = classCreator.getMethodCreator(Constants.PAGE_COUNT_METHOD_PREFIX + "list", int.class,
Page.class);
Page.class, String.class, Map.class);
ResultHandle page = methodCreator.getMethodParam(0);
methodCreator.returnValue(dataAccessImplementor.pageCount(methodCreator, page));
ResultHandle query = methodCreator.getMethodParam(1);
ResultHandle queryParams = methodCreator.getMethodParam(2);
methodCreator.returnValue(dataAccessImplementor.pageCount(methodCreator, page, query, queryParams));
methodCreator.close();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import jakarta.ws.rs.core.Link;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

import io.restassured.http.Header;
import io.restassured.response.Response;
Expand Down Expand Up @@ -416,4 +418,69 @@ void shouldListEmptyTables() {
.when().get("/empty-list-items")
.then().statusCode(200);
}

@ParameterizedTest
@CsvSource({
"page,0",
"size,1",
"name,first",
"collection.id,full"
})
void shouldShowSpecificParameterInLinkHeaders(String queryParamName, String queryParamValue) {
Response response = given().accept("application/json")
.when()
.queryParam(queryParamName, queryParamValue)
.get("/items")
.thenReturn();

assertThat(response.getStatusCode()).isEqualTo(200);
List<Link> links = response.getHeaders().getList("Link")
.stream()
.map(header -> Link.valueOf(header.getValue()))
.toList();
assertThat(links).allMatch(link -> link.getUri().getQuery()
.contains(String.format("%s=%s", queryParamName, queryParamValue)));
}

@Test
void shouldShowAllPaginationAndCustomQueryParametersInLinkHeaders() {
Response response = given().accept("application/json")
.when()
.queryParam("page", "0")
.queryParam("size", "3")
.queryParam("name", "first")
.queryParam("namedQuery", "Item.containsInName")
.get("/items")
.thenReturn();

assertThat(response.getStatusCode()).isEqualTo(200);
List<Link> links = response.getHeaders().getList("Link")
.stream()
.map(header -> Link.valueOf(header.getValue()))
.toList();
assertThat(links).allMatch(link -> link.getUri().getQuery()
.contains("page=0&size=3&namedQuery=Item.containsInName&name=first"));
}

@Test
void shouldShowAllPaginationAndFilteringParametersInLinkHeaders() {
Response response = given().accept("application/json")
.when()
.queryParam("page", "0")
.queryParam("size", "1")
.queryParam("name", "first")
.queryParam("collection.id", "full")
.get("/items")
.thenReturn();

assertThat(response.getStatusCode()).isEqualTo(200);
List<Link> links = response.getHeaders().getList("Link")
.stream()
.map(header -> Link.valueOf(header.getValue()))
.toList();
assertThat(links).allMatch(link -> {
var query = link.getUri().getQuery();
return query.contains("page=0&size=1") && query.contains("name=first") && query.contains("collection.id=full");
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ ResultHandle findAll(BytecodeCreator creator, ResultHandle page, ResultHandle so
* Available number of pages given a page instance.
*
* @param creator Bytecode creator that should be used for implementation.
* @param page Page instance.
* @param page Page instance that should be used in a query.
* @param query HQL query to list entities.
* @param queryParams Map of parameters to use by the HQL query.
* @return int page count.
*/
ResultHandle pageCount(BytecodeCreator creator, ResultHandle page);
ResultHandle pageCount(BytecodeCreator creator, ResultHandle page, ResultHandle query, ResultHandle queryParams);

/**
* return the total number of entities.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ public ResultHandle deleteById(BytecodeCreator creator, ResultHandle id) {
}

/**
* Implements <code>Entity.findAll().page(page).pageCount()</code>
* Implements <code>Entity.find(query, params).page(page).pageCount()</code>
*/
@Override
public ResultHandle pageCount(BytecodeCreator creator, ResultHandle page) {
ResultHandle query = creator.invokeStaticMethod(ofMethod(entityClassName, "findAll", PanacheQuery.class));
creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "page", PanacheQuery.class, Page.class), query,
public ResultHandle pageCount(BytecodeCreator creator, ResultHandle page, ResultHandle query, ResultHandle queryParams) {
ResultHandle panacheQuery = creator.invokeStaticMethod(ofMethod(entityClassName, "find", PanacheQuery.class,
String.class, Map.class), query, queryParams);
creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "page", PanacheQuery.class, Page.class), panacheQuery,
page);
return creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "pageCount", Uni.class), query);
return creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "pageCount", Uni.class), panacheQuery);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,15 @@ public ResultHandle deleteById(BytecodeCreator creator, ResultHandle id) {
}

/**
* Implements <code>repository.findAll().page(page).pageCount()</code>
* Implements <code>repository.find(query, params).page(page).pageCount()</code>
*/
@Override
public ResultHandle pageCount(BytecodeCreator creator, ResultHandle page) {
ResultHandle query = creator.invokeInterfaceMethod(ofMethod(PanacheRepositoryBase.class, "findAll", PanacheQuery.class),
getRepositoryInstance(creator));
creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "page", PanacheQuery.class, Page.class), query, page);
return creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "pageCount", Uni.class), query);
public ResultHandle pageCount(BytecodeCreator creator, ResultHandle page, ResultHandle query, ResultHandle queryParams) {
ResultHandle panacheQuery = creator
.invokeInterfaceMethod(ofMethod(PanacheRepositoryBase.class, "find", PanacheQuery.class,
String.class, Map.class), getRepositoryInstance(creator), query, queryParams);
creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "page", PanacheQuery.class, Page.class), panacheQuery, page);
return creator.invokeInterfaceMethod(ofMethod(PanacheQuery.class, "pageCount", Uni.class), panacheQuery);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ private void implementCount(ClassCreator classCreator, DataAccessImplementor dat
*/
private void implementListPageCount(ClassCreator classCreator, DataAccessImplementor dataAccessImplementor) {
MethodCreator methodCreator = classCreator.getMethodCreator(Constants.PAGE_COUNT_METHOD_PREFIX + "list", Uni.class,
Page.class);
Page.class, String.class, Map.class);
ResultHandle page = methodCreator.getMethodParam(0);
methodCreator.returnValue(dataAccessImplementor.pageCount(methodCreator, page));
ResultHandle query = methodCreator.getMethodParam(1);
ResultHandle queryParams = methodCreator.getMethodParam(2);
methodCreator.returnValue(dataAccessImplementor.pageCount(methodCreator, page, query, queryParams));
methodCreator.close();
}

Expand Down
Loading

0 comments on commit 28e1bf1

Please sign in to comment.