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 2022/09/05 16:58:12 UTC

[GitHub] [dolphinscheduler] guowei-su opened a new pull request, #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

guowei-su opened a new pull request, #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782

   <!--Thanks very much for contributing to Apache DolphinScheduler. Please review https://dolphinscheduler.apache.org/en-us/community/development/pull-request.html before opening a pull request.-->
   
   
   ## Purpose of the pull request
   This pull request optimizes the log printing of the api module.
   <!--(For example: This pull request adds checkstyle plugin).-->
   
   ## Brief change log
   -  Add or modify log of the files in api/service/impl/, etc.
   <!--*(for example:)*
     - *Add maven-checkstyle-plugin to root pom.xml*
   -->
   ## Verify this pull request
   
   <!--*(Please pick either of the following options)*-->
   
   This pull request is code cleanup without any test coverage.
   
   *(or)*
   
   This pull request is already covered by existing tests, such as *(please describe tests)*.
   
   
   <!--*(example:)*
     - *Added dolphinscheduler-dao tests for end-to-end.*
     - *Added CronUtilsTest to verify the change.*
     - *Manually verified the change by testing locally.* -->
   
   (or)
   
   If your pull request contain incompatible change, you should also add it to `docs/docs/en/guide/upgrede/incompatible.md`
   


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1243012645

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11782)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [24 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [45 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL)
   
   [![37.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '37.9%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list) [37.9% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list)  
   [![3.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/5-16px.png '3.4%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_duplicated_lines_density&view=list) [3.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1245125444

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11782)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [18 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [40 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL)
   
   [![37.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '37.9%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list) [37.9% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list)  
   [![3.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/5-16px.png '3.4%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_duplicated_lines_density&view=list) [3.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] guowei-su commented on a diff in pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
guowei-su commented on code in PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#discussion_r975988628


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java:
##########
@@ -538,6 +549,18 @@ public Result queryProjectCreatedAndAuthorizedByUser(User loginUser) {
         return result;
     }
 
+    /**
+     * check whether have read permission
+     *
+     * @param user user
+     * @param project project
+     * @return true if the user have permission to see the project, otherwise return false
+     */
+    private boolean checkReadPermission(User user, Project project) {

Review Comment:
   Sorry, this method was not referenced and was incorrectly merged while I was handling the conflict.



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
caishunfeng commented on code in PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#discussion_r963321439


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/ResourcePermissionCheckServiceImpl.java:
##########
@@ -107,6 +107,8 @@ public boolean resourcePermissionCheck(Object authorizationType, Object[] needCh
             Set<?> originResSet = new HashSet<>(Arrays.asList(needChecks));
             Set<?> ownResSets = RESOURCE_LIST_MAP.get(authorizationType).listAuthorizedResource(userId, logger);
             originResSet.removeAll(ownResSets);
+            if (!originResSet.isEmpty())

Review Comment:
   ```suggestion
               if (CollectionUtils.isNotEmpty(originResSet)) {
                    logger.warn("User does not have resource permission {} on associated resources, userId:{}", authorizationType, userId);
               }
   ```



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java:
##########
@@ -278,10 +290,16 @@ public Map<String, Object> deleteTenantById(User loginUser, int id) throws Excep
           storageOperate.deleteTenant(tenant.getTenantCode());
         }
 
-        tenantMapper.deleteById(id);
-        processInstanceMapper.updateProcessInstanceByTenantId(id, -1);
+        int delete = tenantMapper.deleteById(id);

Review Comment:
   Need to update the UT case.



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java:
##########
@@ -229,9 +232,14 @@ public Map<String, Object> updateTenant(User loginUser, int id, String tenantCod
         if (!Objects.equals(existsTenant.getTenantCode(), updateTenant.getTenantCode()) && PropertyUtils.getResUploadStartupState()) {
             storageOperate.createTenantDirIfNotExists(tenantCode);
         }
-        tenantMapper.updateById(updateTenant);
-
-        putMsg(result, Status.SUCCESS);
+        int update = tenantMapper.updateById(updateTenant);

Review Comment:
   Need to update the UT case.



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] zhongjiajie commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1250070741

   > I do not think this is a good idea, we should directly throw error instead of print log, and actually I already throw error in #11912
   
   We already have `ExceptionHandler`accept `ServiceException` and package `ServiceException` code and message into `Result` object, and it uses in the controller layer https://github.com/apache/dolphinscheduler/blob/ae6aa53f963d2ea02ab435db1e5548da23e3f882/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/exceptions/ApiExceptionHandler.java#L39-L43
   so when we throw an exception in the service layer, we will catch it in the controller layer and return the new `Result` object. And we already have exists method in https://github.com/apache/dolphinscheduler/blob/d3a77c68e62b0c471e25cd6a4bfbd2c561dd2023/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java#L657-L659. 
   
   when exception throw in L658 https://github.com/apache/dolphinscheduler/blob/d3a77c68e62b0c471e25cd6a4bfbd2c561dd2023/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java#L658
   controller will catch it and package into `Result(code=Status.PROCESS_INSTANCE_STATE_OPERATION_ERROR.getCode(), message=Status.PROCESS_INSTANCE_STATE_OPERATION_ERROR.getMsg())`


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1248071395

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11782)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [1 Vulnerability](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [42 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL)
   
   [![38.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '38.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list) [38.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list)  
   [![3.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/5-16px.png '3.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_duplicated_lines_density&view=list) [3.2% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] github-code-scanning[bot] commented on a diff in pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
github-code-scanning[bot] commented on code in PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#discussion_r971958596


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java:
##########
@@ -344,7 +345,7 @@
         Map<String, Object> result = new HashMap<>();
         try {
             if (taskDefinitionLogs.isEmpty()) {
-                logger.error("taskDefinitionJson invalid: {}", taskDefinitionJson);
+                logger.error("Parameter TaskDefinitionJson is invalid, taskDefinitionJson:{}.", taskDefinitionJson);

Review Comment:
   ## Logging should not be vulnerable to injection attacks
   
   <!--SONAR_ISSUE_KEY:AYMtrxOfq0Ecywf8IyjE-->Change this code to not log user-controlled data. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&issues=AYMtrxOfq0Ecywf8IyjE&open=AYMtrxOfq0Ecywf8IyjE&pullRequest=11782">SonarCloud</a></p>
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1207)



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] wen-hemin commented on a diff in pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
wen-hemin commented on code in PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#discussion_r975979096


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java:
##########
@@ -538,6 +549,18 @@ public Result queryProjectCreatedAndAuthorizedByUser(User loginUser) {
         return result;
     }
 
+    /**
+     * check whether have read permission
+     *
+     * @param user user
+     * @param project project
+     * @return true if the user have permission to see the project, otherwise return false
+     */
+    private boolean checkReadPermission(User user, Project project) {

Review Comment:
   Please confirm whether it is referenced



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] github-code-scanning[bot] commented on a diff in pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
github-code-scanning[bot] commented on code in PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#discussion_r967865060


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java:
##########
@@ -124,19 +125,21 @@
                     .updateTime(now)
                     .build();
         } catch (CodeGenerateException e) {
+            logger.error("Project create error, projectName:{}.", project.getName(), e);

Review Comment:
   ## Dereferenced variable is always null
   
   Variable [project](1) is always null here.
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1208)



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1243011963

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11782)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [24 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [45 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL)
   
   [![37.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '37.9%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list) [37.9% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list)  
   [![3.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/5-16px.png '3.4%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_duplicated_lines_density&view=list) [3.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1248577084

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11782)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [42 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL)
   
   [![38.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '38.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list) [38.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list)  
   [![3.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/5-16px.png '3.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_duplicated_lines_density&view=list) [3.2% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1249610639

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11782)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [42 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL)
   
   [![38.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '38.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list) [38.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list)  
   [![2.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.3%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_duplicated_lines_density&view=list) [2.3% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1248071829

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11782)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [1 Vulnerability](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [42 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL)
   
   [![38.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '38.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list) [38.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list)  
   [![3.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/5-16px.png '3.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_duplicated_lines_density&view=list) [3.2% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1242967944

   # [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/11782?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11782](https://codecov.io/gh/apache/dolphinscheduler/pull/11782?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a421c34) into [dev](https://codecov.io/gh/apache/dolphinscheduler/commit/c3a8dd5ca7cd2fa9bf97d745ad176a6f683c6ce3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c3a8dd5) will **decrease** coverage by `0.03%`.
   > The diff coverage is `37.20%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##                dev   #11782      +/-   ##
   ============================================
   - Coverage     38.54%   38.50%   -0.04%     
   - Complexity     4036     4042       +6     
   ============================================
     Files           993      993              
     Lines         36698    37271     +573     
     Branches       4273     4279       +6     
   ============================================
   + Hits          14144    14353     +209     
   - Misses        20928    21281     +353     
   - Partials       1626     1637      +11     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dolphinscheduler/pull/11782?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...olphinscheduler/api/audit/AuditPublishService.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11782/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2F1ZGl0L0F1ZGl0UHVibGlzaFNlcnZpY2UuamF2YQ==) | `34.61% <0.00%> (ø)` | |
   | [...phinscheduler/api/controller/TenantController.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11782/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2NvbnRyb2xsZXIvVGVuYW50Q29udHJvbGxlci5qYXZh) | `62.50% <ø> (ø)` | |
   | [...rg/apache/dolphinscheduler/api/k8s/K8sManager.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11782/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2s4cy9LOHNNYW5hZ2VyLmphdmE=) | `58.53% <0.00%> (ø)` | |
   | [...lphinscheduler/api/permission/PermissionCheck.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11782/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3Blcm1pc3Npb24vUGVybWlzc2lvbkNoZWNrLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...nscheduler/api/service/impl/DqRuleServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11782/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9EcVJ1bGVTZXJ2aWNlSW1wbC5qYXZh) | `59.18% <0.00%> (ø)` | |
   | [...r/plugin/datasource/api/utils/DataSourceUtils.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11782/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1kYXRhc291cmNlLXBsdWdpbi9kb2xwaGluc2NoZWR1bGVyLWRhdGFzb3VyY2UtYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kb2xwaGluc2NoZWR1bGVyL3BsdWdpbi9kYXRhc291cmNlL2FwaS91dGlscy9EYXRhU291cmNlVXRpbHMuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...er/api/service/impl/TaskDefinitionServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11782/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9UYXNrRGVmaW5pdGlvblNlcnZpY2VJbXBsLmphdmE=) | `22.44% <8.82%> (-1.46%)` | :arrow_down: |
   | [...i/service/impl/ProcessTaskRelationServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11782/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9Qcm9jZXNzVGFza1JlbGF0aW9uU2VydmljZUltcGwuamF2YQ==) | `21.32% <12.19%> (-1.13%)` | :arrow_down: |
   | [...inscheduler/api/controller/ExecutorController.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11782/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2NvbnRyb2xsZXIvRXhlY3V0b3JDb250cm9sbGVyLmphdmE=) | `22.22% <12.50%> (-0.86%)` | :arrow_down: |
   | [...heduler/api/service/impl/SchedulerServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11782/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9TY2hlZHVsZXJTZXJ2aWNlSW1wbC5qYXZh) | `8.56% <13.88%> (+0.35%)` | :arrow_up: |
   | ... and [51 more](https://codecov.io/gh/apache/dolphinscheduler/pull/11782/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1248578164

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11782)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [42 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL)
   
   [![38.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '38.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list) [38.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list)  
   [![3.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/5-16px.png '3.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_duplicated_lines_density&view=list) [3.2% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] guowei-su closed pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
guowei-su closed pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…
URL: https://github.com/apache/dolphinscheduler/pull/11782


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1242969471

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11782)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [3 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [84 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [48 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL)
   
   [![38.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '38.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list) [38.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list)  
   [![3.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/5-16px.png '3.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_duplicated_lines_density&view=list) [3.2% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] github-code-scanning[bot] commented on a diff in pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
github-code-scanning[bot] commented on code in PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#discussion_r967831967


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java:
##########
@@ -1047,6 +1090,7 @@
         }
         // check file content
         if (CollectionUtils.isEmpty(dagDataScheduleList)) {
+            logger.warn("Process definition file content is null, fileName:{}.", file.getOriginalFilename());

Review Comment:
   ## Log Injection
   
   This user-provided value flows to a [log entry](1).
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1031)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java:
##########
@@ -1188,7 +1233,7 @@
                 }
             }
         } catch (Exception e) {
-            logger.error(e.getMessage(), e);
+            logger.error("Import process definition error, projectCode:{}, fileName:{}.", projectCode, file.getOriginalFilename(), e);

Review Comment:
   ## Log Injection
   
   This user-provided value flows to a [log entry](1).
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1033)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java:
##########
@@ -1726,16 +1773,10 @@
~                treeViewDto.setCode(taskNode.getCode());
~                treeViewDto.setName(taskNode.getName());
                 // set treeViewDto instances
                 for (int i = limit - 1; i >= 0; i--) {
                     ProcessInstance processInstance = processInstanceList.get(i);
-                    TaskInstance taskInstance = null;
-                    for (TaskInstance instance : taskInstances) {
-                        if (instance.getTaskCode() == Long.parseLong(nodeCode)
-                                && instance.getProcessInstanceId() == processInstance.getId()) {
-                            taskInstance = instance;
-                            break;
-                        }
-                    }
+                    TaskInstance taskInstance = taskInstanceMapper.queryByInstanceIdAndCode(processInstance.getId(),
+                            Long.parseLong(nodeCode));

Review Comment:
   ## Missing catch of NumberFormatException
   
   Potential uncaught 'java.lang.NumberFormatException'.
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1030)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java:
##########
@@ -592,21 +606,21 @@
         putMsg(result, Status.SUCCESS);
 
         if (FileUtils.directoryTraversal(name)) {
-            logger.error("file alias name {} verify failed", name);
+            logger.warn("Parameter file alias name verify failed, fileAliasName:{}.", name);
             putMsg(result, Status.VERIFY_PARAMETER_NAME_FAILED);
             return result;
         }
 
         if (file != null && FileUtils.directoryTraversal(Objects.requireNonNull(file.getOriginalFilename()))) {
-            logger.error("file original name {} verify failed", file.getOriginalFilename());
+            logger.warn("File original name verify failed, fileOriginalName:{}.", file.getOriginalFilename());

Review Comment:
   ## Log Injection
   
   This user-provided value flows to a [log entry](1).
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1034)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java:
##########
@@ -294,7 +298,9 @@
     public Result execute(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
                           @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode,
                           @RequestParam("processInstanceId") Integer processInstanceId,
-                          @RequestParam("executeType") ExecuteType executeType) {
+                          @RequestParam("executeType") ExecuteType executeType

Review Comment:
   ## Log Injection
   
   This user-provided value flows to a [log entry](1).
   This user-provided value flows to a [log entry](2).
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1053)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/PermissionCheck.java:
##########
@@ -168,14 +168,14 @@
             // get user type in order to judge whether the user is admin
             User user = processService.getUserById(userId);
             if (user == null) {
-                logger.error("user id {} doesn't exist", userId);
+                logger.error("User does not exist, userId:{}.", userId);
                 throw new ServiceException(String.format("user %s doesn't exist", userId));
             }
             if (user.getUserType() != UserType.ADMIN_USER) {
                 List<T> unauthorizedList = processService.listUnauthorized(userId, needChecks, authorizationType);
                 // if exist unauthorized resource
                 if (CollectionUtils.isNotEmpty(unauthorizedList)) {
-                    logger.error("user {} doesn't have permission of {}: {}", user.getUserName(), authorizationType.getDescp(), unauthorizedList);
+                    logger.error("User does not have permission for {}: {}", user.getUserName(), authorizationType.getDescp(), unauthorizedList);

Review Comment:
   ## Unused format argument
   
   This format call refers to 2 argument(s) but supplies 3 argument(s).
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1027)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java:
##########
@@ -533,7 +556,7 @@
             return Constants.READ_PERMISSION;
         }
 
-        if (Objects.equals(project.getUserId(), user.getId())) {
+        if (project.getUserId() == user.getId()) {

Review Comment:
   ## Reference equality test of boxed types
   
   Suspicious reference comparison of boxed numerical values.
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1024)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/ResourcePermissionCheckServiceImpl.java:
##########
@@ -107,6 +107,8 @@
             Set<?> originResSet = new HashSet<>(Arrays.asList(needChecks));
             Set<?> ownResSets = RESOURCE_LIST_MAP.get(authorizationType).listAuthorizedResource(userId, logger);
             originResSet.removeAll(ownResSets);
+            if (CollectionUtils.isNotEmpty(originResSet))
+                logger.warn("User does not have resource permission {} on associated resources, userId:{}", authorizationType, userId);

Review Comment:
   ## Insertion of sensitive information into log files
   
   This [potentially sensitive information](1) is written to a log file.
   This [potentially sensitive information](2) is written to a log file.
   This [potentially sensitive information](3) is written to a log file.
   This [potentially sensitive information](4) is written to a log file.
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1116)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java:
##########
@@ -1084,16 +1140,16 @@
 
         String msg = null;
         if (!CheckUtils.checkUserName(userName)) {
-
+            logger.warn("Parameter userName check failed, userName:{}.", userName);
             msg = userName;
         } else if (!CheckUtils.checkPassword(password)) {
-
+            logger.warn("Parameter password check failed, password:{}.", password);

Review Comment:
   ## Insertion of sensitive information into log files
   
   This [potentially sensitive information](1) is written to a log file.
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1117)



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] guowei-su commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
guowei-su commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1245434587

   > Please add a doc of `How to print logs better`.
   
   The doc refs this doc pr: [Add log specification document to contribution guidelines. ](https://github.com/apache/dolphinscheduler/pull/11484)


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] guowei-su commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
guowei-su commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1245439120

   PLAT @caishunfeng 


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1245130315

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11782)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [18 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [40 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL)
   
   [![37.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '37.9%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list) [37.9% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list)  
   [![3.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/5-16px.png '3.4%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_duplicated_lines_density&view=list) [3.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] caishunfeng commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
caishunfeng commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1237738318

   Please add a doc of `How to print logs better`.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] guowei-su commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
guowei-su commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1237599981

   issue [#11773](https://github.com/apache/dolphinscheduler/issues/11773)


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1242969478

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11782)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [3 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [84 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [48 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL)
   
   [![38.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '38.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list) [38.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list)  
   [![3.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/5-16px.png '3.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_duplicated_lines_density&view=list) [3.2% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] JinyLeeChina merged pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
JinyLeeChina merged PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] zhongjiajie commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1250062983

   I do not think this is a good idea, we should directly throw error instead of print log, and actually I already throw error in #11912


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] guowei-su commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
guowei-su commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1250074564

   > > I do not think this is a good idea, we should directly throw error instead of print log, and actually I already throw error in #11912
   > 
   > We already have `ExceptionHandler`accept `ServiceException` and package `ServiceException` code and message into `Result` object, and it uses in the controller layer
   > 
   > https://github.com/apache/dolphinscheduler/blob/ae6aa53f963d2ea02ab435db1e5548da23e3f882/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/exceptions/ApiExceptionHandler.java#L39-L43
   > 
   > 
   > so when we throw an exception in the service layer, we will catch it in the controller layer and return the new `Result` object. And we already have exists method in
   > https://github.com/apache/dolphinscheduler/blob/d3a77c68e62b0c471e25cd6a4bfbd2c561dd2023/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java#L657-L659
   > 
   > .
   > when exception throw in L658
   > 
   > https://github.com/apache/dolphinscheduler/blob/d3a77c68e62b0c471e25cd6a4bfbd2c561dd2023/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java#L658
   > 
   > 
   > controller will catch it and package into `Result(code=Status.PROCESS_INSTANCE_STATE_OPERATION_ERROR.getCode(), message=Status.PROCESS_INSTANCE_STATE_OPERATION_ERROR.getMsg())`
   
   Ok, I probably get it. I will take this approach to regulate the api module logging and exceptions in the new pr. Also, I will describe this specification in the logging specification doc.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#issuecomment-1249605075

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11782)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL) [42 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11782&resolved=false&types=CODE_SMELL)
   
   [![38.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '38.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list) [38.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_coverage&view=list)  
   [![2.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.3%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&metric=new_duplicated_lines_density&view=list) [2.3% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11782&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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