Loading dolphinscheduler-api/src/main/resources/application-combined.properties→.github/workflows/SonarCloud.yml +51 −0 Original line number Diff line number Diff line Loading @@ -15,26 +15,37 @@ # limitations under the License. # logging.config=classpath:combined_logback.xml # server port server.port=12345 # session config server.servlet.session.timeout=7200 server.servlet.context-path=/dolphinscheduler/ # file size limit for upload spring.servlet.multipart.max-file-size=1024MB spring.servlet.multipart.max-request-size=1024MB #post content server.jetty.max-http-post-size=5000000 spring.messages.encoding=UTF-8 #i18n classpath folder , file prefix messages, if have many files, use "," seperator spring.messages.basename=i18n/messages server.is-combined-server=true 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-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java +4 −7 Original line number Diff line number Diff line Loading @@ -39,20 +39,16 @@ public class AlertServer { private AlertSender alertSender; private static volatile AlertServer instance; private static AlertServer instance; public AlertServer() { } public static AlertServer getInstance(){ if (null == instance) { synchronized (AlertServer.class) { public synchronized static AlertServer getInstance(){ if (null == instance) { instance = new AlertServer(); } } } return instance; } Loading @@ -63,6 +59,7 @@ public class AlertServer { Thread.sleep(Constants.ALERT_SCAN_INTERVEL); } catch (InterruptedException e) { logger.error(e.getMessage(),e); Thread.currentThread().interrupt(); } List<Alert> alerts = alertDao.listWaitExecutionAlert(); alertSender = new AlertSender(alerts, alertDao); Loading dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/EnterpriseWeChatUtils.java +31 −22 Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ public class EnterpriseWeChatUtils { String resp; CloseableHttpClient httpClient = HttpClients.createDefault(); try { HttpGet httpGet = new HttpGet(enterpriseWeChatTokenUrlReplace); CloseableHttpResponse response = httpClient.execute(httpGet); try { Loading @@ -100,6 +101,9 @@ public class EnterpriseWeChatUtils { new TypeToken<Map<String, Object>>() { }.getType()); return map.get("access_token").toString(); } finally { httpClient.close(); } } /** Loading Loading @@ -167,10 +171,11 @@ public class EnterpriseWeChatUtils { public static String sendEnterpriseWeChat(String charset, String data, String token) throws IOException { String enterpriseWeChatPushUrlReplace = enterpriseWeChatPushUrl.replaceAll("\\$token", token); CloseableHttpClient httpclient = HttpClients.createDefault(); CloseableHttpClient httpClient = HttpClients.createDefault(); try { HttpPost httpPost = new HttpPost(enterpriseWeChatPushUrlReplace); httpPost.setEntity(new StringEntity(data, charset)); CloseableHttpResponse response = httpclient.execute(httpPost); CloseableHttpResponse response = httpClient.execute(httpPost); String resp; try { HttpEntity entity = response.getEntity(); Loading @@ -179,8 +184,12 @@ public class EnterpriseWeChatUtils { } finally { response.close(); } logger.info("Enterprise WeChat send [{}], param:{}, resp:{}", enterpriseWeChatPushUrl, data, resp); logger.info("Enterprise WeChat send [{}], param:{}, resp:{}", enterpriseWeChatPushUrl, data, resp); return resp; } finally { httpClient.close(); } } /** Loading Loading
dolphinscheduler-api/src/main/resources/application-combined.properties→.github/workflows/SonarCloud.yml +51 −0 Original line number Diff line number Diff line Loading @@ -15,26 +15,37 @@ # limitations under the License. # logging.config=classpath:combined_logback.xml # server port server.port=12345 # session config server.servlet.session.timeout=7200 server.servlet.context-path=/dolphinscheduler/ # file size limit for upload spring.servlet.multipart.max-file-size=1024MB spring.servlet.multipart.max-request-size=1024MB #post content server.jetty.max-http-post-size=5000000 spring.messages.encoding=UTF-8 #i18n classpath folder , file prefix messages, if have many files, use "," seperator spring.messages.basename=i18n/messages server.is-combined-server=true 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-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java +4 −7 Original line number Diff line number Diff line Loading @@ -39,20 +39,16 @@ public class AlertServer { private AlertSender alertSender; private static volatile AlertServer instance; private static AlertServer instance; public AlertServer() { } public static AlertServer getInstance(){ if (null == instance) { synchronized (AlertServer.class) { public synchronized static AlertServer getInstance(){ if (null == instance) { instance = new AlertServer(); } } } return instance; } Loading @@ -63,6 +59,7 @@ public class AlertServer { Thread.sleep(Constants.ALERT_SCAN_INTERVEL); } catch (InterruptedException e) { logger.error(e.getMessage(),e); Thread.currentThread().interrupt(); } List<Alert> alerts = alertDao.listWaitExecutionAlert(); alertSender = new AlertSender(alerts, alertDao); Loading
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/EnterpriseWeChatUtils.java +31 −22 Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ public class EnterpriseWeChatUtils { String resp; CloseableHttpClient httpClient = HttpClients.createDefault(); try { HttpGet httpGet = new HttpGet(enterpriseWeChatTokenUrlReplace); CloseableHttpResponse response = httpClient.execute(httpGet); try { Loading @@ -100,6 +101,9 @@ public class EnterpriseWeChatUtils { new TypeToken<Map<String, Object>>() { }.getType()); return map.get("access_token").toString(); } finally { httpClient.close(); } } /** Loading Loading @@ -167,10 +171,11 @@ public class EnterpriseWeChatUtils { public static String sendEnterpriseWeChat(String charset, String data, String token) throws IOException { String enterpriseWeChatPushUrlReplace = enterpriseWeChatPushUrl.replaceAll("\\$token", token); CloseableHttpClient httpclient = HttpClients.createDefault(); CloseableHttpClient httpClient = HttpClients.createDefault(); try { HttpPost httpPost = new HttpPost(enterpriseWeChatPushUrlReplace); httpPost.setEntity(new StringEntity(data, charset)); CloseableHttpResponse response = httpclient.execute(httpPost); CloseableHttpResponse response = httpClient.execute(httpPost); String resp; try { HttpEntity entity = response.getEntity(); Loading @@ -179,8 +184,12 @@ public class EnterpriseWeChatUtils { } finally { response.close(); } logger.info("Enterprise WeChat send [{}], param:{}, resp:{}", enterpriseWeChatPushUrl, data, resp); logger.info("Enterprise WeChat send [{}], param:{}, resp:{}", enterpriseWeChatPushUrl, data, resp); return resp; } finally { httpClient.close(); } } /** Loading