Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into incubator-kie-issues#…
Browse files Browse the repository at this point in the history
…1605

# Conflicts:
#	jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/DMNEvaluator.java
  • Loading branch information
athira committed Nov 7, 2024
2 parents 2e5f189 + 538f33c commit 925065d
Show file tree
Hide file tree
Showing 107 changed files with 1,859 additions and 1,327 deletions.
16 changes: 8 additions & 8 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void createSetupBranchJob() {
GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",

MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",
MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name),

IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}"
])
Expand All @@ -220,10 +220,10 @@ void setupReleaseDeployJob() {
GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",

MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",
MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.RELEASE.name),
MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",
MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_URL}",
MAVEN_REPO_CREDS_ID: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_CREDS_ID}",
MAVEN_DEPLOY_REPOSITORY: Utils.getMavenArtifactsUploadRepositoryUrl(this, JobType.RELEASE.name),
MAVEN_REPO_CREDS_ID: Utils.getMavenArtifactsUploadRepositoryCredentialsId(this, JobType.RELEASE.name),

RELEASE_GPG_SIGN_KEY_CREDS_ID: Utils.getReleaseGpgSignKeyCredentialsId(this),
RELEASE_GPG_SIGN_PASSPHRASE_CREDS_ID: Utils.getReleaseGpgSignPassphraseCredentialsId(this)
Expand Down Expand Up @@ -259,7 +259,7 @@ void setupReleasePromoteJob() {
GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",

MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",
MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.RELEASE.name),
MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",
MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",
])
Expand Down Expand Up @@ -291,10 +291,10 @@ void setupWeeklyDeployJob() {
GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",

MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",
MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name),
MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",
MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_URL}",
MAVEN_REPO_CREDS_ID: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_CREDS_ID}",
MAVEN_DEPLOY_REPOSITORY: Utils.getMavenArtifactsUploadRepositoryUrl(this, JobType.NIGHTLY.name),
MAVEN_REPO_CREDS_ID: Utils.getMavenArtifactsUploadRepositoryCredentialsId(this, JobType.NIGHTLY.name),
])
KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
parameters {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-jitexecutor-native-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-13, windows-latest]

steps:
- name: Set version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-jitexecutor-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-13, windows-latest]

steps:
- name: Get current date
Expand Down
Binary file removed .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.testcontainers.shaded.com.fasterxml.jackson.databind.JsonNode;
import org.testcontainers.shaded.com.fasterxml.jackson.databind.ObjectMapper;
Expand Down Expand Up @@ -92,7 +91,6 @@ protected ValidatableResponse addCheck(ValidatableResponse res) {
}

@Test
@Disabled
public void testProcessInstanceEvents() throws IOException {
String pId = given()
.contentType(ContentType.JSON)
Expand All @@ -113,13 +111,13 @@ public void testProcessInstanceEvents() throws IOException {
.contentType(ContentType.JSON)
.queryParam("user", "admin")
.queryParam("group", "managers")
.pathParam("processId", pId)
.when()
.get("/approvals/{processId}/tasks")
.get("/usertasks/instance")
.then()
.statusCode(200)
.log().body()
.body("$.size()", is(1))
.body("[0].name", is("firstLineApproval"))
.body("[0].taskName", is("firstLineApproval"))
.body("[0].id", notNullValue())
.extract()
.path("[0].id");
Expand Down Expand Up @@ -152,7 +150,7 @@ public void testProcessInstanceEvents() throws IOException {
.body("data.Approvals[0].metadata.userTasks.size()", is(1))
.body("data.Approvals[0].metadata.userTasks[0].id", is(flTaskId))
.body("data.Approvals[0].metadata.userTasks[0].name", is("firstLineApproval"))
.body("data.Approvals[0].metadata.userTasks[0].state", is("Ready")));
.body("data.Approvals[0].metadata.userTasks[0].state", is("Reserved")));
}

await()
Expand Down Expand Up @@ -187,7 +185,22 @@ public void testProcessInstanceEvents() throws IOException {
.body("data.UserTaskInstances.size()", is(1))
.body("data.UserTaskInstances[0].id", is(flTaskId))
.body("data.UserTaskInstances[0].name", is("firstLineApproval"))
.body("data.UserTaskInstances[0].state", is("Ready")));
.body("data.UserTaskInstances[0].state", is("Reserved")));

String workItemId = given()
.contentType(ContentType.JSON)
.queryParam("user", "admin")
.queryParam("group", "managers")
.pathParam("processId", pId)
.when()
.get("/approvals/{processId}/tasks")
.then()
.statusCode(200)
.body("$.size()", is(1))
.body("[0].name", is("firstLineApproval"))
.body("[0].id", notNullValue())
.extract()
.path("[0].id");

await()
.atMost(TIMEOUT)
Expand All @@ -196,7 +209,7 @@ public void testProcessInstanceEvents() throws IOException {
.queryParam("user", "admin")
.queryParam("group", "managers")
.pathParam("processId", pId)
.pathParam("taskId", flTaskId)
.pathParam("taskId", workItemId)
.body(singletonMap("approved", true))
.post("/approvals/{processId}/firstLineApproval/{taskId}")
.then()
Expand Down Expand Up @@ -324,6 +337,7 @@ public void testProcessGatewayAPI() throws IOException {
.when().post("/graphql")
.then()
.statusCode(200)
.log().body()
.body("data.UserTaskInstances[0].description", nullValue())
.body("data.UserTaskInstances[0].potentialGroups[0]", equalTo("managers"))
.extract().path("data.UserTaskInstances[0].id");
Expand All @@ -335,6 +349,7 @@ public void testProcessGatewayAPI() throws IOException {
.when().post("/graphql")
.then()
.statusCode(200)
.log().body()
.body("errors", nullValue())
.extract().path("data.UserTaskInstances[0].schema");
checkExpectedTaskSchema(taskSchema);
Expand Down Expand Up @@ -474,9 +489,8 @@ public void testProcessGatewayAPIComments(String taskId, String processInstanceI
.when()
.queryParam("user", "manager")
.queryParam("group", "managers")
.pathParam("id", processInstanceId)
.pathParam("taskId", taskId)
.get("/approvals/{id}/firstLineApproval/{taskId}/comments")
.get("/usertasks/instance/{taskId}/comments")
.then()
.statusCode(200)
.body("size()", is(1))
Expand Down Expand Up @@ -585,9 +599,8 @@ public void testProcessGatewayAPIAttachments(String taskId, String processInstan
.when()
.queryParam("user", "manager")
.queryParam("group", "managers")
.pathParam("id", processInstanceId)
.pathParam("taskId", taskId)
.get("/approvals/{id}/firstLineApproval/{taskId}/attachments")
.get("/usertasks/instance/{taskId}/attachments")
.then()
.statusCode(200)
.body("size()", is(1))
Expand Down Expand Up @@ -710,9 +723,8 @@ private void checkExpectedTaskSchema(String taskSchema) throws IOException {
assertEquals("object", schemaJsonNode.at("/type").asText());

// Check Schema phases
assertEquals(4, schemaJsonNode.at("/phases").size());
assertEquals(3, schemaJsonNode.at("/phases").size());
assertTrue(schemaJsonNode.get("phases").toString().contains("abort"));
assertTrue(schemaJsonNode.get("phases").toString().contains("claim"));
assertTrue(schemaJsonNode.get("phases").toString().contains("skip"));
assertTrue(schemaJsonNode.get("phases").toString().contains("complete"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<properties>
<container.image.kogito-service>org.kie.kogito/integration-tests-trusty-service-springboot:${project.version}</container.image.kogito-service>
<sonar.exclusions>**/KogitoApplication.java</sonar.exclusions>
<version.jib-maven-plugin>2.8.0</version.jib-maven-plugin>
<version.jib-maven-plugin>3.3.1</version.jib-maven-plugin>
<jib-maven-plugin.container.image>eclipse-temurin:17-jre</jib-maven-plugin.container.image>
</properties>

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@
package org.kie.kogito.app.audit.json;

import org.kie.kogito.event.job.JobInstanceDataEvent;
import org.kie.kogito.event.process.ProcessInstanceDataEvent;
import org.kie.kogito.event.usertask.UserTaskInstanceDataEvent;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

import io.cloudevents.jackson.JsonFormat;

Expand All @@ -41,15 +38,7 @@ public static ObjectMapper getObjectMapper() {
}

public static ObjectMapper configure(ObjectMapper objectMapper) {
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.registerModule(JsonFormat.getCloudEventJacksonModule());
objectMapper.registerModule(new JavaTimeModule());

SimpleModule module = new SimpleModule("Kogito Cloud Events");
module.addDeserializer(ProcessInstanceDataEvent.class, new JsonProcessInstanceDataEventDeserializer());
module.addDeserializer(UserTaskInstanceDataEvent.class, new JsonUserTaskInstanceDataEventDeserializer());
module.addDeserializer(JobInstanceDataEvent.class, new JsonJobDataEventDeserializer());
objectMapper.registerModule(module);
return objectMapper;
return objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false).registerModule(JsonFormat.getCloudEventJacksonModule())
.registerModule(new SimpleModule("Data Audit").addDeserializer(JobInstanceDataEvent.class, new JsonJobDataEventDeserializer())).findAndRegisterModules();
}
}
Loading

0 comments on commit 925065d

Please sign in to comment.