-
Notifications
You must be signed in to change notification settings - Fork 27
combine task status with its checker #247
combine task status with its checker #247
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.
Do you think it makes sense to check for task PENDING status?
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.
checker workflow will not have pending status, its execution entity is null if it's not started. Other workflows/tasks will be pending if their executions are 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.
in getStatus endpoint, we don't return checker status. But I am planning to include it in the return later on and show checker status separately in a popup/window in UI
|| WorkFlowStatus.IN_PROGRESS.equals(workExecution.getStatus()) ? ParodosWorkStatus.PENDING | ||
: ParodosWorkStatus.valueOf(workExecution.getStatus().name()); | ||
ParodosWorkStatus workStatus; | ||
if (workExecution == 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.
switch?
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 logic here has some redundency, I have fixed it
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.
good catch
workStatus = Optional | ||
.ofNullable(workFlowRepository.findFirstByMasterWorkFlowExecutionAndWorkFlowDefinitionId( | ||
workFlowExecution.getMasterWorkFlowExecution(), | ||
workFlowTaskDefinition |
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.
could you use the service instead of the repository, definitions are in another package, and service should be used
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 just found there will be cyclic dependency if I use workflowService here, as workflowDelegate is also dependent of workflowService: https://github.com/RichardW98/parodos/blob/combine-task-checker-status/workflow-service/src/main/java/com/redhat/parodos/workflow/execution/service/WorkFlowServiceImpl.java#L72
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.
personally I think workflowService should depend on its delegate but not in reverse.
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 have created a ticket in our board to rearrange dependencies: https://issues.redhat.com/browse/FLPATH-290
45e9838
to
a0aaa1e
Compare
b5d9891
to
b54262d
Compare
@@ -247,6 +247,7 @@ private void getWorksFromWorkDefinition(List<WorkFlowWorkDefinition> workFlowWor | |||
return; | |||
} | |||
responseDTOs.add(WorkDefinitionResponseDTO.fromWorkFlowTaskDefinition(wdt.get())); | |||
break; |
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 break is not needed at all, n?
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.
we need it to avoid the errors (workflow with id not found) when app starts
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.
in java, if no break then it continues to the case after it regardless if matches
b54262d
to
67a20ae
Compare
d406ced
to
5f8a95d
Compare
5f8a95d
to
7c50f0c
Compare
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
/approve |
[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 |
FLPATH-299
UI shows task completed even its checker is still running.
this pr will display task in_progress if its checker is not completed.
example: checker waiting jira approval
getStatus response: