From bce9c36c2f2da6160f41c8f2ccde82a283e73877 Mon Sep 17 00:00:00 2001 From: radtriste Date: Thu, 31 Aug 2023 15:43:47 +0200 Subject: [PATCH 1/2] Quarkus 3: Fix patches --- .../patches/0002_hibernate_changes.patch | 77 ++++++++++++------- .../0006_data-index-reactive-streams.patch | 28 +++---- 2 files changed, 62 insertions(+), 43 deletions(-) diff --git a/.ci/environments/quarkus-3/patches/0002_hibernate_changes.patch b/.ci/environments/quarkus-3/patches/0002_hibernate_changes.patch index 2c4b04368c..98cb3d23c6 100644 --- a/.ci/environments/quarkus-3/patches/0002_hibernate_changes.patch +++ b/.ci/environments/quarkus-3/patches/0002_hibernate_changes.patch @@ -1,7 +1,7 @@ -diff --git a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-common/src/main/java/org/kie/kogito/index/AbstractProcessDataIndexIT.java b/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-common/src/main/java/org/kie/kogito/index/AbstractProcessDataIndexIT.java -index 3b29157b6..5ecd962a4 100644 ---- a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-common/src/main/java/org/kie/kogito/index/AbstractProcessDataIndexIT.java -+++ b/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-common/src/main/java/org/kie/kogito/index/AbstractProcessDataIndexIT.java +diff --git a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-common/src/test/java/org/kie/kogito/index/AbstractProcessDataIndexIT.java b/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-common/src/test/java/org/kie/kogito/index/AbstractProcessDataIndexIT.java +index 1e20eccb9..23450b07f 100644 +--- a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-common/src/test/java/org/kie/kogito/index/AbstractProcessDataIndexIT.java ++++ b/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-common/src/test/java/org/kie/kogito/index/AbstractProcessDataIndexIT.java @@ -107,7 +107,7 @@ public abstract class AbstractProcessDataIndexIT { .get("/approvals/{processId}/tasks") .then() @@ -11,7 +11,7 @@ index 3b29157b6..5ecd962a4 100644 .body("[0].name", is("firstLineApproval")) .body("[0].id", notNullValue()) .extract() -@@ -189,7 +189,7 @@ public abstract class AbstractProcessDataIndexIT { +@@ -200,7 +200,7 @@ public abstract class AbstractProcessDataIndexIT { .get("/approvals/{processId}/tasks") .then() .statusCode(200) @@ -20,7 +20,7 @@ index 3b29157b6..5ecd962a4 100644 .body("[0].name", is("secondLineApproval")) .body("[0].id", notNullValue()) .extract() -@@ -447,7 +447,7 @@ public abstract class AbstractProcessDataIndexIT { +@@ -458,7 +458,7 @@ public abstract class AbstractProcessDataIndexIT { .get("/approvals/{id}/firstLineApproval/{taskId}/comments") .then() .statusCode(200) @@ -29,7 +29,7 @@ index 3b29157b6..5ecd962a4 100644 .body("[0].content", is(commentContent))); Map commentMap = given().spec(dataIndexSpec()).contentType(ContentType.JSON) -@@ -545,7 +545,7 @@ public abstract class AbstractProcessDataIndexIT { +@@ -556,7 +556,7 @@ public abstract class AbstractProcessDataIndexIT { .get("/approvals/{id}/firstLineApproval/{taskId}/attachments") .then() .statusCode(200) @@ -39,10 +39,10 @@ index 3b29157b6..5ecd962a4 100644 Map attachmentMap = given().spec(dataIndexSpec()).contentType(ContentType.JSON) diff --git a/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/GraphQLUtils.java b/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/GraphQLUtils.java -index 6026abaf5..d7be19727 100644 +index 99c322de0..d21dcfdcc 100644 --- a/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/GraphQLUtils.java +++ b/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/GraphQLUtils.java -@@ -42,11 +42,27 @@ import com.fasterxml.jackson.databind.node.ObjectNode; +@@ -43,11 +43,28 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import static java.lang.String.format; import static java.util.stream.Collectors.joining; @@ -52,6 +52,7 @@ index 6026abaf5..d7be19727 100644 public class GraphQLUtils { + private static final String ID = "id"; ++ private static final String VERSION = "version"; + private static final String STATE = "state"; + private static final String START = "start"; + private static final String PROCESS_ID = "processId"; @@ -71,7 +72,12 @@ index 6026abaf5..d7be19727 100644 private static final Logger LOGGER = LoggerFactory.getLogger(GraphQLUtils.class); private static final Map QUERY_FIELDS = new HashMap<>(); private static final Map QUERIES = new HashMap<>(); -@@ -72,103 +88,103 @@ public class GraphQLUtils { +@@ -74,103 +91,103 @@ public class GraphQLUtils { + } + + public static String getProcessDefinitionByIdAndVersion(String id, String version) { +- return getProcessDefinitionQuery("ProcessDefinitionByIdAndVersion", id, version); ++ return getProcessDefinitionQuery("ProcessDefinitionByIdAndVersion", Map.of(ID, id, VERSION, version)); } public static String getProcessInstanceById(String id) { @@ -106,7 +112,7 @@ index 6026abaf5..d7be19727 100644 public static String getProcessInstanceByIdAndNullParentProcessInstanceId(String id, Boolean isNull) { - return getProcessInstanceQuery("ProcessInstanceByIdAndNullParentProcessInstanceId", id, isNull.toString()); -+ return getProcessInstanceQuery("ProcessInstanceByIdAndNullParentProcessInstanceId", Map.of(ID, id, IS_NULL, isNull)); ++ return getProcessInstanceQuery("ProcessInstanceByIdAndNullParentProcessInstanceId", Map.of(ID, id, IS_NULL, isNull)); } public static String getProcessInstanceByIdAndNullRootProcessInstanceId(String id, Boolean isNull) { @@ -196,12 +202,16 @@ index 6026abaf5..d7be19727 100644 } public static String getJobById(String id) { -- return getJobQuery("JobById", id); -+ return getJobQuery("JobById", Map.of(ID, id)); +@@ -178,7 +195,7 @@ public class GraphQLUtils { } public static String getTravelsByUserTaskId(String id) { -@@ -191,10 +207,10 @@ public class GraphQLUtils { +- return getQuery("TravelsByUserTaskId", id); ++ return getQuery("TravelsByUserTaskId", id); + } + + public static String getTravelsByProcessInstanceId(String id) { +@@ -197,10 +214,10 @@ public class GraphQLUtils { return getQuery("DealsByTaskIdNoActualOwner", id); } @@ -214,7 +224,7 @@ index 6026abaf5..d7be19727 100644 values.forEach(g -> pg.add(g)); return jsonNode.toString(); } -@@ -203,20 +219,30 @@ public class GraphQLUtils { +@@ -209,25 +226,35 @@ public class GraphQLUtils { return format(QUERIES.get(name), args); } @@ -223,6 +233,11 @@ index 6026abaf5..d7be19727 100644 return getQuery(name, ProcessInstance.class, args); } +- private static String getProcessDefinitionQuery(String name, String... args) { ++ private static String getProcessDefinitionQuery(String name, Map args) { + return getQuery(name, ProcessDefinition.class, args); + } + - private static String getUserTaskInstanceQuery(String name, String... args) { + private static String getUserTaskInstanceQuery(String name, Map args) { return getQuery(name, UserTaskInstance.class, args); @@ -235,6 +250,7 @@ index 6026abaf5..d7be19727 100644 - private static String getQuery(String name, Class clazz, String... args) { - return format(QUERIES.get(name), insert(0, args, QUERY_FIELDS.get(clazz))); +- } + private static String getQuery(String name, Class clazz, Map args) { + try { + String query = format(QUERIES.get(name), QUERY_FIELDS.get(clazz)); @@ -247,15 +263,24 @@ index 6026abaf5..d7be19727 100644 + } catch (Exception e) { + throw new RuntimeException(e); + } - } ++ } private static Stream getAllFieldsList(Class clazz) { + return FieldUtils.getAllFieldsList(clazz).stream().filter(f -> getJacocoPredicate().test(f)); diff --git a/data-index/data-index-service/data-index-service-common/src/test/resources/graphql_queries.json b/data-index/data-index-service/data-index-service-common/src/test/resources/graphql_queries.json -index 6f0f72396..4b22aa924 100644 +index 8da0f683d..0825ff420 100644 --- a/data-index/data-index-service/data-index-service-common/src/test/resources/graphql_queries.json +++ b/data-index/data-index-service/data-index-service-common/src/test/resources/graphql_queries.json -@@ -1,200 +1,122 @@ +@@ -1,207 +1,126 @@ { + "ProcessDefinitionByIdAndVersion": { + "query": "query ($id: String, $version: String) { ProcessDefinitions( where: { id: { equal : $id }, version: { equal : $version } }, orderBy: { version: ASC }, pagination : { limit: 10, offset: 0 } ){ %s } }", +- "variables": { +- "id": "%s", +- "version": "%s" +- } ++ "variables": {} + }, "ProcessInstanceById": { "query": "query ($id: String) { ProcessInstances( where: { id: { equal : $id } }, orderBy: { lastUpdate: ASC }, pagination : { limit: 10, offset: 0 } ){ %s } }", - "variables": { @@ -587,12 +612,12 @@ index d848509ae..f698d913a 100644 return ((List>) filter.getValue()) .stream() diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/schema/DDLSchemaExporter.java b/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/schema/DDLSchemaExporter.java -index c2fe8a6a8..10f4e88b6 100644 +index 7f2bf10f9..420d0ee8a 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/schema/DDLSchemaExporter.java +++ b/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/schema/DDLSchemaExporter.java -@@ -44,7 +44,7 @@ public class DDLSchemaExporter { +@@ -43,7 +43,7 @@ public class DDLSchemaExporter { + public static void main(String[] args) { try (KogitoOracleSqlContainer oracleSql = new KogitoOracleSqlContainer()) { - oracleSql.waitingFor(Wait.forListeningPort()); oracleSql.start(); - Map settings = new HashMap<>(); + Map settings = new HashMap<>(); @@ -658,7 +683,7 @@ index 2e28ef813..3a709e6a8 100644 private ObjectNode outputs; private String endpoint; diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/main/java/org/kie/kogito/index/postgresql/storage/PostgreSqlQuery.java b/data-index/data-index-storage/data-index-storage-postgresql/src/main/java/org/kie/kogito/index/postgresql/storage/PostgreSqlQuery.java -index 10b132749..8952b9486 100644 +index 74fd17bd9..e2c373f78 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/main/java/org/kie/kogito/index/postgresql/storage/PostgreSqlQuery.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/main/java/org/kie/kogito/index/postgresql/storage/PostgreSqlQuery.java @@ -26,8 +26,8 @@ import jakarta.persistence.criteria.Order; @@ -671,7 +696,7 @@ index 10b132749..8952b9486 100644 import org.kie.kogito.index.postgresql.model.AbstractEntity; import org.kie.kogito.persistence.api.query.AttributeFilter; import org.kie.kogito.persistence.api.query.AttributeSort; -@@ -132,10 +132,10 @@ public class PostgreSqlQuery implements Query { +@@ -132,10 +132,10 @@ public class PostgreSqlQuery implements Query return builder.equal(getAttributePath(root, filter.getAttribute()), filter.getValue()); case IS_NULL: Path pathNull = getAttributePath(root, filter.getAttribute()); @@ -684,7 +709,7 @@ index 10b132749..8952b9486 100644 case BETWEEN: List value = (List) filter.getValue(); return builder -@@ -176,6 +176,12 @@ public class PostgreSqlQuery implements Query { +@@ -176,6 +176,12 @@ public class PostgreSqlQuery implements Query return join.get(split[split.length - 1]); } @@ -698,10 +723,10 @@ index 10b132749..8952b9486 100644 return ((List>) filter.getValue()) .stream() diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/schema/DDLSchemaExporter.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/schema/DDLSchemaExporter.java -index 485218875..58b366a3e 100644 +index 4f0d95a71..15b2ad7cc 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/schema/DDLSchemaExporter.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/schema/DDLSchemaExporter.java -@@ -44,7 +44,7 @@ public class DDLSchemaExporter { +@@ -45,7 +45,7 @@ public class DDLSchemaExporter { try (KogitoPostgreSqlContainer postgresql = new KogitoPostgreSqlContainer()) { postgresql.waitingFor(Wait.forListeningPort()); postgresql.start(); diff --git a/.ci/environments/quarkus-3/patches/0006_data-index-reactive-streams.patch b/.ci/environments/quarkus-3/patches/0006_data-index-reactive-streams.patch index dae762d48c..9868ad86fe 100644 --- a/.ci/environments/quarkus-3/patches/0006_data-index-reactive-streams.patch +++ b/.ci/environments/quarkus-3/patches/0006_data-index-reactive-streams.patch @@ -1,26 +1,20 @@ -commit 2dffd8637aba3a41e2a0184496a0ba10d270463e -Author: radtriste -Date: Tue May 9 16:41:46 2023 +0200 - - patch: data index reactive streams - diff --git a/data-index/data-index-common/pom.xml b/data-index/data-index-common/pom.xml -index 672d4d350..cf73e37d2 100644 +index b744de020..cea2bd368 100644 --- a/data-index/data-index-common/pom.xml +++ b/data-index/data-index-common/pom.xml -@@ -41,6 +41,10 @@ - com.graphql-java - graphql-java-extended-scalars +@@ -29,6 +29,10 @@ + com.google.guava + guava + -+ io.smallrye.reactive -+ mutiny-zero-flow-adapters ++ io.smallrye.reactive ++ mutiny-zero-flow-adapters + io.quarkus quarkus-junit5 diff --git a/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/service/graphql/GraphQLSchemaManagerImpl.java b/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/service/graphql/GraphQLSchemaManagerImpl.java -index ca80a4a63..ff458fadc 100644 +index b0d1086ae..b386b0ab2 100644 --- a/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/service/graphql/GraphQLSchemaManagerImpl.java +++ b/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/service/graphql/GraphQLSchemaManagerImpl.java @@ -23,7 +23,7 @@ import java.util.concurrent.CompletableFuture; @@ -32,7 +26,7 @@ index ca80a4a63..ff458fadc 100644 import jakarta.annotation.PostConstruct; import org.kie.kogito.index.graphql.AbstractGraphQLSchemaManager; import org.kie.kogito.index.graphql.query.GraphQLQueryParserRegistry; -@@ -319,11 +319,11 @@ public class GraphQLSchemaManagerImpl extends AbstractGraphQLSchemaManager { +@@ -327,11 +327,11 @@ public class GraphQLSchemaManagerImpl extends AbstractGraphQLSchemaManager { } private DataFetcher> objectCreatedPublisher(Supplier cache) { @@ -46,7 +40,7 @@ index ca80a4a63..ff458fadc 100644 } private Supplier cacheNotFoundException(String processId) { -@@ -331,11 +331,11 @@ public class GraphQLSchemaManagerImpl extends AbstractGraphQLSchemaManager { +@@ -339,11 +339,11 @@ public class GraphQLSchemaManagerImpl extends AbstractGraphQLSchemaManager { } protected DataFetcher> getDomainModelUpdatedDataFetcher(String processId) { @@ -61,10 +55,10 @@ index ca80a4a63..ff458fadc 100644 protected DataFetcher> getDomainModelDataFetcher(String processId) { diff --git a/kogito-apps-build-parent/pom.xml b/kogito-apps-build-parent/pom.xml -index 816e42955..031600e8e 100644 +index 29bf514bf..f28b1f42c 100644 --- a/kogito-apps-build-parent/pom.xml +++ b/kogito-apps-build-parent/pom.xml -@@ -52,7 +52,7 @@ +@@ -51,7 +51,7 @@ 1.9.2 1.8 2.0.0 From 6fd21609d4044ab3b61e5f33538e1a41bb9c3725 Mon Sep 17 00:00:00 2001 From: radtriste Date: Thu, 31 Aug 2023 15:51:57 +0200 Subject: [PATCH 2/2] correction --- .../quarkus-3/patches/0002_hibernate_changes.patch | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.ci/environments/quarkus-3/patches/0002_hibernate_changes.patch b/.ci/environments/quarkus-3/patches/0002_hibernate_changes.patch index 98cb3d23c6..66f4bd1dd9 100644 --- a/.ci/environments/quarkus-3/patches/0002_hibernate_changes.patch +++ b/.ci/environments/quarkus-3/patches/0002_hibernate_changes.patch @@ -39,7 +39,7 @@ index 1e20eccb9..23450b07f 100644 Map attachmentMap = given().spec(dataIndexSpec()).contentType(ContentType.JSON) diff --git a/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/GraphQLUtils.java b/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/GraphQLUtils.java -index 99c322de0..d21dcfdcc 100644 +index 99c322de0..aae30d88d 100644 --- a/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/GraphQLUtils.java +++ b/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/GraphQLUtils.java @@ -43,11 +43,28 @@ import com.fasterxml.jackson.databind.node.ObjectNode; @@ -72,7 +72,7 @@ index 99c322de0..d21dcfdcc 100644 private static final Logger LOGGER = LoggerFactory.getLogger(GraphQLUtils.class); private static final Map QUERY_FIELDS = new HashMap<>(); private static final Map QUERIES = new HashMap<>(); -@@ -74,103 +91,103 @@ public class GraphQLUtils { +@@ -74,107 +91,107 @@ public class GraphQLUtils { } public static String getProcessDefinitionByIdAndVersion(String id, String version) { @@ -202,15 +202,11 @@ index 99c322de0..d21dcfdcc 100644 } public static String getJobById(String id) { -@@ -178,7 +195,7 @@ public class GraphQLUtils { +- return getJobQuery("JobById", id); ++ return getJobQuery("JobById", Map.of(ID, id)); } public static String getTravelsByUserTaskId(String id) { -- return getQuery("TravelsByUserTaskId", id); -+ return getQuery("TravelsByUserTaskId", id); - } - - public static String getTravelsByProcessInstanceId(String id) { @@ -197,10 +214,10 @@ public class GraphQLUtils { return getQuery("DealsByTaskIdNoActualOwner", id); }