Loading .github/workflows/SonarCloud.yml 0 → 100644 +51 −0 Original line number Diff line number Diff line # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # name: SonarCloud on: [push, pull_request] jobs: sonarCloudTrigger: name: SonarCloud Trigger runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: actions/setup-java@v1 with: java-version: 8 - uses: actions/cache@v1 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-sonarqube restore-keys: | ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-sonarqube ${{ runner.os }}-maven- - name: Maven clean run: mvn clean - name: Run SonarCloud analyse run: > mvn clean --batch-mode org.jacoco:jacoco-maven-plugin:prepare-agent verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dmaven.test.skip=true -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache-dolphinscheduler -Dsonar.login=e4058004bc6be89decf558ac819aa1ecbee57682 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} README.md +2 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,8 @@ Dolphin Scheduler Official Website [](https://www.apache.org/licenses/LICENSE-2.0.html) [](https://github.com/apache/Incubator-DolphinScheduler) [](https://codecov.io/gh/apache/incubator-dolphinscheduler/branch/dev)  [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler) > Dolphin Scheduler for Big Data Loading README_zh_CN.md +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ Dolphin Scheduler Official Website [](https://www.apache.org/licenses/LICENSE-2.0.html) [](https://github.com/apache/Incubator-DolphinScheduler) [](https://codecov.io/gh/apache/incubator-dolphinscheduler/branch/dev)  [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler) > Dolphin Scheduler for Big Data Loading dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/QueueService.java +14 −4 Original line number Diff line number Diff line Loading @@ -115,12 +115,12 @@ public class QueueService extends BaseService { } if (StringUtils.isEmpty(queue)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, queue); putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queue"); return result; } if (StringUtils.isEmpty(queueName)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, queueName); putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queueName"); return result; } Loading Loading @@ -163,6 +163,16 @@ public class QueueService extends BaseService { return result; } if (StringUtils.isEmpty(queue)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queue"); return result; } if (StringUtils.isEmpty(queueName)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queueName"); return result; } Queue queueObj = queueMapper.selectById(id); if (queueObj == null) { putMsg(result, Status.QUEUE_NOT_EXIST, id); Loading Loading @@ -222,12 +232,12 @@ public class QueueService extends BaseService { Result result = new Result(); if (StringUtils.isEmpty(queue)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, queue); putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queue"); return result; } if (StringUtils.isEmpty(queueName)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, queueName); putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queueName"); return result; } Loading dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java +45 −4 Original line number Diff line number Diff line Loading @@ -221,9 +221,13 @@ public class UsersService extends BaseService { return result; } Date now = new Date(); if (StringUtils.isNotEmpty(userName)) { if (!CheckUtils.checkUserName(userName)){ putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,userName); return result; } User tempUser = userMapper.queryByUserNameAccurately(userName); if (tempUser != null && tempUser.getId() != userId) { putMsg(result, Status.USER_NAME_EXIST); Loading @@ -233,14 +237,30 @@ public class UsersService extends BaseService { } if (StringUtils.isNotEmpty(userPassword)) { if (!CheckUtils.checkPassword(userPassword)){ putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,userPassword); return result; } user.setUserPassword(EncryptionUtils.getMd5(userPassword)); } if (StringUtils.isNotEmpty(email)) { if (!CheckUtils.checkEmail(email)){ putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,email); return result; } user.setEmail(email); } user.setQueue(queue); if (StringUtils.isNotEmpty(phone)) { if (!CheckUtils.checkPhone(phone)){ putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,phone); return result; } user.setPhone(phone); } user.setQueue(queue); Date now = new Date(); user.setUpdateTime(now); //if user switches the tenant, the user's resources need to be copied to the new tenant Loading Loading @@ -318,10 +338,15 @@ public class UsersService extends BaseService { Map<String, Object> result = new HashMap<>(5); //only admin can operate if (!isAdmin(loginUser)) { putMsg(result, Status.USER_NO_OPERATION_PERM, id); return result; } //check exist User tempUser = userMapper.selectById(id); if (tempUser == null) { putMsg(result, Status.USER_NOT_EXIST, id); return result; } // delete user User user = userMapper.queryTenantCodeByUserId(id); Loading Loading @@ -357,6 +382,12 @@ public class UsersService extends BaseService { return result; } //check exist User tempUser = userMapper.selectById(userId); if (tempUser == null) { putMsg(result, Status.USER_NOT_EXIST, userId); return result; } //if the selected projectIds are empty, delete all items associated with the user projectUserMapper.deleteProjectRelation(0, userId); Loading Loading @@ -443,6 +474,11 @@ public class UsersService extends BaseService { if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) { return result; } User user = userMapper.selectById(userId); if(user == null){ putMsg(result, Status.USER_NOT_EXIST, userId); return result; } udfUserMapper.deleteByUserId(userId); Loading Loading @@ -485,6 +521,11 @@ public class UsersService extends BaseService { if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) { return result; } User user = userMapper.selectById(userId); if(user == null){ putMsg(result, Status.USER_NOT_EXIST, userId); return result; } datasourceUserMapper.deleteByUserId(userId); Loading Loading
.github/workflows/SonarCloud.yml 0 → 100644 +51 −0 Original line number Diff line number Diff line # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # name: SonarCloud on: [push, pull_request] jobs: sonarCloudTrigger: name: SonarCloud Trigger runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: actions/setup-java@v1 with: java-version: 8 - uses: actions/cache@v1 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-sonarqube restore-keys: | ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-sonarqube ${{ runner.os }}-maven- - name: Maven clean run: mvn clean - name: Run SonarCloud analyse run: > mvn clean --batch-mode org.jacoco:jacoco-maven-plugin:prepare-agent verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dmaven.test.skip=true -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache-dolphinscheduler -Dsonar.login=e4058004bc6be89decf558ac819aa1ecbee57682 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
README.md +2 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,8 @@ Dolphin Scheduler Official Website [](https://www.apache.org/licenses/LICENSE-2.0.html) [](https://github.com/apache/Incubator-DolphinScheduler) [](https://codecov.io/gh/apache/incubator-dolphinscheduler/branch/dev)  [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler) > Dolphin Scheduler for Big Data Loading
README_zh_CN.md +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ Dolphin Scheduler Official Website [](https://www.apache.org/licenses/LICENSE-2.0.html) [](https://github.com/apache/Incubator-DolphinScheduler) [](https://codecov.io/gh/apache/incubator-dolphinscheduler/branch/dev)  [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler) > Dolphin Scheduler for Big Data Loading
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/QueueService.java +14 −4 Original line number Diff line number Diff line Loading @@ -115,12 +115,12 @@ public class QueueService extends BaseService { } if (StringUtils.isEmpty(queue)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, queue); putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queue"); return result; } if (StringUtils.isEmpty(queueName)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, queueName); putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queueName"); return result; } Loading Loading @@ -163,6 +163,16 @@ public class QueueService extends BaseService { return result; } if (StringUtils.isEmpty(queue)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queue"); return result; } if (StringUtils.isEmpty(queueName)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queueName"); return result; } Queue queueObj = queueMapper.selectById(id); if (queueObj == null) { putMsg(result, Status.QUEUE_NOT_EXIST, id); Loading Loading @@ -222,12 +232,12 @@ public class QueueService extends BaseService { Result result = new Result(); if (StringUtils.isEmpty(queue)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, queue); putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queue"); return result; } if (StringUtils.isEmpty(queueName)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, queueName); putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queueName"); return result; } Loading
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java +45 −4 Original line number Diff line number Diff line Loading @@ -221,9 +221,13 @@ public class UsersService extends BaseService { return result; } Date now = new Date(); if (StringUtils.isNotEmpty(userName)) { if (!CheckUtils.checkUserName(userName)){ putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,userName); return result; } User tempUser = userMapper.queryByUserNameAccurately(userName); if (tempUser != null && tempUser.getId() != userId) { putMsg(result, Status.USER_NAME_EXIST); Loading @@ -233,14 +237,30 @@ public class UsersService extends BaseService { } if (StringUtils.isNotEmpty(userPassword)) { if (!CheckUtils.checkPassword(userPassword)){ putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,userPassword); return result; } user.setUserPassword(EncryptionUtils.getMd5(userPassword)); } if (StringUtils.isNotEmpty(email)) { if (!CheckUtils.checkEmail(email)){ putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,email); return result; } user.setEmail(email); } user.setQueue(queue); if (StringUtils.isNotEmpty(phone)) { if (!CheckUtils.checkPhone(phone)){ putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,phone); return result; } user.setPhone(phone); } user.setQueue(queue); Date now = new Date(); user.setUpdateTime(now); //if user switches the tenant, the user's resources need to be copied to the new tenant Loading Loading @@ -318,10 +338,15 @@ public class UsersService extends BaseService { Map<String, Object> result = new HashMap<>(5); //only admin can operate if (!isAdmin(loginUser)) { putMsg(result, Status.USER_NO_OPERATION_PERM, id); return result; } //check exist User tempUser = userMapper.selectById(id); if (tempUser == null) { putMsg(result, Status.USER_NOT_EXIST, id); return result; } // delete user User user = userMapper.queryTenantCodeByUserId(id); Loading Loading @@ -357,6 +382,12 @@ public class UsersService extends BaseService { return result; } //check exist User tempUser = userMapper.selectById(userId); if (tempUser == null) { putMsg(result, Status.USER_NOT_EXIST, userId); return result; } //if the selected projectIds are empty, delete all items associated with the user projectUserMapper.deleteProjectRelation(0, userId); Loading Loading @@ -443,6 +474,11 @@ public class UsersService extends BaseService { if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) { return result; } User user = userMapper.selectById(userId); if(user == null){ putMsg(result, Status.USER_NOT_EXIST, userId); return result; } udfUserMapper.deleteByUserId(userId); Loading Loading @@ -485,6 +521,11 @@ public class UsersService extends BaseService { if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) { return result; } User user = userMapper.selectById(userId); if(user == null){ putMsg(result, Status.USER_NOT_EXIST, userId); return result; } datasourceUserMapper.deleteByUserId(userId); Loading