You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/01/26 01:56:13 UTC

[GitHub] [incubator-dolphinscheduler] zhuangchong opened a new pull request #4569: [Improvement-4568][API] When the workflow definition name validation API fails, the system prompts that the workflow definition name already exists

zhuangchong opened a new pull request #4569:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4569


   ## What is the purpose of the pull request
   
   this PR closes #4568 
   
   When the workflow definition name validation API fails, the system prompts that the workflow definition name already exists,
   the system normally prompts workflow definition name validation error
   
   
   ## Verify this pull request
   
   This change added tests and can be verified as follows:
     - *Manually verified the change by testing locally.*
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] chengshiwen commented on a change in pull request #4569: [Improvement-4568][API] When the workflow definition name validation API fails, the system prompts that the workflow definition name already exists

Posted by GitBox <gi...@apache.org>.
chengshiwen commented on a change in pull request #4569:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4569#discussion_r564332819



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
##########
@@ -495,7 +495,7 @@ private String getResourceIds(ProcessData processData) {
         if (processDefinition == null) {
             putMsg(result, Status.SUCCESS);
         } else {
-            putMsg(result, Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR, name);
+            putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name);

Review comment:
       Now `VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR` is use less, so it's better to remove it




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] zhuangchong commented on a change in pull request #4569: [Improvement-4568][API] When the workflow definition name validation API fails, the system prompts that the workflow definition name already exists

Posted by GitBox <gi...@apache.org>.
zhuangchong commented on a change in pull request #4569:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4569#discussion_r564219074



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
##########
@@ -495,7 +495,7 @@ private String getResourceIds(ProcessData processData) {
         if (processDefinition == null) {
             putMsg(result, Status.SUCCESS);
         } else {
-            putMsg(result, Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR, name);
+            putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name);

Review comment:
       the ut error has been fixed.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] CalvinKirs merged pull request #4569: [Improvement-4568][API] When the workflow definition name validation API fails, the system prompts that the workflow definition name already exists

Posted by GitBox <gi...@apache.org>.
CalvinKirs merged pull request #4569:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4569


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] zhuangchong commented on a change in pull request #4569: [Improvement-4568][API] When the workflow definition name validation API fails, the system prompts that the workflow definition name already exists

Posted by GitBox <gi...@apache.org>.
zhuangchong commented on a change in pull request #4569:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4569#discussion_r564336836



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
##########
@@ -495,7 +495,7 @@ private String getResourceIds(ProcessData processData) {
         if (processDefinition == null) {
             putMsg(result, Status.SUCCESS);
         } else {
-            putMsg(result, Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR, name);
+            putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name);

Review comment:
       VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR state is used for prompt verifyProcessDefinitionName method throws an exception
   
   ```
   @ApiException(VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR)
       public Result verifyProcessDefinitionName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
                                                 @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName,
                                                 @RequestParam(value = "name", required = true) String name) {
           logger.info("verify process definition name unique, user:{}, project name:{}, process definition name:{}",
               loginUser.getUserName(), projectName, name);
           Map<String, Object> result = processDefinitionService.verifyProcessDefinitionName(loginUser, projectName, name);
           return returnDataList(result);
       }
   
   ```
   
   PROCESS_DEFINITION_NAME_EXIST state is the prompt used to verify the existence of the workflow definition name
   
   ```
   ProcessDefinition processDefinition = processDefineMapper.verifyByDefineName(project.getId(), name);
           if (processDefinition == null) {
               putMsg(result, Status.SUCCESS);
           } else {
               putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name);
           }
   
    ```
   
   I think the VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR and PROCESS_DEFINITION_NAME_EXIST states are both required.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] codecov-io commented on pull request #4569: [Improvement-4568][API] When the workflow definition name validation API fails, the system prompts that the workflow definition name already exists

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #4569:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4569#issuecomment-767297852


   # [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/4569?src=pr&el=h1) Report
   > Merging [#4569](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/4569?src=pr&el=desc) (fd75391) into [dev](https://codecov.io/gh/apache/incubator-dolphinscheduler/commit/69445e3cfc1cc42ccd32bc636c83197db3d5e5c1?el=desc) (69445e3) will **decrease** coverage by `0.01%`.
   > The diff coverage is `75.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/4569/graphs/tree.svg?width=650&height=150&src=pr&token=bv9iXXRLi9)](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/4569?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##                dev    #4569      +/-   ##
   ============================================
   - Coverage     44.72%   44.71%   -0.02%     
   + Complexity     3341     3339       -2     
   ============================================
     Files           530      530              
     Lines         22838    22839       +1     
     Branches       2669     2669              
   ============================================
   - Hits          10215    10213       -2     
   - Misses        11702    11704       +2     
   - Partials        921      922       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/4569?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...api/service/impl/ProcessDefinitionServiceImpl.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/4569/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9Qcm9jZXNzRGVmaW5pdGlvblNlcnZpY2VJbXBsLmphdmE=) | `68.48% <50.00%> (ø)` | `108.00 <0.00> (ø)` | |
   | [.../org/apache/dolphinscheduler/api/enums/Status.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/4569/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2VudW1zL1N0YXR1cy5qYXZh) | `100.00% <100.00%> (ø)` | `5.00 <0.00> (ø)` | |
   | [...er/master/dispatch/host/assign/RandomSelector.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/4569/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9kaXNwYXRjaC9ob3N0L2Fzc2lnbi9SYW5kb21TZWxlY3Rvci5qYXZh) | `77.77% <0.00%> (-5.56%)` | `3.00% <0.00%> (-1.00%)` | |
   | [...inscheduler/service/zk/CuratorZookeeperClient.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/4569/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2aWNlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kb2xwaGluc2NoZWR1bGVyL3NlcnZpY2UvemsvQ3VyYXRvclpvb2tlZXBlckNsaWVudC5qYXZh) | `60.97% <0.00%> (-4.88%)` | `7.00% <0.00%> (-1.00%)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/4569?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/4569?src=pr&el=footer). Last update [69445e3...fd75391](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/4569?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] sonarcloud[bot] commented on pull request #4569: [Improvement-4568][API] When the workflow definition name validation API fails, the system prompts that the workflow definition name already exists

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #4569:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4569#issuecomment-767298882


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=4569&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=4569&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=4569&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=4569&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=4569&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=4569&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=4569&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=4569&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=4569&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=4569&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=4569&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=4569&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60.png' alt='75.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=4569&metric=new_coverage&view=list) [75.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=4569&metric=new_coverage&view=list)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=4569&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=4569&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] chengshiwen commented on a change in pull request #4569: [Improvement-4568][API] When the workflow definition name validation API fails, the system prompts that the workflow definition name already exists

Posted by GitBox <gi...@apache.org>.
chengshiwen commented on a change in pull request #4569:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4569#discussion_r564186100



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
##########
@@ -133,7 +133,7 @@
     QUERY_TASK_INSTANCE_LOG_ERROR(10103, "view task instance log error", "查询任务实例日志错误"),
     DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR(10104, "download task instance log file error", "下载任务日志文件错误"),
     CREATE_PROCESS_DEFINITION(10105, "create process definition", "创建工作流错误"),
-    VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR(10106, "verify process definition name unique error", "工作流定义名称已存在"),

Review comment:
       There is essentially no difference between the `VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR` and `PROCESS_DEFINITION_NAME_EXIST`, and it's not necessary to add an additional error code.
   The easiest way is just renaming `VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR ` to another 

##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
##########
@@ -495,7 +495,7 @@ private String getResourceIds(ProcessData processData) {
         if (processDefinition == null) {
             putMsg(result, Status.SUCCESS);
         } else {
-            putMsg(result, Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR, name);
+            putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name);

Review comment:
       Replace `VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR` with `PROCESS_DEFINITION_NAME_EXIST ` and ignore `VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR` in other references, so it leads to failing the unit test.
   Maybe you should consider all references of the `VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR` globally




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] chengshiwen commented on a change in pull request #4569: [Improvement-4568][API] When the workflow definition name validation API fails, the system prompts that the workflow definition name already exists

Posted by GitBox <gi...@apache.org>.
chengshiwen commented on a change in pull request #4569:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4569#discussion_r564186100



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
##########
@@ -133,7 +133,7 @@
     QUERY_TASK_INSTANCE_LOG_ERROR(10103, "view task instance log error", "查询任务实例日志错误"),
     DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR(10104, "download task instance log file error", "下载任务日志文件错误"),
     CREATE_PROCESS_DEFINITION(10105, "create process definition", "创建工作流错误"),
-    VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR(10106, "verify process definition name unique error", "工作流定义名称已存在"),

Review comment:
       There is essentially no difference between the `VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR` and `PROCESS_DEFINITION_NAME_EXIST`, and it's not necessary to add an additional error code.
   The easiest way is just renaming `VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR ` to another 

##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
##########
@@ -495,7 +495,7 @@ private String getResourceIds(ProcessData processData) {
         if (processDefinition == null) {
             putMsg(result, Status.SUCCESS);
         } else {
-            putMsg(result, Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR, name);
+            putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name);

Review comment:
       Replace `VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR` with `PROCESS_DEFINITION_NAME_EXIST ` and ignore `VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR` in other references, so it leads to failing the unit test.
   Maybe you should consider all references of the `VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR` globally




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org