You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "bncriju (via GitHub)" <gi...@apache.org> on 2025/02/20 14:52:54 UTC

[PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

bncriju opened a new pull request, #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261

   Fixes https://github.com/apache/incubator-kie-issues/issues/1752
   
   Added the fix for this problema and added test class and test methods to verify the same


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

Posted by "kie-ci3 (via GitHub)" <gi...@apache.org>.
kie-ci3 commented on PR #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261#issuecomment-2697951879

   
   **PR job** `#12` was: **UNSTABLE**
   Possible explanation: This should be test failures
   
   
   <details>
   <summary><b>Reproducer</b></summary>
   
   
   
   build-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 https://github.com/apache/incubator-kie-drools/pull/6261 --skipParallelCheckout
   
   NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution
   
   </details>
   
   
   Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/12/display/redirect
   
   **Test results:**
   - PASSED: 23238
   - FAILED: 3
   
   Those are the test failures: 
   <details>
   <summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/12/testReport/org.kie.dmn.feel.lang.types/GenFnTypeTest/testIsInstanceOfWithNoParameters/">org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsInstanceOfWithNoParameters</a></summary>
   <br/>Expecting value to be true but was false
   </details>
   <details>
   <summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/12/testReport/org.kie.dmn.feel.lang.types/GenFnTypeTest/testIsAssignableValueWithFunction/">org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsAssignableValueWithFunction</a></summary>
   <br/>Expecting value to be true but was false
   </details>
   <details>
   <summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/12/testReport/org.kie.dmn.feel.lang.types/GenFnTypeTest/testIsInstanceOfWithMatchingFunctionSignature/">org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsInstanceOfWithMatchingFunctionSignature</a></summary>
   <br/>Expecting value to be true but was false
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

Posted by "gitgabrio (via GitHub)" <gi...@apache.org>.
gitgabrio merged PR #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

Posted by "bncriju (via GitHub)" <gi...@apache.org>.
bncriju commented on code in PR #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261#discussion_r1967227961


##########
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/lang/types/GenFnTypeTest.java:
##########
@@ -0,0 +1,208 @@
+package org.kie.dmn.feel.lang.types;

Review Comment:
   Thanks @yesamer. Will add it now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261#discussion_r1967617331


##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/types/GenFnType.java:
##########
@@ -69,13 +67,22 @@ public String getName() {
 
     @Override
     public boolean conformsTo(Type t) {
-        if (t instanceof GenFnType) {
-            GenFnType fnT = (GenFnType) t;
+        if (t instanceof GenFnType fnT) {
             return fnT.argsGen.size() == this.argsGen.size() &&
-                   IntStream.range(0, argsGen.size()).allMatch(i -> fnT.argsGen.get(i).conformsTo(this.argsGen.get(i))) &&
-                   this.returnGen.conformsTo(fnT.returnGen);
+                    IntStream.range(0, argsGen.size()).allMatch(i -> fnT.argsGen.get(i).conformsTo(this.argsGen.get(i))) &&
+                    this.returnGen.conformsTo(fnT.returnGen);
         } else {

Review Comment:
   @bncriju Please remove those  2 whitespaces



##########
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/lang/types/GenFnTypeTest.java:
##########
@@ -0,0 +1,228 @@
+/*
+ *

Review Comment:
   @bncriju Please remove line 2



##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/types/GenFnType.java:
##########
@@ -1,4 +1,5 @@
-/**
+/*
+ *

Review Comment:
   @bncriju Please remove line 2



##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/types/GenFnType.java:
##########
@@ -40,18 +41,15 @@ public GenFnType(List<Type> argsGen, Type returnGen) {
 
     @Override
     public boolean isInstanceOf(Object o) {
-        if (o instanceof FEELFunction) {
-            FEELFunction oFn = (FEELFunction) o;
-            List<List<Param>> signatures = oFn.getParameters().stream().filter(signature -> signature.size() == argsGen.size()).collect(Collectors.toList());
-            for (List<Param> signature : signatures) {
-                if (signature.size() == argsGen.size() && IntStream.range(0, argsGen.size()).allMatch(i -> argsGen.get(i).conformsTo(signature.get(i).type))) {
-                    return true;
-                }
+        if (o instanceof FEELFunction oFn) {
+            List<List<Param>> parameters = oFn.getParameters();
+            if(parameters.isEmpty()){

Review Comment:
   ```suggestion
               if (parameters.isEmpty()) {
   ```
   Please use the same formatting style of the code base



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

Posted by "bncriju (via GitHub)" <gi...@apache.org>.
bncriju commented on PR #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261#issuecomment-2706698381

   Checked the build failures and found that this required changes in kogito runtimes repo. https://github.com/apache/incubator-kie-kogito-runtimes/pull/3860 raised


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

Posted by "bncriju (via GitHub)" <gi...@apache.org>.
bncriju commented on code in PR #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261#discussion_r1967230523


##########
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/lang/types/GenFnTypeTest.java:
##########
@@ -0,0 +1,208 @@
+package org.kie.dmn.feel.lang.types;

Review Comment:
   Done adding the same.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

Posted by "kie-ci3 (via GitHub)" <gi...@apache.org>.
kie-ci3 commented on PR #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261#issuecomment-2695569864

   
   **PR job** `#11` was: **UNSTABLE**
   Possible explanation: This should be test failures
   
   
   <details>
   <summary><b>Reproducer</b></summary>
   
   
   
   build-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 https://github.com/apache/incubator-kie-drools/pull/6261 --skipParallelCheckout
   
   NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution
   
   </details>
   
   
   Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/11/display/redirect
   
   **Test results:**
   - PASSED: 22368
   - FAILED: 3
   
   Those are the test failures: 
   <details>
   <summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/11/testReport/org.kie.dmn.feel.lang.types/GenFnTypeTest/testIsInstanceOfWithNoParameters/">org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsInstanceOfWithNoParameters</a></summary>
   <br/>Expecting value to be true but was false
   </details>
   <details>
   <summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/11/testReport/org.kie.dmn.feel.lang.types/GenFnTypeTest/testIsAssignableValueWithFunction/">org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsAssignableValueWithFunction</a></summary>
   <br/>Expecting value to be true but was false
   </details>
   <details>
   <summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/11/testReport/org.kie.dmn.feel.lang.types/GenFnTypeTest/testIsInstanceOfWithMatchingFunctionSignature/">org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsInstanceOfWithMatchingFunctionSignature</a></summary>
   <br/>Expecting value to be true but was false
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

Posted by "kie-ci3 (via GitHub)" <gi...@apache.org>.
kie-ci3 commented on PR #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261#issuecomment-2704140511

   
   **PR job** `#17` was: **UNSTABLE**
   Possible explanation: This should be test failures
   
   
   <details>
   <summary><b>Reproducer</b></summary>
   
   
   
   build-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 https://github.com/apache/incubator-kie-drools/pull/6261 --skipParallelCheckout
   
   NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution
   
   </details>
   
   
   Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/17/display/redirect
   
   **Test results:**
   - PASSED: 23245
   - FAILED: 1
   
   Those are the test failures: 
   <details>
   <summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/17/testReport/org.kie.dmn.feel.runtime.functions/BaseFEELFunctionTest/testIsCompatibleTrue/">org.kie.dmn.feel.runtime.functions.BaseFEELFunctionTest.testIsCompatibleTrue</a></summary>
   <br/>Expecting value to be true but was false
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on PR #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261#issuecomment-2706219910

   @bncriju Can you please check why the builds are failing?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261#discussion_r1967225702


##########
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/lang/types/GenFnTypeTest.java:
##########
@@ -0,0 +1,208 @@
+package org.kie.dmn.feel.lang.types;

Review Comment:
   @bncriju Please add the Apache header in this new class



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

Posted by "gitgabrio (via GitHub)" <gi...@apache.org>.
gitgabrio commented on code in PR #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261#discussion_r1969225021


##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/types/GenFnType.java:
##########
@@ -40,18 +41,15 @@ public GenFnType(List<Type> argsGen, Type returnGen) {
 
     @Override
     public boolean isInstanceOf(Object o) {
-        if (o instanceof FEELFunction) {
-            FEELFunction oFn = (FEELFunction) o;
-            List<List<Param>> signatures = oFn.getParameters().stream().filter(signature -> signature.size() == argsGen.size()).collect(Collectors.toList());
-            for (List<Param> signature : signatures) {
-                if (signature.size() == argsGen.size() && IntStream.range(0, argsGen.size()).allMatch(i -> argsGen.get(i).conformsTo(signature.get(i).type))) {
-                    return true;
-                }
+        if (o instanceof FEELFunction oFn) {
+            List<List<Param>> parameters = oFn.getParameters();
+            if(parameters.isEmpty()){
+                //this is used to consider function as parameter
+                return true;

Review Comment:
   HI @bncriju 
   on second thought, I think we need to implement more check here, i.e. if the expected input/output of the current GenFnType are compatible with invoke methods of the provided function



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-issues-1752] TCK failure-Lambda function returns null [incubator-kie-drools]

Posted by "kie-ci3 (via GitHub)" <gi...@apache.org>.
kie-ci3 commented on PR #6261:
URL: https://github.com/apache/incubator-kie-drools/pull/6261#issuecomment-2688701172

   
   **PR job** `#8` was: **UNSTABLE**
   Possible explanation: This should be test failures
   
   
   <details>
   <summary><b>Reproducer</b></summary>
   
   
   
   build-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 https://github.com/apache/incubator-kie-drools/pull/6261 --skipParallelCheckout
   
   NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution
   
   </details>
   
   
   Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/8/display/redirect
   
   **Test results:**
   - PASSED: 23224
   - FAILED: 4
   
   Those are the test failures: 
   <details>
   <summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/8/testReport/org.kie.dmn.feel.lang.types/GenFnTypeTest/testIsInstanceOfWithNoParameters/">org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsInstanceOfWithNoParameters</a></summary>
   <br/>Expecting value to be true but was false
   </details>
   <details>
   <summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/8/testReport/org.kie.dmn.feel.lang.types/GenFnTypeTest/testIsAssignableValueWithFunction/">org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsAssignableValueWithFunction</a></summary>
   <br/>Expecting value to be true but was false
   </details>
   <details>
   <summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/8/testReport/org.kie.dmn.feel.lang.types/GenFnTypeTest/testIsInstanceOfWithMatchingFunctionSignature/">org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsInstanceOfWithMatchingFunctionSignature</a></summary>
   <br/>Expecting value to be true but was false
   </details>
   <details>
   <summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6261/8/testReport/org.kie.dmn.feel.runtime.functions/BaseFEELFunctionTest/testIsCompatible/">org.kie.dmn.feel.runtime.functions.BaseFEELFunctionTest.testIsCompatible</a></summary>
   <br/>Expecting value to be true but was false
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org