-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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#1150] Improve Import Resolver error messages to be more user friendly #6014
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx @yesamer - there are just few details that maybe could be changed
kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/compiler/ImportDMNResolverUtil.java
Outdated
Show resolved
Hide resolved
kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/compiler/ImportDMNResolverUtil.java
Outdated
Show resolved
Hide resolved
kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/compiler/ImportDMNResolverUtil.java
Outdated
Show resolved
Hide resolved
kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/compiler/ImportDMNResolverUtil.java
Show resolved
Hide resolved
PR job Reproducerbuild-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-drools -u #6014 --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://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6014/5/display/redirect Test results:
Those are the test failures: org.kie.dmn.core.compiler.ImportDMNResolverUtilTest.locateInNSunexistentCannot invoke "org.kie.dmn.model.api.Definitions.getNamespace()" because the return value of "org.kie.dmn.model.api.Import.getParent()" is nullorg.kie.dmn.core.compiler.ImportDMNResolverUtilTest.locateInNSAliasedBadScenarioCannot invoke "org.kie.dmn.model.api.Definitions.getNamespace()" because the return value of "org.kie.dmn.model.api.Import.getParent()" is nullorg.kie.dmn.core.compiler.ImportDMNResolverUtilTest.locateInNSnoModelNameWithAliasCannot invoke "org.kie.dmn.model.api.Definitions.getNamespace()" because the return value of "org.kie.dmn.model.api.Import.getParent()" is nullorg.kie.dmn.core.compiler.ImportDMNResolverUtilTest.nSnoModelNameWithAliasCannot invoke "org.kie.dmn.model.api.Definitions.getNamespace()" because the return value of "org.kie.dmn.model.api.Import.getParent()" is nullorg.kie.dmn.core.compiler.ImportDMNResolverUtilTest.nSandUnexistentModelNameCannot invoke "org.kie.dmn.model.api.Definitions.getNamespace()" because the return value of "org.kie.dmn.model.api.Import.getParent()" is nullorg.kie.dmn.core.compiler.ImportDMNResolverUtilTest.locateInNSnoModelNameWithAlias2Cannot invoke "org.kie.dmn.model.api.Definitions.getNamespace()" because the return value of "org.kie.dmn.model.api.Import.getParent()" is nullorg.kie.dmn.core.compiler.ImportDMNResolverUtilTest.nSandModelNameCannot invoke "org.kie.dmn.model.api.Definitions.getNamespace()" because the return value of "org.kie.dmn.model.api.Import.getParent()" is nullorg.kie.dmn.core.compiler.ImportDMNResolverUtilTest.locateInNSAliasedCannot invoke "org.kie.dmn.model.api.Definitions.getNamespace()" because the return value of "org.kie.dmn.model.api.Import.getParent()" is nullorg.kie.dmn.core.compiler.ImportDMNResolverUtilTest.nSonlyCannot invoke "org.kie.dmn.model.api.Definitions.getNamespace()" because the return value of "org.kie.dmn.model.api.Import.getParent()" is nullorg.kie.dmn.core.compiler.ImportDMNResolverUtilTest.nSandModelNameWithAliasCannot invoke "org.kie.dmn.model.api.Definitions.getNamespace()" because the return value of "org.kie.dmn.model.api.Import.getParent()" is nullorg.kie.dmn.core.compiler.ImportDMNResolverUtilTest.locateInNSCannot invoke "org.kie.dmn.model.api.Definitions.getNamespace()" because the return value of "org.kie.dmn.model.api.Import.getParent()" is nullorg.kie.dmn.core.compiler.ImportDMNResolverUtilTest.nSnoModelNameDefaultWithAlias2Cannot invoke "org.kie.dmn.model.api.Definitions.getNamespace()" because the return value of "org.kie.dmn.model.api.Import.getParent()" is null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx @yesamer LGTM!
kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ImportDMNResolverUtilTest.java
Show resolved
Hide resolved
@mariofusco Can you please review it? Thank you! |
… be more user friendly (apache#6014) * Improved Error Messages + Logs * dependabot.yml fixed * dependabot.yml fixed * Change Request * Minor change * Tests fixed (cherry picked from commit ddb72c6)
… be more user friendly (apache#6014) * Improved Error Messages + Logs * dependabot.yml fixed * dependabot.yml fixed * Change Request * Minor change * Tests fixed (cherry picked from commit ddb72c6)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @yesamer and team, sorry to be late to the discussion, but got these questions:
- We introduce this snippet
((Definitions) importElement.getParent()).getNamespace()
, are we sure thegetParent()
returns non null value? Asking because of the change in the test mocks. To me it seems not guaranteed thegetparent()
will return non null. - We introduce also few checks in the form
a.equals(b)
that potentially may throw NPE ifa
orb
is null, what is your opinion about usingObjects.equals(a, b)
that never throws NPE? - The log messages we introduce are quite long. My question is where user can see them? (In terminal when running project via maven? in browser console log? in DMN Runner pannel? ) We delimit the sentences with a white space ' '. For such a long messages, should we use '\n' to delimit sentences? Really do not know, just asking.
@jomarko Thank you for your questions.
|
@jomarko |
…friendly (#6014) (#6020) * [incubator-kie-issues#1150] Improve Import Resolver error messages to be more user friendly (#6014) * Improved Error Messages + Logs * dependabot.yml fixed * dependabot.yml fixed * Change Request * Minor change * Tests fixed (cherry picked from commit ddb72c6) * JAVA 11 API
…friendly (apache#6014) (#66) * [incubator-kie-issues#1150] Improve Import Resolver error messages to be more user friendly (apache#6014) * Improved Error Messages + Logs * dependabot.yml fixed * dependabot.yml fixed * Change Request * Minor change * Tests fixed (cherry picked from commit ddb72c6) * JAVA 11 API * Messages fixed
… be more user friendly (apache#6014) * Improved Error Messages + Logs * dependabot.yml fixed * dependabot.yml fixed * Change Request * Minor change * Tests fixed
…friendly (apache#6014) (apache#66) * [incubator-kie-issues#1150] Improve Import Resolver error messages to be more user friendly (apache#6014) * Improved Error Messages + Logs * dependabot.yml fixed * dependabot.yml fixed * Change Request * Minor change * Tests fixed (cherry picked from commit ddb72c6) * JAVA 11 API * Messages fixed
Closes apache/incubator-kie-issues#1150
As agreed, this PR will improve the Error messages only to be more user-friendly.
That means there are no changes in the logic.