[Improvement-11773][api] Optimize the log printing of the api module according…#11782
[Improvement-11773][api] Optimize the log printing of the api module according…#11782brave-lee merged 11 commits intoapache:devfrom
Conversation
SbloodyS
left a comment
There was a problem hiding this comment.
Please associate the issue and resolves conflicts.
|
issue #11773 |
...main/java/org/apache/dolphinscheduler/api/permission/ResourcePermissionCheckServiceImpl.java
Outdated
Show resolved
Hide resolved
...eduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java
Show resolved
Hide resolved
...eduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java
Show resolved
Hide resolved
|
Please add a doc of |
There was a problem hiding this comment.
Found 11 potential problems in the proposed changes. Check the Files changed tab for more details.
Codecov Report
@@ Coverage Diff @@
## dev #11782 +/- ##
============================================
- Coverage 38.67% 38.64% -0.04%
- Complexity 4049 4062 +13
============================================
Files 999 999
Lines 36728 37339 +611
Branches 4276 4286 +10
============================================
+ Hits 14204 14428 +224
- Misses 20901 21277 +376
- Partials 1623 1634 +11
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Found 84 potential problems in the proposed changes. Check the Files changed tab for more details.
...src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
Fixed
Show fixed
Hide fixed
...src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
Fixed
Show fixed
Hide fixed
...ler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
Fixed
Show fixed
Hide fixed
...heduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
Fixed
Show fixed
Hide fixed
...main/java/org/apache/dolphinscheduler/api/permission/ResourcePermissionCheckServiceImpl.java
Fixed
Show fixed
Hide fixed
...heduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java
Fixed
Show fixed
Hide fixed
...duler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java
Fixed
Show fixed
Hide fixed
...nscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/PermissionCheck.java
Fixed
Show fixed
Hide fixed
| if (projectCode == targetProjectCode) { | ||
| logger.warn("Project code is same as target project code, projectCode:{}.", projectCode); | ||
| return result; | ||
| } |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException
There was a problem hiding this comment.
Found 24 potential problems in the proposed changes. Check the Files changed tab for more details.
...duler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java
Fixed
Show fixed
Hide fixed
d69aca4 to
8c92b18
Compare
There was a problem hiding this comment.
Found 18 potential problems in the proposed changes. Check the Files changed tab for more details.
The doc refs this doc pr: Add log specification document to contribution guidelines. |
|
PLAT @caishunfeng |
c618a67 to
3e19c8c
Compare
...src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
Fixed
Show fixed
Hide fixed
… to the log specification doc. - Resolve conflict.
… to the log specification doc. - fix ProcessDefinitionServiceImpl.java dependency
… to the log specification doc. - Accept proposed change in ResourcePermissionCheckServiceImpl.java
… to the log specification doc. - Update the UT case in TenantServiceTest.java, UsersServiceTest.java, TaskGroupServiceTest.java. - Update log printing in TaskGroupServiceImpl.java. - Fix NPE of log parameter in ExecutorServiceImpl.java when call python api.
… to the log specification doc. - Fix NPE of log in WorkerGroupServiceImpl.java. - Fix log parameter missing bug in ResourcesServiceImpl.java.
… to the log specification doc. - Fix bugs and handle some vulnerability codes.
… to the log specification doc. - Fix bugs and handle some vulnerability codes.
… to the log specification doc. - Fix e2e User test.
… to the log specification doc. - Fix codeQL check & SonarCloud Code Analysis.
… to the log specification doc. - Resolve import conflict.
… to the log specification doc. - Fix codeQL check & SonarCloud Code Analysis.
|
Kudos, SonarCloud Quality Gate passed! |
|
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 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 when exception throw in 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. |
…according… (apache#11782) * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Resolve conflict. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - fix ProcessDefinitionServiceImpl.java dependency * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Accept proposed change in ResourcePermissionCheckServiceImpl.java * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Update the UT case in TenantServiceTest.java, UsersServiceTest.java, TaskGroupServiceTest.java. - Update log printing in TaskGroupServiceImpl.java. - Fix NPE of log parameter in ExecutorServiceImpl.java when call python api. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Fix NPE of log in WorkerGroupServiceImpl.java. - Fix log parameter missing bug in ResourcesServiceImpl.java. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Fix bugs and handle some vulnerability codes. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Fix bugs and handle some vulnerability codes. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Fix e2e User test. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Fix codeQL check & SonarCloud Code Analysis. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Resolve import conflict. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Fix codeQL check & SonarCloud Code Analysis.
| * @param project project | ||
| * @return true if the user have permission to see the project, otherwise return false | ||
| */ | ||
| private boolean checkReadPermission(User user, Project project) { |
There was a problem hiding this comment.
Please confirm whether it is referenced
There was a problem hiding this comment.
Sorry, this method was not referenced and was incorrectly merged while I was handling the conflict.
…according… (apache#11782) * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Resolve conflict. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - fix ProcessDefinitionServiceImpl.java dependency * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Accept proposed change in ResourcePermissionCheckServiceImpl.java * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Update the UT case in TenantServiceTest.java, UsersServiceTest.java, TaskGroupServiceTest.java. - Update log printing in TaskGroupServiceImpl.java. - Fix NPE of log parameter in ExecutorServiceImpl.java when call python api. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Fix NPE of log in WorkerGroupServiceImpl.java. - Fix log parameter missing bug in ResourcesServiceImpl.java. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Fix bugs and handle some vulnerability codes. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Fix bugs and handle some vulnerability codes. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Fix e2e User test. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Fix codeQL check & SonarCloud Code Analysis. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Resolve import conflict. * [DS-11773][api] Optimize the log printing of the api module according to the log specification doc. - Fix codeQL check & SonarCloud Code Analysis.








Purpose of the pull request
This pull request optimizes the log printing of the api module.
Brief change log
Verify this pull request
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).
(or)
If your pull request contain incompatible change, you should also add it to
docs/docs/en/guide/upgrede/incompatible.md