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

[incubator-kie-issues#1575] Upgrade quarkus to 3.15 #2141

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-client-oidc-filter</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-quarkus-test-utils</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-reactive-messaging-kafka</artifactId>
<artifactId>quarkus-messaging-kafka</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.reactivemessaging.http</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,17 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-client-oidc-filter</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-addons-quarkus-messaging</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-reactive-messaging-kafka</artifactId>
<artifactId>quarkus-messaging-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-client-oidc-filter</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>integration-tests-jobs-service-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-client-oidc-filter</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-addons-quarkus-messaging</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-reactive-messaging-kafka</artifactId>
<artifactId>quarkus-messaging-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-client-oidc-filter</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-addons-quarkus-events-process</artifactId>
Expand All @@ -63,7 +67,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-reactive-messaging-kafka</artifactId>
<artifactId>quarkus-messaging-kafka</artifactId>
</dependency>
<!-- Used to enable the proto generation set in the data-index -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-reactive-jackson</artifactId>
<artifactId>quarkus-rest-client-jackson</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
Expand All @@ -101,7 +101,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-reactive</artifactId>
<artifactId>quarkus-rest-client</artifactId>
</dependency>
<dependency>
<groupId>io.cloudevents</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void testAddBrokenProtoFile() {
fail("Registering broken proto file should fail");
} catch (Exception ex) {
assertThat(ex.getMessage())
.isEqualTo("Failed to resolve type of field \"org.demo.travels.traveller\". Type not found : stringa");
.isEqualTo("Failed to resolve type of field \"org.demo.travels.traveller\" in \"domainModel\". Type not found : stringa");
}
}

Expand Down Expand Up @@ -136,30 +136,6 @@ void testProtoWithoutSortingAttribute() throws Exception {
.then().log().ifValidationFails().statusCode(200).body("data.Books", isA(Collection.class));
}

@Test
//Reproducer for KOGITO-172
void testAddProtoFileTwice() throws Exception {
protobufService.registerProtoBufferType(getProtoBufferFileV1());
given().contentType(ContentType.JSON)
.body("{ \"query\" : \"{Game{ player, id, name, metadata { processInstances { id } } } }\" }")
.when().post("/graphql")
.then().log().ifValidationFails().statusCode(200).body("data.Game", isA(Collection.class));
given().contentType(ContentType.JSON)
.body("{ \"query\" : \"{ProcessInstances{ id, processId, rootProcessId, rootProcessInstanceId, parentProcessInstanceId } }\" }")
.when().post("/graphql")
.then().log().ifValidationFails().statusCode(200).body("data.ProcessInstances", isA(Collection.class));

protobufService.registerProtoBufferType(getProtoBufferFileV2());
given().contentType(ContentType.JSON)
.body("{ \"query\" : \"{Game{ id, name, company, metadata { processInstances { id } } } }\" }")
.when().post("/graphql")
.then().log().ifValidationFails().statusCode(200).body("data.Game", isA(Collection.class));
given().contentType(ContentType.JSON)
.body("{ \"query\" : \"{ProcessInstances{ id, processId, rootProcessId, rootProcessInstanceId, parentProcessInstanceId } }\" }")
.when().post("/graphql")
.then().log().ifValidationFails().statusCode(200).body("data.ProcessInstances", isA(Collection.class));
}

@Test
void testAddProtoFile() throws Exception {
String processId = "travels";
Expand Down Expand Up @@ -779,38 +755,6 @@ private String getBrokenProtoBufferFile() {
"\n";
}

private String getProtoBufferFileV1() {
return "package org.demo;\n" +
"import \"kogito-index.proto\";\n" +
"option kogito_model=\"Game\";\n" +
"option kogito_id=\"game\";\n" +
"/* @Indexed */\n" +
"message Game {\n" +
" optional string player = 1;\n" +
" /* @Field(index = Index.YES, store = Store.YES) @SortableField */\n" +
" optional string id = 2;\n" +
" optional string name = 3;\n" +
" optional org.kie.kogito.index.model.KogitoMetadata metadata = 4;\n" +
"}\n" +
"\n";
}

private String getProtoBufferFileV2() {
return "package org.demo;\n" +
"import \"kogito-index.proto\";\n" +
"option kogito_model=\"Game\";\n" +
"option kogito_id=\"game\";\n" +
"/* @Indexed */\n" +
"message Game {\n" +
" /* @Field(index = Index.YES, store = Store.YES) @SortableField */\n" +
" optional string id = 1;\n" +
" optional string name = 2;\n" +
" optional string company = 3;\n" +
" optional org.kie.kogito.index.model.KogitoMetadata metadata = 4;\n" +
"}\n" +
"\n";
}

protected abstract String getProcessProtobufFileContent() throws Exception;

protected abstract String getUserTaskProtobufFileContent() throws Exception;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-reactive-messaging-kafka</artifactId>
<artifactId>quarkus-messaging-kafka</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down Expand Up @@ -96,6 +96,10 @@
<artifactId>json-unit-assertj</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-client-hotrod</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-quarkus-test-utils</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ version: '2.1'
services:

infinispan:
image: infinispan/server:14.0.4.Final
image: infinispan/server:15.0.8.Final
container_name: infinispan
ports:
- 11222:11222
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ services:
LOG_DIR: "/tmp/logs"

infinispan:
image: infinispan/server:14.0.4.Final
image: infinispan/server:15.0.8.Final
container_name: data-index-infinispan
ports:
- "11222:11222"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,30 @@
*/
package org.kie.kogito.index.service;

import java.util.Collection;

import org.junit.jupiter.api.Test;
import org.kie.kogito.index.service.test.InMemoryMessageTestProfile;
import org.kie.kogito.index.test.TestUtils;
import org.kie.kogito.persistence.protobuf.ProtobufService;

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.TestProfile;
import io.restassured.http.ContentType;

import jakarta.inject.Inject;

import static io.restassured.RestAssured.given;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.isA;

@QuarkusTest
@TestProfile(InMemoryMessageTestProfile.class)
class InfinispanDomainIndexingServiceIT extends AbstractDomainIndexingServiceIT {

@Inject
ProtobufService protobufService;

@Override
protected String getProcessProtobufFileContent() throws Exception {
return TestUtils.getTravelsProtoBufferFile();
Expand All @@ -37,4 +51,57 @@ protected String getProcessProtobufFileContent() throws Exception {
protected String getUserTaskProtobufFileContent() throws Exception {
return TestUtils.getDealsProtoBufferFile();
}

@Test
// Schema compatibility checks introduced in ISPN-15974
void testAddProtoFileTwice() throws Exception {
protobufService.registerProtoBufferType(getProtoBufferFileV1());
given().contentType(ContentType.JSON)
.body("{ \"query\" : \"{Game{ player, id, name, metadata { processInstances { id } } } }\" }")
.when().post("/graphql")
.then().log().ifValidationFails().statusCode(200).body("data.Game", isA(Collection.class));
given().contentType(ContentType.JSON)
.body("{ \"query\" : \"{ProcessInstances{ id, processId, rootProcessId, rootProcessInstanceId, parentProcessInstanceId } }\" }")
.when().post("/graphql")
.then().log().ifValidationFails().statusCode(200).body("data.ProcessInstances", isA(Collection.class));

try {
protobufService.registerProtoBufferType(getProtoBufferFileV2());
} catch (Exception ex) {
assertThat(ex.getMessage())
.contains("Incompatible schema changes");
}
}

private String getProtoBufferFileV1() {
return "package org.demo;\n" +
"import \"kogito-index.proto\";\n" +
"option kogito_model=\"Game\";\n" +
"option kogito_id=\"game\";\n" +
"/* @Indexed */\n" +
"message Game {\n" +
" optional string player = 1;\n" +
" /* @Field(index = Index.YES, store = Store.YES) @SortableField */\n" +
" optional string id = 2;\n" +
" optional string name = 3;\n" +
" optional org.kie.kogito.index.model.KogitoMetadata metadata = 4;\n" +
"}\n" +
"\n";
}

private String getProtoBufferFileV2() {
return "package org.demo;\n" +
"import \"kogito-index.proto\";\n" +
"option kogito_model=\"Game\";\n" +
"option kogito_id=\"game\";\n" +
"/* @Indexed */\n" +
"message Game {\n" +
" /* @Field(index = Index.YES, store = Store.YES) @SortableField */\n" +
" optional string id = 1;\n" +
" optional string name = 2;\n" +
" optional string company = 3;\n" +
" optional org.kie.kogito.index.model.KogitoMetadata metadata = 4;\n" +
"}\n" +
"\n";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-reactive-messaging-kafka</artifactId>
<artifactId>quarkus-messaging-kafka</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@
*/
package org.kie.kogito.index.service;

import io.restassured.http.ContentType;
import org.junit.jupiter.api.Test;
import org.kie.kogito.index.service.test.InMemoryMessageTestProfile;
import org.kie.kogito.index.test.TestUtils;

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.TestProfile;

import java.util.Collection;

import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.isA;

@QuarkusTest
@TestProfile(InMemoryMessageTestProfile.class)
class MongoDomainIndexingServiceIT extends AbstractDomainIndexingServiceIT {
Expand All @@ -37,4 +44,57 @@ protected String getProcessProtobufFileContent() throws Exception {
protected String getUserTaskProtobufFileContent() throws Exception {
return TestUtils.readFileContent("deals-mongo.proto");
}
@Test
void testAddProtoFileTwice() throws Exception {
protobufService.registerProtoBufferType(getProtoBufferFileV1());
given().contentType(ContentType.JSON)
.body("{ \"query\" : \"{Game{ player, id, name, metadata { processInstances { id } } } }\" }")
.when().post("/graphql")
.then().log().ifValidationFails().statusCode(200).body("data.Game", isA(Collection.class));
given().contentType(ContentType.JSON)
.body("{ \"query\" : \"{ProcessInstances{ id, processId, rootProcessId, rootProcessInstanceId, parentProcessInstanceId } }\" }")
.when().post("/graphql")
.then().log().ifValidationFails().statusCode(200).body("data.ProcessInstances", isA(Collection.class));

protobufService.registerProtoBufferType(getProtoBufferFileV2());
given().contentType(ContentType.JSON)
.body("{ \"query\" : \"{Game{ id, name, company, metadata { processInstances { id } } } }\" }")
.when().post("/graphql")
.then().log().ifValidationFails().statusCode(200).body("data.Game", isA(Collection.class));
given().contentType(ContentType.JSON)
.body("{ \"query\" : \"{ProcessInstances{ id, processId, rootProcessId, rootProcessInstanceId, parentProcessInstanceId } }\" }")
.when().post("/graphql")
.then().log().ifValidationFails().statusCode(200).body("data.ProcessInstances", isA(Collection.class));
}
private String getProtoBufferFileV1() {
return "package org.demo;\n" +
"import \"kogito-index.proto\";\n" +
"option kogito_model=\"Game\";\n" +
"option kogito_id=\"game\";\n" +
"/* @Indexed */\n" +
"message Game {\n" +
" optional string player = 1;\n" +
" /* @Field(index = Index.YES, store = Store.YES) @SortableField */\n" +
" optional string id = 2;\n" +
" optional string name = 3;\n" +
" optional org.kie.kogito.index.model.KogitoMetadata metadata = 4;\n" +
"}\n" +
"\n";
}

private String getProtoBufferFileV2() {
return "package org.demo;\n" +
"import \"kogito-index.proto\";\n" +
"option kogito_model=\"Game\";\n" +
"option kogito_id=\"game\";\n" +
"/* @Indexed */\n" +
"message Game {\n" +
" /* @Field(index = Index.YES, store = Store.YES) @SortableField */\n" +
" optional string id = 1;\n" +
" optional string name = 2;\n" +
" optional string company = 3;\n" +
" optional org.kie.kogito.index.model.KogitoMetadata metadata = 4;\n" +
"}\n" +
"\n";
}
}
Loading
Loading