EricGao888 commented on code in PR #12264:
URL: https://github.com/apache/dolphinscheduler/pull/12264#discussion_r990721501
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java:
##########
@@ -335,6 +339,19 @@ public Result queryProcessInstanceList(User loginUser,
long projectCode, long pr
return result;
}
+ /**
+ * check if the processInstance is finish
+ * @param processInstance processInstance
+ * @return result
+ */
+ private boolean isFinish(ProcessInstance processInstance){
+ if (processInstance.getState() == null) {
+ return false;
+ }
+ return
!processInstance.getState().equals(WorkflowExecutionStatus.RUNNING_EXECUTION)
Review Comment:
@SbloodyS @caishunfeng I'm not sure about this, could u plz help take a look
when available? Thanks : )
https://github.com/apache/dolphinscheduler/blob/2e4a9e6d5395730282a3f105aa815a4095a96433/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/WorkflowExecutionStatus.java#L29-L41
##########
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProcessInstanceServiceTest.java:
##########
@@ -270,20 +270,48 @@ public void testQueryTopNLongestRunningProcessInstance() {
// project auth fail
when(projectMapper.queryByCode(projectCode)).thenReturn(project);
when(projectService.checkProjectAndAuth(loginUser, project,
projectCode, WORKFLOW_INSTANCE)).thenReturn(result);
- Map<String, Object> proejctAuthFailRes = processInstanceService
+ Map<String, Object> projectAuthFailRes = processInstanceService
.queryTopNLongestRunningProcessInstance(loginUser,
projectCode, size, startTime, endTime);
- Assert.assertEquals(Status.PROJECT_NOT_FOUND,
proejctAuthFailRes.get(Constants.STATUS));
+ Assert.assertEquals(Status.PROJECT_NOT_FOUND,
projectAuthFailRes.get(Constants.STATUS));
// project auth success
putMsg(result, Status.SUCCESS, projectCode);
ProcessInstance processInstance = getProcessInstance();
when(projectMapper.queryByCode(projectCode)).thenReturn(project);
when(projectService.checkProjectAndAuth(loginUser, project,
projectCode, WORKFLOW_INSTANCE)).thenReturn(result);
+ projectAuthFailRes = processInstanceService
Review Comment:
This test case is a bit too long with multiple sub cases, it would be better
if u could separate it.
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java:
##########
@@ -335,6 +339,19 @@ public Result queryProcessInstanceList(User loginUser,
long projectCode, long pr
return result;
}
+ /**
Review Comment:
Since this method is not an open API, and its logic is quite clear, I prefer
removing the comments. As u could see, there are many legacy redundant comments
in this project which are hard to maintain, we will remove and fix those
comments in the future gradually.
--
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]