Re: [PR] [Fix #4138] Protocol is not supported in function metadata [incubator-kie-kogito-runtimes]
kie-ci3 commented on PR #4139:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139#issuecomment-3643392476
**PR job** `#7` was: **UNSTABLE**
Possible explanation: This should be test failures
Reproducer
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-kogito-runtimes -u
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139
--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/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4139/7/display/redirect
**Test results:**
- PASSED: 3641
- FAILED: 21
Those are the test failures:
https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4139/7/testReport/org.kie.kogito.mongodb/KogitoProcessInstancesFactoryIT/___/";>org.kie.kogito.mongodb.KogitoProcessInstancesFactoryIT.(?)
Container startup failed for image mirror.gcr.io/library/mongo:5.0.31
https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4139/7/testReport/org.kie.kogito.mongodb/MongoDBProcessInstancesIT/___/";>org.kie.kogito.mongodb.MongoDBProcessInstancesIT.(?)
Container startup failed for image mirror.gcr.io/library/mongo:5.0.31
https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4139/7/testReport/org.kie.kogito.mongodb/PersistentProcessInstancesIT/___/";>org.kie.kogito.mongodb.PersistentProcessInstancesIT.(?)
Container startup failed for image mirror.gcr.io/library/mongo:5.0.31
https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4139/7/testReport/org.kie.kogito.mongodb/PersistentProcessInstancesWithLockIT/___/";>org.kie.kogito.mongodb.PersistentProcessInstancesWithLockIT.(?)
Container startup failed for image mirror.gcr.io/library/mongo:5.0.31
https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4139/7/testReport/org.kie.kogito.mongodb.correlation/MongoDBCorrelationServiceIT/___/";>org.kie.kogito.mongodb.correlation.MongoDBCorrelationServiceIT.(?)
Container startup failed for image mirror.gcr.io/library/mongo:5.0.31
https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4139/7/testReport/org.kie.kogito.mongodb.transaction/AbstractTransactionManagerIT/___/";>org.kie.kogito.mongodb.transaction.AbstractTransactionManagerIT.(?)
Container startup failed for image mirror.gcr.io/library/mongo:5.0.31
https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4139/7/testReport/org.kie.kogito.it/MongoDBOptimisticLockingIT/PR_check___Build_projects___testPersistence/";>PR
check / Build projects /
org.kie.kogito.it.MongoDBOptimisticLockingIT.testPersistence
java.util.concurrent.CompletionException: java.lang.RuntimeException: Unable
to start Quarkus test resource class
org.kie.kogito.testcontainers.quarkus.MongoDBQuarkusTestResource
https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4139/7/testReport/org.kie.kogito.it/MongoDBOptimisticLockingIT/PR_check___Build_projects___testPersistence/";>PR
check / Build projects /
org.kie.kogito.it.MongoDBOptimisticLockingIT.testPersistence
Failed to load ApplicationContext for
[WebMergedContextConfiguration@18d47df0 testClass =
org.kie.kogito.it.MongoDBOptimisticLockingIT, locations = [], classes =
[org.kie.kogito.it.KogitoSpringbootApplication], contextInitializerClasses =
[org.kie.kogito.testcontainers.springboot.MongoDBSpringBootTestResource],
activeProfiles = [], propertySourceDescriptors = [], propertySourceProperties =
["kogito.persistence.optimistic.lock=true",
"org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true",
"server.port=0"], contextCustomizers =
[org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@1e4d3ce5,
org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@1e81f160,
org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0,
org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@2a3888c1,
org.springframework.boot.test.web.reactor.netty.DisableReactorResource
FactoryGlobalResourcesContextCustomizerFactory$DisableReactorResourceFactoryGlobalResourcesContextCustomizerCustomizer@125290e5,
org.springframework.boot.test.autoconfigu
Re: [PR] [Fix #4138] Protocol is not supported in function metadata [incubator-kie-kogito-runtimes]
fjtirado merged PR #4139: URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] [Fix #4138] Protocol is not supported in function metadata [incubator-kie-kogito-runtimes]
fjtirado commented on PR #4139: URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139#issuecomment-3641998482 Here is the doc PR https://github.com/apache/incubator-kie-kogito-docs/pull/742 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] [Fix #4138] Protocol is not supported in function metadata [incubator-kie-kogito-runtimes]
fjtirado commented on PR #4139:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139#issuecomment-3641906175
> LGTM, great work.
>
> @fjtirado So the algorithm is like this: if the function is defined like
this:
>
> ```
> "functions": [
> {
> "name": "multiplyAllByAndSum",
> "type": "custom",
> "operation": "rest:post:https://myservice/my-paty
> }
> ```
>
> Then, the `https://myservice/my-paty`is used as is. i.e., wins over a
potential protocol and port configured parameters.
>
> Otherwise, the `quarkus.ws.fuctions.multiplyAllByAndSum` parameters are
used. Including the new added "protocol" paramter.
>
> **Please document it somewere here:**
https://sonataflow.org/serverlessworkflow/main/core/custom-functions-support.html#con-func-rest,
otherwise, unless doing the code reading it's imposible for users to know how
this work, and next time, theyll fall into the same issue.
@wmedvede For the documentation part, in my opinion, the only missing thing
is the new protocol property. If you feel the writing should be improved,
please feel free to do so (I already tried my best and I believe that, "when
using relative paths" already hinted that when using absolute path the function
was ignored)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [Fix #4138] Protocol is not supported in function metadata [incubator-kie-kogito-runtimes]
kie-ci3 commented on PR #4139:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139#issuecomment-3603188494
**PR job** `#6` was: **UNSTABLE**
Possible explanation: This should be test failures
Reproducer
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-kogito-runtimes -u
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139
--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/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4139/6/display/redirect
**Test results:**
- PASSED: 3691
- FAILED: 1
Those are the test failures:
https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4139/6/testReport/org.kie.kogito.integrationtests.quarkus/TaskIT/testUpdateTaskInfo/";>org.kie.kogito.integrationtests.quarkus.TaskIT.testUpdateTaskInfo
1 expectation failed.Expected status code <403> but was <200>.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [Fix #4138] Protocol is not supported in function metadata [incubator-kie-kogito-runtimes]
fjtirado commented on code in PR #4139:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139#discussion_r2581406553
##
kogito-workitems/kogito-rest-workitem/src/main/java/org/kogito/workitem/rest/RestWorkItemHandler.java:
##
@@ -162,28 +164,24 @@ public Optional
activateWorkItemHandler(KogitoWorkItemManage
} catch (MalformedURLException ex) {
logger.debug("Parameter endpoint {} is not valid uri {}",
endPoint, ex.getMessage());
}
-
if (isEmpty(protocol)) {
-protocol = getParam(parameters, PROTOCOL, String.class, "http");
-logger.debug("Protocol not specified, using {}", protocol);
+protocol = getParam(parameters, PROTOCOL);
}
-
-boolean isSsl = protocol.equalsIgnoreCase("https");
-
if (isEmpty(host)) {
host = getParam(parameters, HOST, String.class, "localhost");
-logger.debug("Host not specified, using {}", host);
}
if (port == -1) {
-port = getParam(parameters, PORT, Integer.class, isSsl ?
DEFAULT_SSL_PORT : DEFAULT_PORT);
-logger.debug("Port not specified, using {}", port);
+port = getParam(parameters, PORT, Integer.class, isHttps(protocol)
? DEFAULT_SSL_PORT : DEFAULT_PORT);
}
if (isEmpty(path)) {
path = endPoint;
logger.debug("Path is empty, using whole endpoint {}", endPoint);
}
+if (isEmpty(protocol)) {
+protocol = port == DEFAULT_SSL_PORT ? HTTPS_PROTOCOL :
HTTP_PROTOCOL;
Review Comment:
This infers the protocol (if not specified) from the specified port.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [Fix #4138] Protocol is not supported in function metadata [incubator-kie-kogito-runtimes]
fjtirado commented on code in PR #4139:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139#discussion_r2581407668
##
kogito-workitems/kogito-rest-workitem/src/main/java/org/kogito/workitem/rest/RestWorkItemHandler.java:
##
@@ -162,28 +164,24 @@ public Optional
activateWorkItemHandler(KogitoWorkItemManage
} catch (MalformedURLException ex) {
logger.debug("Parameter endpoint {} is not valid uri {}",
endPoint, ex.getMessage());
}
-
if (isEmpty(protocol)) {
-protocol = getParam(parameters, PROTOCOL, String.class, "http");
-logger.debug("Protocol not specified, using {}", protocol);
+protocol = getParam(parameters, PROTOCOL);
Review Comment:
Do not set the protocol to default yet
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [Fix #4138] Protocol is not supported in function metadata [incubator-kie-kogito-runtimes]
fjtirado commented on code in PR #4139:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139#discussion_r2581396384
##
kogito-workitems/kogito-rest-workitem/src/main/java/org/kogito/workitem/rest/RestWorkItemHandler.java:
##
@@ -162,28 +164,24 @@ public Optional
activateWorkItemHandler(KogitoWorkItemManage
} catch (MalformedURLException ex) {
logger.debug("Parameter endpoint {} is not valid uri {}",
endPoint, ex.getMessage());
}
-
if (isEmpty(protocol)) {
-protocol = getParam(parameters, PROTOCOL, String.class, "http");
-logger.debug("Protocol not specified, using {}", protocol);
+protocol = getParam(parameters, PROTOCOL);
}
-
-boolean isSsl = protocol.equalsIgnoreCase("https");
-
if (isEmpty(host)) {
host = getParam(parameters, HOST, String.class, "localhost");
-logger.debug("Host not specified, using {}", host);
Review Comment:
I moved these traces, which were kind of confusing to
RestWorkItemHandlerUtils
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [Fix #4138] Protocol is not supported in function metadata [incubator-kie-kogito-runtimes]
fjtirado commented on code in PR #4139:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139#discussion_r2581396384
##
kogito-workitems/kogito-rest-workitem/src/main/java/org/kogito/workitem/rest/RestWorkItemHandler.java:
##
@@ -162,28 +164,24 @@ public Optional
activateWorkItemHandler(KogitoWorkItemManage
} catch (MalformedURLException ex) {
logger.debug("Parameter endpoint {} is not valid uri {}",
endPoint, ex.getMessage());
}
-
if (isEmpty(protocol)) {
-protocol = getParam(parameters, PROTOCOL, String.class, "http");
-logger.debug("Protocol not specified, using {}", protocol);
+protocol = getParam(parameters, PROTOCOL);
}
-
-boolean isSsl = protocol.equalsIgnoreCase("https");
-
if (isEmpty(host)) {
host = getParam(parameters, HOST, String.class, "localhost");
-logger.debug("Host not specified, using {}", host);
Review Comment:
I moved this traces, which were kind of confusing to RestWorkItemHandlerUtils
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [Fix #4138] Protocol is not supported in function metadata [incubator-kie-kogito-runtimes]
fjtirado commented on code in PR #4139:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139#discussion_r2581394118
##
api/kogito-api/src/main/java/org/kie/kogito/internal/utils/ConversionUtils.java:
##
@@ -228,7 +228,7 @@ public static String concatPaths(String onePath, String
anotherPath, String conc
* @return
*/
public static boolean isEmpty(String value) {
-return Objects.isNull(value) || value.isBlank();
+return value == null || value.isBlank();
Review Comment:
Not needed, but overkill that I needed to fix ;)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] [Fix #4138] Protocol is not supported in function metadata [incubator-kie-kogito-runtimes]
fjtirado commented on PR #4139: URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139#issuecomment-3602256721 @gmunozfe It will be nice to setup an integration test that uses SSL (currently it does not exist), can you do that in a separate PR please? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] [Fix #4138] Protocol is not supported in function metadata [incubator-kie-kogito-runtimes]
fjtirado commented on code in PR #4139:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139#discussion_r2581328756
##
kogito-serverless-workflow/kogito-serverless-workflow-rest-parser/src/main/java/org/kie/kogito/serverless/workflow/parser/types/RestTypeHandler.java:
##
@@ -66,6 +66,7 @@ public class RestTypeHandler extends WorkItemTypeHandler {
.workParameter(RestWorkItemHandler.METHOD, method)
.workParameter(RestWorkItemHandler.USER,
runtimeRestApi(functionDef, USER_PROP, context.getContext()))
.workParameter(RestWorkItemHandler.PASSWORD,
runtimeRestApi(functionDef, PASSWORD_PROP, context.getContext()))
+.workParameter(RestWorkItemHandler.PROTOCOL,
runtimeRestApi(functionDef, "protocol", context.getContext()))
Review Comment:
This is the change that was needed to support protocol property.
The rest of changes were intended to infer the protocol from port 443 if
this port is explicitly set but not protocol is set
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
