Unverified Commit c0ddadef authored by Rubik-W's avatar Rubik-W Committed by GitHub
Browse files

Merge branch 'dev' into removeUnnecessaryLock

parents d84512c9 f56ae9e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -69,6 +69,6 @@ jobs:
        uses: actions/upload-artifact@v1
        with:
          name: dslogs
          path: /var/lib/docker/volumes/docker-swarm_dolphinscheduler-logs/_data
          path: /var/lib/docker/volumes/dolphinscheduler-logs/_data

+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ jobs:
          -Dsonar.core.codeCoveragePlugin=jacoco
          -Dsonar.projectKey=apache-dolphinscheduler
          -Dsonar.login=e4058004bc6be89decf558ac819aa1ecbee57682
          -Dsonar.exclusions=dolphinscheduler-ui/src/**/i18n/locale/*.js
          -Dsonar.exclusions=dolphinscheduler-ui/src/**/i18n/locale/*.js,dolphinscheduler-microbench/src/**/*
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

package org.apache.dolphinscheduler.alert.utils;

import com.fasterxml.jackson.databind.JsonNode;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
@@ -109,4 +110,5 @@ public class JSONUtilsTest {

    }


}
+1 −1
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ public enum Status {
    DATA_IS_NOT_VALID(50017,"data {0} not valid", "数据[{0}]无效"),
    DATA_IS_NULL(50018,"data {0} is null", "数据[{0}]不能为空"),
    PROCESS_NODE_HAS_CYCLE(50019,"process node has cycle", "流程节点间存在循环依赖"),
    PROCESS_NODE_S_PARAMETER_INVALID(50020,"process node %s parameter invalid", "流程节点[%s]参数无效"),
    PROCESS_NODE_S_PARAMETER_INVALID(50020,"process node {0} parameter invalid", "流程节点[{0}]参数无效"),
    PROCESS_DEFINE_STATE_ONLINE(50021, "process definition {0} is already on line", "工作流定义[{0}]已上线"),
    DELETE_PROCESS_DEFINE_BY_ID_ERROR(50022,"delete process definition by id error", "删除工作流定义错误"),
    SCHEDULE_CRON_STATE_ONLINE(50023,"the status of schedule {0} is already on line", "调度配置[{0}]已上线"),
+13 −3
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang.StringUtils;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
@@ -159,8 +160,18 @@ public class DataSourceService extends BaseService{
            putMsg(result, Status.DATASOURCE_EXIST);
            return result;
        }
        //check password,if the password is not updated, set to the old password.
        JSONObject paramObject = JSON.parseObject(parameter);
        String password = paramObject.getString(Constants.PASSWORD);
        if (StringUtils.isBlank(password)) {
            String oldConnectionParams = dataSource.getConnectionParams();
            JSONObject oldParams = JSON.parseObject(oldConnectionParams);
            paramObject.put(Constants.PASSWORD, oldParams.getString(Constants.PASSWORD));
        }
        // connectionParams json
        String connectionParams = paramObject.toJSONString();

        Boolean isConnection = checkConnection(type, parameter);
        Boolean isConnection = checkConnection(type, connectionParams);
        if (!isConnection) {
            logger.info("connect failed, type:{}, parameter:{}", type, parameter);
            putMsg(result, Status.DATASOURCE_CONNECT_FAILED);
@@ -172,7 +183,7 @@ public class DataSourceService extends BaseService{
        dataSource.setNote(desc);
        dataSource.setUserName(loginUser.getUserName());
        dataSource.setType(type);
        dataSource.setConnectionParams(parameter);
        dataSource.setConnectionParams(connectionParams);
        dataSource.setUpdateTime(now);
        dataSourceMapper.updateById(dataSource);
        putMsg(result, Status.SUCCESS);
@@ -257,7 +268,6 @@ public class DataSourceService extends BaseService{
        map.put(PRINCIPAL, datasourceForm.getPrincipal());
        map.put(DATABASE, database);
        map.put(USER_NAME, datasourceForm.getUser());
        map.put(PASSWORD, datasourceForm.getPassword());
        map.put(OTHER, otherMap);
        result.put(Constants.DATA_LIST, map);
        putMsg(result, Status.SUCCESS);
Loading