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

[GitHub] [dolphinscheduler] yang100455 opened a new pull request #6805: [fix-6766][api]fix bug when query projectList by api

yang100455 opened a new pull request #6805:
URL: https://github.com/apache/dolphinscheduler/pull/6805


   /dolphinscheduler/projects/authed-project : fix missing project infos such as  'userName','defCount','instRunningCount'
   /dolphinscheduler/projects/created-and-authed: fix missing project infos such as  'userName','defCount','instRunningCount'
   /dolphinscheduler/projects/list : Fix permission bug, any user can query all projects before, now user can only query authorized  project or create himself
   /dolphinscheduler/projects/list: fix missing project infos such as   'userName','defCount','instRunningCount'
   /dolphinscheduler/projects/{code} : fix missing project infos such as   'userName','defCount','instRunningCount'
   
   complete unitTest
   
   this close #6766
   
   <!--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
   
   <!--(For example: This pull request adds checkstyle plugin).-->
   
   ## Brief change log
   
   <!--*(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)*.
   
   (or)
   
   This change added tests and can be verified as follows:
   
   <!--*(example:)*
     - *Added dolphinscheduler-dao tests for end-to-end.*
     - *Added CronUtilsTest to verify the change.*
     - *Manually verified the change by testing locally.* -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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 #6805: [fix-6766][api]fix bug when query projectList by api

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


   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')
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=6805&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=6805&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=6805&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=6805&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=6805&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=6805&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=6805&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=6805&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=6805&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=6805&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=6805&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=6805&resolved=false&types=CODE_SMELL)
   
   [![77.8%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '77.8%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=6805&metric=new_coverage&view=list) [77.8% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=6805&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=6805&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=6805&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] lenboo commented on a change in pull request #6805: [fix-6766][api]fix bug when query projectList by api

Posted by GitBox <gi...@apache.org>.
lenboo commented on a change in pull request #6805:
URL: https://github.com/apache/dolphinscheduler/pull/6805#discussion_r748226802



##########
File path: dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProjectMapper.java
##########
@@ -114,7 +114,7 @@
     ProjectUser queryProjectWithUserByProcessInstanceId(@Param("processInstanceId") int processInstanceId);
 
     /**
-     * query all project
+     * query all project,only admin user can use this method, Other users query all projects use {@link ProjectMapper#queryProjectCreatedAndAuthorizedByUserId(int)}

Review comment:
       it's not only admin can use this api.




-- 
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] yang100455 commented on pull request #6805: [fix-6766][api]fix bug when query projectList by api

Posted by GitBox <gi...@apache.org>.
yang100455 commented on pull request #6805:
URL: https://github.com/apache/dolphinscheduler/pull/6805#issuecomment-966908156


   > The back-end code looks good. SQL needs to come alone to REVIEW
   
   What should I do, or wait for the  SQL review to complete?


-- 
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] lenboo commented on a change in pull request #6805: [fix-6766][api]fix bug when query projectList by api

Posted by GitBox <gi...@apache.org>.
lenboo commented on a change in pull request #6805:
URL: https://github.com/apache/dolphinscheduler/pull/6805#discussion_r748226802



##########
File path: dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProjectMapper.java
##########
@@ -114,7 +114,7 @@
     ProjectUser queryProjectWithUserByProcessInstanceId(@Param("processInstanceId") int processInstanceId);
 
     /**
-     * query all project
+     * query all project,only admin user can use this method, Other users query all projects use {@link ProjectMapper#queryProjectCreatedAndAuthorizedByUserId(int)}

Review comment:
       not only admin can use this api.




-- 
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-actions[bot] commented on pull request #6805: [fix-6766][api]fix bug when query projectList by api

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #6805:
URL: https://github.com/apache/dolphinscheduler/pull/6805#issuecomment-1083834921


   This pull request has been automatically marked as stale because it has not had recent activity for 120 days. It will be closed in 7 days if no further activity occurs.


-- 
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] yang100455 commented on a change in pull request #6805: [fix-6766][api]fix bug when query projectList by api

Posted by GitBox <gi...@apache.org>.
yang100455 commented on a change in pull request #6805:
URL: https://github.com/apache/dolphinscheduler/pull/6805#discussion_r749079479



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java
##########
@@ -265,7 +265,7 @@ public Result queryProjectCreatedAndAuthorizedByUser(@ApiIgnore @RequestAttribut
     @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR)
     @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
     public Result queryAllProjectList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) {
-        Map<String, Object> result = projectService.queryAllProjectList();
+        Map<String, Object> result = projectService.queryAllProjectList(loginUser);

Review comment:
       If this interface has no permission control, then you are right and this is no necessary, I have removed it in the new commit




-- 
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] yang100455 commented on pull request #6805: [fix-6766][api]fix bug when query projectList by api

Posted by GitBox <gi...@apache.org>.
yang100455 commented on pull request #6805:
URL: https://github.com/apache/dolphinscheduler/pull/6805#issuecomment-966195788


   ![image](https://user-images.githubusercontent.com/43943331/141284476-8afaf9b6-7e51-4286-9a8b-e46e2aed6923.png)
   


-- 
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] lenboo commented on a change in pull request #6805: [fix-6766][api]fix bug when query projectList by api

Posted by GitBox <gi...@apache.org>.
lenboo commented on a change in pull request #6805:
URL: https://github.com/apache/dolphinscheduler/pull/6805#discussion_r748221144



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java
##########
@@ -265,7 +265,7 @@ public Result queryProjectCreatedAndAuthorizedByUser(@ApiIgnore @RequestAttribut
     @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR)
     @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
     public Result queryAllProjectList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) {
-        Map<String, Object> result = projectService.queryAllProjectList();
+        Map<String, Object> result = projectService.queryAllProjectList(loginUser);

Review comment:
       there are some situations that we need the all projects without login user.
   so i think this is no necessary.




-- 
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] yang100455 commented on a change in pull request #6805: [fix-6766][api]fix bug when query projectList by api

Posted by GitBox <gi...@apache.org>.
yang100455 commented on a change in pull request #6805:
URL: https://github.com/apache/dolphinscheduler/pull/6805#discussion_r749079789



##########
File path: dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProjectMapper.java
##########
@@ -114,7 +114,7 @@
     ProjectUser queryProjectWithUserByProcessInstanceId(@Param("processInstanceId") int processInstanceId);
 
     /**
-     * query all project
+     * query all project,only admin user can use this method, Other users query all projects use {@link ProjectMapper#queryProjectCreatedAndAuthorizedByUserId(int)}

Review comment:
       if now anyone can use this method to query all projects , this comment is wrong, i have remove




-- 
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] yang100455 commented on a change in pull request #6805: [fix-6766][api]fix bug when query projectList by api

Posted by GitBox <gi...@apache.org>.
yang100455 commented on a change in pull request #6805:
URL: https://github.com/apache/dolphinscheduler/pull/6805#discussion_r749079789



##########
File path: dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProjectMapper.java
##########
@@ -114,7 +114,7 @@
     ProjectUser queryProjectWithUserByProcessInstanceId(@Param("processInstanceId") int processInstanceId);
 
     /**
-     * query all project
+     * query all project,only admin user can use this method, Other users query all projects use {@link ProjectMapper#queryProjectCreatedAndAuthorizedByUserId(int)}

Review comment:
       if anyone can use this method to query all projects is right , I have removed this comment




-- 
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] yang100455 commented on a change in pull request #6805: [fix-6766][api]fix bug when query projectList by api

Posted by GitBox <gi...@apache.org>.
yang100455 commented on a change in pull request #6805:
URL: https://github.com/apache/dolphinscheduler/pull/6805#discussion_r749079789



##########
File path: dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProjectMapper.java
##########
@@ -114,7 +114,7 @@
     ProjectUser queryProjectWithUserByProcessInstanceId(@Param("processInstanceId") int processInstanceId);
 
     /**
-     * query all project
+     * query all project,only admin user can use this method, Other users query all projects use {@link ProjectMapper#queryProjectCreatedAndAuthorizedByUserId(int)}

Review comment:
       I have removed this comment




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