This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
fix: check workflow exists when executing #335
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
masayag
reviewed
May 11, 2023
...vice/src/main/java/com/redhat/parodos/workflow/execution/aspect/WorkFlowExecutionAspect.java
Outdated
Show resolved
Hide resolved
masayag
reviewed
May 20, 2023
...vice/src/main/java/com/redhat/parodos/workflow/execution/aspect/WorkFlowExecutionAspect.java
Outdated
Show resolved
Hide resolved
masayag
reviewed
May 20, 2023
.../src/test/java/com/redhat/parodos/workflow/execution/aspect/WorkFlowExecutionAspectTest.java
Show resolved
Hide resolved
User may introduce a typo and the output is not great: ``` 2023-05-11 10:23:13.200 ERROR 52759 --- [ task-6] .a.i.SimpleAsyncUncaughtExceptionHandler : Unexpected exception occurred invoking async method: public void com.redhat.parodos.workflow.execution.service.WorkFlowExecutorImpl.executeAsync(java.util.UUID,java.lang.String,com.redhat.parodos.workflows.work.WorkContext,java.util.UUID) java.lang.NullPointerException: Cannot invoke "com.redhat.parodos.workflow.definition.entity.WorkFlowDefinition.getName()" because "workflow" is null at com.redhat.parodos.workflow.execution.aspect.WorkFlowExecutionFactory.isMainWorkFlow(WorkFlowExecutionFactory.java:55) ~[classes!/:na] at com.redhat.parodos.workflow.execution.aspect.WorkFlowExecutionFactory.createExecutionHandler(WorkFlowExecutionFactory.java:38) ~[classes!/:na] at com.redhat.parodos.workflow.execution.aspect.WorkFlowExecutionAspect.executeAroundAdvice(WorkFlowExecutionAspect.java:86) ~[classes!/:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na] at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634) ~[spring-aop-5.3.20.jar!/:5.3.20] at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624) ~[spring-aop-5.3.20.jar!/:5.3.20] at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72) ~[spring-aop-5.3.20.jar!/:5.3.20] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) ~[spring-aop-5.3.20.jar!/:5.3.20] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.20.jar!/:5.3.20] at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.20.jar!/:5.3.20] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.20.jar!/:5.3.20] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.20.jar!/:5.3.20] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[spring-aop-5.3.20.jar!/:5.3.20] at com.redhat.parodos.workflows.workflow.ParallelFlow$$EnhancerBySpringCGLIB$$7530a326.execute(<generated>) ~[workflow-engine-1.0.11-SNAPSHOT.jar!/:na] at com.redhat.parodos.workflows.engine.WorkFlowEngineImpl.run(WorkFlowEngineImpl.java:38) ~[workflow-engine-1.0.11-SNAPSHOT.jar!/:na] at com.redhat.parodos.workflow.execution.service.WorkFlowExecutorImpl.execute(WorkFlowExecutorImpl.java:35) ~[classes!/:na] at com.redhat.parodos.workflow.execution.service.WorkFlowExecutorImpl.executeAsync(WorkFlowExecutorImpl.java:27) ~[classes!/:na] at com.redhat.parodos.workflow.execution.service.WorkFlowExecutorImpl$$FastClassBySpringCGLIB$$510b4225.invoke(<generated>) ~[classes!/:na] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[workflow-examples-1.0.11-SNAPSHOT-jar-with-dependencies.jar:5.3.20] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) ~[spring-aop-5.3.20.jar!/:5.3.20] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.20.jar!/:5.3.20] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.20.jar!/:5.3.20] at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115) ~[spring-aop-5.3.20.jar!/:5.3.20] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na] ``` Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
masayag
approved these changes
May 21, 2023
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: masayag The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
masayag
reviewed
May 21, 2023
@@ -132,10 +134,34 @@ public void ExecuteAroundAdviceWithValidDataTest() { | |||
assertEquals(workReport.getStatus().toString(), COMPLETED); | |||
assertEquals(workReport.getWorkContext().get(WORKFLOW_DEFINITION_NAME), TEST_WORK_FLOW); | |||
assertEquals(workReport.getWorkContext().get(PROJECT_ID), projectID); | |||
assertThat(workReport.getError()).isInstanceOf(ResourceNotFoundException.class); |
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.
@eloycoto pls remove this change or replace with
assertThat(workReport.getError()).isNull();
This is a positive code path that shouldn't end with a failure
/lgtm |
Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
/lgtm |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User may introduce a typo and the output is not great:
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, use
fixes #<issue_number>(, fixes #<issue_number>, ...)
format, where issue_number might be a GitHub issue, or a Jira story (FLPATH-xxxx):Fixes #
Change type
Impacted services
Checklist