-
Notifications
You must be signed in to change notification settings - Fork 209
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#1473] Introduce Transactional annotation, conditionally deleted #3671
Conversation
…nd annotations with optional removal. Add unit tests. Small refactoring to allow unit testing/ TDD
…1473 # Conflicts: # kogito-codegen-modules/kogito-codegen-processes/src/main/resources/class-templates/RestResourceUserTaskQuarkusTemplate.java # kogito-codegen-modules/kogito-codegen-processes/src/main/resources/class-templates/RestResourceUserTaskSpringTemplate.java
...gen-processes/src/test/java/org/kie/kogito/codegen/process/ProcessResourceGeneratorTest.java
Outdated
Show resolved
Hide resolved
...gen-processes/src/test/java/org/kie/kogito/codegen/process/ProcessResourceGeneratorTest.java
Outdated
Show resolved
Hide resolved
...gen-processes/src/test/java/org/kie/kogito/codegen/process/ProcessResourceGeneratorTest.java
Outdated
Show resolved
Hide resolved
...gen-processes/src/test/java/org/kie/kogito/codegen/process/ProcessResourceGeneratorTest.java
Outdated
Show resolved
Hide resolved
...gen-processes/src/test/java/org/kie/kogito/codegen/process/ProcessResourceGeneratorTest.java
Outdated
Show resolved
Hide resolved
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.
Some minor comments for tests.
Now the annotation is conditionally add during code generation.
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-kogito-runtimes -u #3671 --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-3671/1/display/redirect Test results:
Those are the test failures: org.kie.kogito.quarkus.workflows.AsyncAPIIT.testConsumer1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.CallbackStateTimeoutsIT.callbackStateWithError1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.CallbackStateTimeoutsIT.callbackStateTimeoutsSuccessful1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.CallbackStateWithTimeoutsErrorHandlerIT.callbackStateWithError1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.CompensationRestIT.testErrorRest21 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.CustomRestIT.testCustomFunction1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.EmitEnumRPCGreetIT.testStateIsUnknown1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.EventFlowIT.testNotStartingMultipleEventTimeoutExclusive1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.EventTimedoutIT.testTimedout1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.ExpressionRestIT.testExpressionRest1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.GreetRestIT.testGreetRest1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.GreetRestIT.testGreetHiddenRest1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.GreetRestIT.testGreetUnknownRest1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.HelloWorldIT.testeEmptyBodyHelloWorld1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.MultipleTimerInstancesIT.eventStateTimeouts1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.OpenAPIArrayFlowIT.testArray1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.ParallelStateIT.testAllParallelRest1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.ParallelStateIT.testPartialParallelRest1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.PojoServiceIT.testPojo1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.RPCGreetIT.testDefaultLanguage1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.RetriggerIT.testRetrigger1 expectation failed.Expected status code <200> but was <404>. org.kie.kogito.quarkus.workflows.SwitchStateDataConditionBasedIT.switchStateDataConditionEndApproved1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.SwitchStateDataConditionBasedIT.switchStateDefaultConditionEnd1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.SwitchStateDataConditionBasedIT.switchStateDefaultConditionTransition1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.SwitchStateEventConditionBasedIT.switchStateEventConditionTimeoutsTransition2Approved1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.SwitchStateEventConditionBasedIT.switchStateEventConditionTimeoutsTransitionApproved1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.integrationtests.quarkus.reactive.ProcessSvgAddonIT.testGetSvgProcessInstances1 expectation failed.Response body doesn't match expectation. Expected: Expected namespace uri 'http://www.w3.org/2000/svg' but was 'null' - comparing at /svg[1]/defs[1] to at /svg[1]/defs[1]: Actual: EndStartProcessSecond Line Approval First Line Approval org.kie.kogito.integrationtests.quarkus.ProcessSvgAddonIT.testGetSvgProcessInstances1 expectation failed.Response body doesn't match expectation. Expected: Expected namespace uri 'http://www.w3.org/2000/svg' but was 'null' - comparing at /svg[1]/defs[1] to at /svg[1]/defs[1]: Actual: EndStartProcessSecond Line Approval First Line Approval |
...codegen-processes/src/main/java/org/kie/kogito/codegen/process/ProcessResourceGenerator.java
Outdated
Show resolved
Hide resolved
...codegen-processes/src/main/java/org/kie/kogito/codegen/process/ProcessResourceGenerator.java
Outdated
Show resolved
Hide resolved
.../kogito-codegen-processes/src/main/resources/class-templates/RestResourceSpringTemplate.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-kogito-runtimes -u #3671 --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-3671/2/display/redirect Test results:
Those are the test failures: org.kie.kogito.process.dynamic.DynamicCallResourceTest.testConcurrentDynamicCallsjava.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors[error]: Build step org.kie.kogito.quarkus.common.deployment.KogitoAssetsProcessor#generateModel threw an exception: org.kie.memorycompiler.KieMemoryCompilerException: [org/kie/kogito/serverless/DynamicWaitResource.java (53:39) : cannot find symbol symbol: class Attachment location: package org.kie.kogito.process.workitem, org/kie/kogito/serverless/DynamicWaitResource.java (54:39) : cannot find symbol symbol: class AttachmentInfo location: package org.kie.kogito.process.workitem, org/kie/kogito/serverless/DynamicWaitResource.java (55:39) : cannot find symbol symbol: class Comment location: package org.kie.kogito.process.workitem, org/kie/kogito/serverless/DynamicWaitResource.java (56:39) : cannot find symbol symbol: class Policies location: package org.kie.kogito.process.workitem, org/kie/kogito/serverless/DynamicWaitResource.java (140:30) : cannot find symbol symbol: method getTasks(org.kie.kogito.process.Process,java.lang.String,org.kie.kogito.auth.SecurityPolicy) location: variable processService of type org.kie.kogito.process.ProcessService] at org.kie.memorycompiler.KieMemoryCompiler.compileNoLoad(KieMemoryCompiler.java:140) at org.kie.memorycompiler.KieMemoryCompiler.compileNoLoad(KieMemoryCompiler.java:108) at org.drools.quarkus.util.deployment.DroolsQuarkusResourceUtils.compileGeneratedSources(DroolsQuarkusResourceUtils.java:148) at org.kie.kogito.quarkus.common.deployment.KogitoAssetsProcessor.createGeneratedBeanBuildItemsFromJavaSources(KogitoAssetsProcessor.java:301) at org.kie.kogito.quarkus.common.deployment.KogitoAssetsProcessor.generateModel(KogitoAssetsProcessor.java:188) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849) at io.quarkus.builder.BuildContext.run(BuildContext.java:256) at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538) at java.base/java.lang.Thread.run(Thread.java:840) at org.jboss.threads.JBossThread.run(JBossThread.java:501) org.kie.kogito.svg.service.SpringBootProcessSvgServiceTest.annotateExecutedPathTestExpecting value to be false but was true |
…ntextBuilders for rest-specific tests. Enforced exclusion of "Java" context from processes' rest generation.
…oot-starter to be always available for springboot projects
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-kogito-runtimes -u #3671 --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-3671/5/display/redirect Test results:
Those are the test failures: org.kie.kogito.quarkus.workflows.AsyncAPIIT.testConsumer1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.AsyncAPIIT.testPublisher1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.CallbackStateWithTimeoutsErrorHandlerIT.callbackStateWithError1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.CompensationRestIT.testErrorRest21 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.CompensationRestIT.testErrorRest31 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.ConversationFlowIT.sanityVerification1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.EmitEnumRPCGreetIT.testStateIsUnknown1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.ErrorRestIT.testErrorRepeatedRest1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.ErrorRestIT.testErrorGenericRest1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.EventFlowIT.testNotStartingMultipleEventExclusive21 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.ForEachRestIT.testForEachWorkItem(String)[2]1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.GreetRestIT.testGreetRest1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.GreetRestIT.testGreetUnknownRest1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.HelloWorldIT.testeEmptyBodyHelloWorld1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.MultipleTimerInstancesIT.eventStateTimeouts1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.OpenAPIEnumParameterIT.test1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.PojoServiceIT.testPojo1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.RPCGreetIT.testEnglish1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.RetriggerIT.testRetrigger1 expectation failed.Expected status code <200> but was <404>. org.kie.kogito.quarkus.workflows.SwitchStateDataConditionBasedIT.switchStateDataConditionEndApproved1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.SwitchStateDataConditionBasedIT.switchStateDataConditionTransitionDenied1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.SwitchStateEventConditionBasedIT.switchStateEventConditionTimeoutsEndTApproved1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.quarkus.workflows.SwitchStateEventConditionBasedIT.switchStateEventConditionTimeoutsTransition2Approvedexpected: "process_result_event_transition2" but was: "process_result_event_condition_end" org.kie.kogito.quarkus.workflows.SwitchStateEventConditionBasedIT.switchStateEventConditionTimeoutsTransitionApproved1 expectation failed.Expected status code <201> but was <500>. org.kie.kogito.integrationtests.quarkus.reactive.ProcessSvgAddonIT.testGetSvgProcessInstances1 expectation failed.Response body doesn't match expectation. Expected: Expected namespace uri 'http://www.w3.org/2000/svg' but was 'null' - comparing at /svg[1]/defs[1] to at /svg[1]/defs[1]: Actual: EndStartProcessSecond Line Approval First Line Approval org.kie.kogito.integrationtests.quarkus.ProcessSvgAddonIT.testGetSvgProcessInstances1 expectation failed.Response body doesn't match expectation. Expected: Expected namespace uri 'http://www.w3.org/2000/svg' but was 'null' - comparing at /svg[1]/defs[1] to at /svg[1]/defs[1]: Actual: EndStartProcessSecond Line Approval First Line Approval org.kie.kogito.svg.service.SpringBootProcessSvgServiceTest.annotateExecutedPathTestExpecting value to be false but was true org.kie.kogito.integrationtests.springboot.ProcessSvgAddonTest.testGetSvgProcessInstances1 expectation failed.Response body doesn't match expectation. Expected: Expected namespace uri 'http://www.w3.org/2000/svg' but was 'null' - comparing at /svg[1]/defs[1] to at /svg[1]/defs[1]: Actual: EndStartProcessSecond Line Approval First Line Approval |
Failures:
Unrelated (already present here) |
…gito-quarkus-workflow-common to be always available for quarkus projects
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-kogito-runtimes -u #3671 --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-3671/6/display/redirect Test results:
Those are the test failures: org.kie.kogito.svg.service.SpringBootProcessSvgServiceTest.annotateExecutedPathTestExpecting value to be false but was true org.kie.kogito.integrationtests.springboot.ProcessSvgAddonTest.testGetSvgProcessInstances1 expectation failed.Response body doesn't match expectation. Expected: Expected namespace uri 'http://www.w3.org/2000/svg' but was 'null' - comparing at /svg[1]/defs[1] to at /svg[1]/defs[1]: Actual: EndStartProcessSecond Line Approval First Line Approval |
…d serverless transaction. Disable transaction workaround.
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-kogito-runtimes -u #3671 --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-3671/15/display/redirect Test results:
Those are the test failures: org.kie.kogito.process.dynamic.DynamicCallResourceTest.testConcurrentDynamicCallsio.quarkus.bootstrap.BootstrapException: Failed to create the application model for org.kie:kie-addons-quarkus-process-dynamic-integration-tests::jar:999-SNAPSHOTnull |
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-kogito-runtimes -u #3671 --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-3671/16/display/redirect Test results:
Those are the test failures: org.kie.kogito.codegen.process.ProcessResourceGeneratorTest.testManageTransactionalEnabled(Builder)[1]Expected size: 9 but was: 2 in: [ProcessInstance<$Type$> pi = processService.createProcessInstance(process, businessKey, Optional.ofNullable(resource).orElse(new $Type$Input()).toModel(), httpHeaders.getRequestHeaders(), httpHeaders.getHeaderString("X-KOGITO-StartFromNode"));, return Response.created(uriInfo.getAbsolutePathBuilder().path(pi.id()).build()).entity(pi.checkError().variables().toModel()).build();] |
return new ProcessCodegen(context, processes); | ||
} | ||
|
||
protected static GeneratedInfo<KogitoWorkflowProcess> parseWorkflowFile(Resource r, KogitoBuildContext context) { | ||
InternalResource resource = (InternalResource) r; | ||
try (Reader reader = resource.getReader()) { | ||
ServerlessWorkflowParser parser = ServerlessWorkflowParser.of(reader, WorkflowFormat.fromFileName(resource.getSourcePath()), context); | ||
ServerlessWorkflowParser parser = ServerlessWorkflowParser.of(reader, |
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.
hmmm, the formatter is changing this, curious ;), someone knows why?
|
||
rgs.add(processResourceGenerator); | ||
//Creating and adding the ResourceGenerator for REST generation | ||
if (!context().name().equals("Java")) { |
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.
hmmmm, this smells fishy (something a former boss used to say in reviews ;)), what was failing when the context is set to Java?
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.
@fjtirado I've been told that for "java" projects (i.e. not Quarkus nor Springboot) rest endpoints should not be generated.
@elguardian could you please confirm ?
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.
I think @gitgabrio is right, REST endpoints aren't generated for Java
. There's not even a RestResourceJavaTemplate
.
I think that this if
is right, because otherwise there would be an exception thrown because of the missing template.
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.
there is a call in the context to check this already called if globably available. That should work. it search for rest classes in the classpath
execModelGen.className(), | ||
applicationCanonicalName(), | ||
trigger)); | ||
megs.computeIfAbsent(new ProcessCloudEventMeta(workFlowProcess.getId(), trigger), |
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.
same, the format changes are making difficult to review the PR
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.
There are lot of format changes that I do not think should be there, can we check why many lines were split?
It seems a picky comment, but, for example, the only logic change in ProcessCodeGen file is the check of context to Java to avoid the rest generation, which looks a bit hacky and is somehow hidden by a lot of format changes.
I actually believe ProcessCodeGen file should not be modified by this PR.
Besides that, since the annotation generation is configurable, I feel the transaction module should be configurable too (and not added always, regardless the property value). Maybe this should have been designed as an addon.
* running before and the mapped ports are ready before running any test. | ||
* This avoids connection issues with the container when using container managers that do the port mapping after the container has started. | ||
*/ | ||
this.waitStrategy = new WaitAllStrategy() |
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.
This change is unrelated, isnt it?
Good fix anyway.
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.
That's a good addition for developers not using Docker Desktop :D
@@ -45,6 +45,10 @@ | |||
<groupId>org.jbpm</groupId> | |||
<artifactId>jbpm-quarkus</artifactId> | |||
</dependency> | |||
<dependency> |
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.
hmmm,
should not be this dependency optional according to the PR description?
I mean, if transaction annotation generation is disabled, the dependency should not be there
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.
The transaction is enabled by default.
If a user want to disable it, it need to
- declare the
kogito.processes.transactionEnabled=false
- manually exclude unwanted dependencies.
…1473 # Conflicts: # kogito-test-utils/src/main/java/org/kie/kogito/testcontainers/KogitoPostgreSqlContainer.java
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-kogito-runtimes -u #3671 --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-3671/17/display/redirect Test results:
Those are the test failures: org.kie.kogito.codegen.process.ProcessResourceGeneratorTest.testManageTransactionalEnabled(Builder)[1]Expected size: 9 but was: 2 in: [ProcessInstance<$Type$> pi = processService.createProcessInstance(process, businessKey, Optional.ofNullable(resource).orElse(new $Type$Input()).toModel(), httpHeaders.getRequestHeaders(), httpHeaders.getHeaderString("X-KOGITO-StartFromNode"));, return Response.created(uriInfo.getAbsolutePathBuilder().path(pi.id()).build()).entity(pi.checkError().variables().toModel()).build();] |
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-kogito-runtimes -u #3671 --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-3671/18/display/redirect Test results:
Those are the test failures: org.kie.kogito.process.dynamic.DynamicCallResourceTest.testConcurrentDynamicCallsio.quarkus.bootstrap.BootstrapException: Failed to create the application model for org.kie:kie-addons-quarkus-process-dynamic-integration-tests::jar:999-SNAPSHOTnull |
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-kogito-runtimes -u #3671 --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-3671/19/display/redirect Test results:
Those are the test failures: org.kie.kogito.process.dynamic.DynamicCallResourceTest.testConcurrentDynamicCallsio.quarkus.bootstrap.BootstrapException: Failed to create the application model for org.kie:kie-addons-quarkus-process-dynamic-integration-tests::jar:999-SNAPSHOTnull |
org.kie.kogito.process.dynamic.DynamicCallResourceTest.testConcurrentDynamicCalls failure unrelated. |
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.
great job @gitgabrio. Just left a comment regarding the Java context check, but thast's just nip picking.
Thank you!
@@ -468,7 +472,7 @@ protected Collection<GeneratedFile> internalGenerate() { | |||
svgs.keySet().stream().forEach(key -> storeFile(GeneratedFileType.INTERNAL_RESOURCE, "META-INF/processSVG/" + key + ".svg", svgs.get(key))); | |||
} | |||
|
|||
if (context().hasRESTForGenerator(this)) { | |||
if (!context().name().equals("Java") && context().hasRESTForGenerator(this)) { |
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.
being picky, since we are repeating this check, maybe we could have it in a single place, but that's ok.
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.
I'm not 100% sure to follow.
The !context().name().equals("Java")
check is done at line 357 and 475, but those refers to different things.
I kept the original structure, and the conditional execution based on context().hasRESTForGenerator(this)
was already there.
If I remove the context().name().equals("Java")
check at line 475, those REST_ENDPOINT would be generated also for Java: does this make sense ? Am I missing something ?
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.
sorry if I wasn't clear @gitgabrio I was refering to the context().name().equals("Java")
, maybe we could have a single isJavaContext()
method wrapping this, but this is just nip picking
* | ||
*/ | ||
protected void manageTransactional(CompilationUnit compilationUnit) { | ||
if (transactionEnabled && context.hasDI() && !process.getType().equals("SW")) { // disabling transaction for serverless |
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.
I'd prefer having the "SW" check added in a different manner, but I think that's the only way to discriminate if we have to add Transactional annotations if sw and bpm coexist in the same project. +1
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.
SW is a constant provided already in the class path
Line 31 in b096bf2
String SW_TYPE = "SW"; |
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.
@pefernan @elguardian
I found that "by chance", during debugging, and I'm not extremely happy of that, too.
Following your comments, I refactored it a bit, but the logic is the same.
Let me know if there is a different/better way, I would be happy to implement it.
….hasRest() instead of name.equals("Java") to check for rest endpoint creation. Implemented MockQuarkusKogitoBuildContext and MockSpringBootKogitoBuildContext to override the hasRest method during tests.
@elguardian @pefernan @fjtirado |
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-kogito-runtimes -u #3671 --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-3671/20/display/redirect Test results:
Those are the test failures: org.kie.kogito.process.dynamic.DynamicCallResourceTest.testConcurrentDynamicCallsio.quarkus.bootstrap.BootstrapException: Failed to create the application model for org.kie:kie-addons-quarkus-process-dynamic-integration-tests::jar:999-SNAPSHOTnull |
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-kogito-runtimes -u #3671 --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-3671/21/display/redirect Test results:
Those are the test failures: |
failures unrelated to the PR. |
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.
LGTM
…tionally deleted (apache#3671) * [incubator-kie-issues#1473] WIP - Implemented transactional imports and annotations with optional removal. Add unit tests. Small refactoring to allow unit testing/ TDD * [incubator-kie-issues#1473] Simplified following suggestions. Now the annotation is conditionally add during code generation. * [incubator-kie-issues#1473] Implemented KogitoContextTestUtils#restContextBuilders for rest-specific tests. Enforced exclusion of "Java" context from processes' rest generation. * [incubator-kie-issues#1473] Set log level to debug inside manageTransactional * [incubator-kie-issues#1473] Add spring-tx dependency to jbpm-spring-boot-starter to be always available for springboot projects * [incubator-kie-issues#1473] Add quarkus-narayana-jta dependency to kogito-quarkus-workflow-common to be always available for quarkus projects * [incubator-kie-issues#1473] Add quarkus-narayana-jta-deployment dependency * [incubator-kie-issues#1473] Introduce nasty workaround (delay) to avoid ARJUNA issues with nested threads * [incubator-kie-issues#1473] Disabling transaction for sonataflow-quarkus-integration-test * [incubator-kie-issues#1473] Conditionally add the thread sleep. Fix kogito.processes.transactionEnabled variable * [incubator-kie-issues#1473] Importing new wait strategy. * [incubator-kie-issues#1473] WIP - Experimenting Thread.join inside transaction (instead of Thread.sleep) * [incubator-kie-issues#1473] WIP - fix formatting * [incubator-kie-issues#1473] WIP - commented out conditionally excluded serverless transaction. Disable transaction workaround. * [incubator-kie-issues#1473] WIP - commented out conditionally excluded serverless transaction. Disable transaction workaround. * [incubator-kie-issues#1473] Disabling transaction for serverless * [incubator-kie-issues#1473] Fix formatting * [incubator-kie-issues#1473] Fix test * [incubator-kie-issues#1473] Fixed as per PR suggestion. Using context.hasRest() instead of name.equals("Java") to check for rest endpoint creation. Implemented MockQuarkusKogitoBuildContext and MockSpringBootKogitoBuildContext to override the hasRest method during tests. --------- Co-authored-by: Gabriele-Cardosi <[email protected]>
Fixes apache/incubator-kie-issues#1473
Depends on
apache/incubator-kie-drools#6090
This PR:
kogito.processes.transactionEnabled
) to conditionally enable transaction (default is true= enabled)How to replicate CI configuration locally?
Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use build-chain tool to handle cross repository builds and be sure that we always use latest version of the code for each repository.
build-chain tool is a build tool which can be used on command line locally or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See local execution details to get more information about it.