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

[KOGITO-9501] Changing Everit to json-schema-validator #3107

Merged
merged 3 commits into from
Jul 6, 2023

Conversation

fjtirado
Copy link
Contributor

@fjtirado fjtirado commented Jul 6, 2023

Using jackson validator rather than gson one.
In order gson one to dissapear completely, we need PR to remove it from Java SDK.
There is also another subttle change in behaviour (for good). This jackson API allows us to distinghish between a validation failure of the schema against the data (that might or not be ignored as per spec) and a failure parsing the schema itself (which in my opinion should be propagated always because there is a fatal configuration error that requires user intervention, for example, a bad formatted schema file or an unavailable one) .

@fjtirado fjtirado changed the title [KOGITO-9501] Update dependencies [KOGITO-9501] Changing Everit to json-schema-validator Jul 6, 2023
@kie-ci3
Copy link
Contributor

kie-ci3 commented Jul 6, 2023

(tests) - kogito-runtimes job #2834 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

export BUILD_MVN_OPTS_CURRENT=-T 1C -Dvalidate-formatting -Prun-code-coverage
build-chain build cross_pr -f 'https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/.ci/pull-request-config.yaml' -o 'bc' -p kiegroup/kogito-runtimes -u https://github.com/kiegroup/kogito-runtimes/pull/3107 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://eng-jenkins-csb-business-automation.apps.ocp-c1.prod.psi.redhat.com/job/KIE/job/kogito/job/main/job/pullrequest/job/kogito-runtimes.tests.kogito-runtimes/2834/display/redirect

Test results:

  • PASSED: 3353
  • FAILED: 1

Those are the test failures:

org.kie.kogito.quarkus.workflows.ExpressionRestIT.testExpressionOutputValidation 1 expectation failed.
JSON path message doesn't match.
Expected: a string containing "required key [message] not found"
Actual: java.lang.IllegalArgumentException - Validation errors com.github.fge.jsonschema.core.report.ListProcessingReport: failure\n--- BEGIN MESSAGES ---\nerror: object has missing required properties ([\"message\"])\n level: \"error\"\n schema: {\"loadingURI\":\"#\",\"pointer\":\"\"}\n instance: {\"pointer\":\"\"}\n domain: \"validation\"\n keyword: \"required\"\n required: [\"message\",\"result\"]\n missing: [\"message\"]\n--- END MESSAGES ---\n

@kie-ci3
Copy link
Contributor

kie-ci3 commented Jul 6, 2023

(tests) - kogito-runtimes job #2835 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

export BUILD_MVN_OPTS_CURRENT=-T 1C -Dvalidate-formatting -Prun-code-coverage
build-chain build cross_pr -f 'https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/.ci/pull-request-config.yaml' -o 'bc' -p kiegroup/kogito-runtimes -u https://github.com/kiegroup/kogito-runtimes/pull/3107 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://eng-jenkins-csb-business-automation.apps.ocp-c1.prod.psi.redhat.com/job/KIE/job/kogito/job/main/job/pullrequest/job/kogito-runtimes.tests.kogito-runtimes/2835/display/redirect

Test results:

  • PASSED: 3352
  • FAILED: 2

Those are the test failures:

org.kie.kogito.persistence.kafka.KafkaProcessInstancesIT.testFindByIdReadMode
expected: 5
but was: 0
org.kie.kogito.quarkus.workflows.ExpressionRestIT.testExpressionOutputValidation 1 expectation failed.
JSON path message doesn't match.
Expected: a string containing "required key [message] not found"
Actual: java.lang.IllegalArgumentException - Validation errors com.github.fge.jsonschema.core.report.ListProcessingReport: failure\n--- BEGIN MESSAGES ---\nerror: object has missing required properties ([\"message\"])\n level: \"error\"\n schema: {\"loadingURI\":\"#\",\"pointer\":\"\"}\n instance: {\"pointer\":\"\"}\n domain: \"validation\"\n keyword: \"required\"\n required: [\"message\",\"result\"]\n missing: [\"message\"]\n--- END MESSAGES ---\n

@kie-ci3
Copy link
Contributor

kie-ci3 commented Jul 6, 2023

(tests) - kogito-apps job #2840 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

export BUILD_MVN_OPTS_CURRENT=
build-chain build cross_pr -f 'https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/.ci/pull-request-config.yaml' -o 'bc' -p kiegroup/kogito-apps -u https://github.com/kiegroup/kogito-runtimes/pull/3107 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://eng-jenkins-csb-business-automation.apps.ocp-c1.prod.psi.redhat.com/job/KIE/job/kogito/job/main/job/pullrequest/job/kogito-runtimes.tests.downstream.kogito-apps/2840/display/redirect

Test results:

  • PASSED: 2774
  • FAILED: 1

Those are the test failures:

Build projects / org.kie.kogito.it.jobs.MultipleTimerInstancesIT.boundaryTimerEvent Failed to load ApplicationContext

@sonarcloud
Copy link

sonarcloud bot commented Jul 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

83.3% 83.3% Coverage
0.0% 0.0% Duplication

Copy link
Member

@ricardozanini ricardozanini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to remove commons?

@fjtirado
Copy link
Contributor Author

fjtirado commented Jul 6, 2023

Is it safe to remove commons?

Apparently, see https://github.com/networknt/json-schema-validator#dependency-1

@fjtirado fjtirado merged commit 4431aed into apache:main Jul 6, 2023
7 checks passed
github-actions bot pushed a commit that referenced this pull request Jul 6, 2023
* [KOGITO-9501] Changing JsonSchema validator library

* [KOGITO-9501] Different validation message

* [KOGITO-9501] Changing to networknt library
github-actions bot pushed a commit that referenced this pull request Jul 6, 2023
* [KOGITO-9501] Changing JsonSchema validator library

* [KOGITO-9501] Different validation message

* [KOGITO-9501] Changing to networknt library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants