From fb5501f590713857cd28550cc63f966b2080ef2e Mon Sep 17 00:00:00 2001 From: guohaozhang Date: Thu, 14 Jan 2021 18:41:34 +0800 Subject: [PATCH 1/4] [Fix-4455][common] fix parse shell output (#4456) --- .../org/apache/dolphinscheduler/common/shell/ShellExecutor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/ShellExecutor.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/ShellExecutor.java index 7267447718..8d2b768084 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/ShellExecutor.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/ShellExecutor.java @@ -140,8 +140,8 @@ public class ShellExecutor extends AbstractShell { String line = ""; while ( (nRead = lines.read(buf, 0, buf.length)) > 0 ) { line = new String(buf,0,nRead); + output.append(line); } - output.append(line); } /** From b6ce3cfdf0cd4206028072bac9a00a9272e6e79f Mon Sep 17 00:00:00 2001 From: Kirs Date: Fri, 15 Jan 2021 07:59:48 +0800 Subject: [PATCH 2/4] [FIX][UT]testVerifyTenantCode assert error (#4460) * [FIX][UT]testVerifyTenantCode assert error * [FIX][UT]testVerifyTenantCode assert error * code smell --- .../api/service/TenantServiceTest.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TenantServiceTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TenantServiceTest.java index 5310eabc1c..2fea76d93f 100644 --- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TenantServiceTest.java +++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TenantServiceTest.java @@ -35,7 +35,6 @@ import org.apache.dolphinscheduler.dao.mapper.UserMapper; import java.util.ArrayList; import java.util.List; -import java.util.Locale; import java.util.Map; import org.junit.Assert; @@ -81,7 +80,7 @@ public class TenantServiceTest { try { //check tenantCode Map result = - tenantService.createTenant(getLoginUser(), "%!1111", 1, "TenantServiceTest"); + tenantService.createTenant(getLoginUser(), "%!1111", 1, "TenantServiceTest"); logger.info(result.toString()); Assert.assertEquals(Status.VERIFY_OS_TENANT_CODE_ERROR, result.get(Constants.STATUS)); @@ -109,7 +108,7 @@ public class TenantServiceTest { page.setRecords(getList()); page.setTotal(1L); Mockito.when(tenantMapper.queryTenantPaging(Mockito.any(Page.class), Mockito.eq("TenantServiceTest"))) - .thenReturn(page); + .thenReturn(page); Map result = tenantService.queryTenantList(getLoginUser(), "TenantServiceTest", 1, 10); logger.info(result.toString()); PageInfo pageInfo = (PageInfo) result.get(Constants.DATA_LIST); @@ -124,7 +123,7 @@ public class TenantServiceTest { try { // id not exist Map result = - tenantService.updateTenant(getLoginUser(), 912222, tenantCode, 1, "desc"); + tenantService.updateTenant(getLoginUser(), 912222, tenantCode, 1, "desc"); logger.info(result.toString()); // success Assert.assertEquals(Status.TENANT_NOT_EXIST, result.get(Constants.STATUS)); @@ -143,7 +142,7 @@ public class TenantServiceTest { Mockito.when(tenantMapper.queryById(1)).thenReturn(getTenant()); Mockito.when(processInstanceMapper.queryByTenantIdAndStatus(1, Constants.NOT_TERMINATED_STATES)) - .thenReturn(getInstanceList()); + .thenReturn(getInstanceList()); Mockito.when(processDefinitionMapper.queryDefinitionListByTenant(2)).thenReturn(getDefinitionsList()); Mockito.when(userMapper.queryUserListByTenant(3)).thenReturn(getUserList()); @@ -191,14 +190,7 @@ public class TenantServiceTest { Assert.assertEquals(Status.SUCCESS.getMsg(), result.getMsg()); // tenantCode exist result = tenantService.verifyTenantCode(getTenant().getTenantCode()); - String resultString; - if (Locale.SIMPLIFIED_CHINESE.getLanguage().equals(LocaleContextHolder.getLocale().getLanguage())) { - resultString = "操作系统租户[TenantServiceTest]已存在"; - } else { - resultString = "tenant code TenantServiceTest already exists"; - } - logger.info(result.toString()); - Assert.assertEquals(resultString, result.getMsg()); + Assert.assertEquals(Status.OS_TENANT_CODE_EXIST.getCode(), result.getCode().intValue()); } /** From 54e110d17b2558c05ed896d383897ff7e9fdfdea Mon Sep 17 00:00:00 2001 From: Hxssssss Date: Fri, 15 Jan 2021 10:32:16 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix=20the=20exception=20of=20update=20null?= =?UTF-8?q?=20point=20of=20workflow=20instance=20due=20to=20no=E2=80=A6=20?= =?UTF-8?q?(#4459)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix the exception of update null point of workflow instance due to not add global parameter when create workflow definition * optimization of the leading package Co-authored-by: yaoshui --- .../dolphinscheduler/api/service/ProcessInstanceService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java index 739fa19735..3f55fae66f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java @@ -66,11 +66,13 @@ import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.text.ParseException; import java.util.ArrayList; +import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.stream.Collectors; import org.slf4j.Logger; @@ -449,7 +451,7 @@ public class ProcessInstanceService extends BaseService { originDefParams = JSONUtils.toJsonString(processData.getGlobalParams()); List globalParamList = processData.getGlobalParams(); - Map globalParamMap = globalParamList.stream().collect(Collectors.toMap(Property::getProp, Property::getValue)); + Map globalParamMap = Optional.ofNullable(globalParamList).orElse(Collections.emptyList()).stream().collect(Collectors.toMap(Property::getProp, Property::getValue)); globalParams = ParameterUtils.curingGlobalParams(globalParamMap, globalParamList, processInstance.getCmdTypeIfComplement(), schedule); timeout = processData.getTimeout(); From a6becd8c264257256ad7865f082a6e8767725a55 Mon Sep 17 00:00:00 2001 From: Zhenxu Ke Date: Fri, 15 Jan 2021 11:18:37 +0800 Subject: [PATCH 4/4] chore: set up license-eye to check license headers (#4453) --- .github/workflows/ci_backend.yml | 12 ++--- .github/workflows/ci_e2e.yml | 10 ++--- .github/workflows/ci_frontend.yml | 24 +--------- .github/workflows/ci_ut.yml | 22 ++++------ .licenserc.yaml | 43 ++++++++++++++++++ .../src/js/module/visibility/index.js | 2 +- pom.xml | 44 ------------------- 7 files changed, 63 insertions(+), 94 deletions(-) create mode 100644 .licenserc.yaml diff --git a/.github/workflows/ci_backend.yml b/.github/workflows/ci_backend.yml index c24a3ecf07..7b245d77ef 100644 --- a/.github/workflows/ci_backend.yml +++ b/.github/workflows/ci_backend.yml @@ -46,18 +46,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # In the checkout@v2, it doesn't support git submodule. Execute the commands manually. - - name: checkout submodules - shell: bash - run: | - git submodule sync --recursive - git -c protocol.version=2 submodule update --init --force --recursive --depth=1 + with: + submodule: true + - name: Check License Header + uses: apache/skywalking-eyes@9bd5feb - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Check license - run: ./mvnw -B apache-rat:check - name: Compile run: mvn -B clean compile install -Prelease -Dmaven.test.skip=true - name: Check dependency license diff --git a/.github/workflows/ci_e2e.yml b/.github/workflows/ci_e2e.yml index 8070d7e0c5..3e781056d0 100644 --- a/.github/workflows/ci_e2e.yml +++ b/.github/workflows/ci_e2e.yml @@ -30,12 +30,10 @@ jobs: steps: - uses: actions/checkout@v2 - # In the checkout@v2, it doesn't support git submodule. Execute the commands manually. - - name: checkout submodules - shell: bash - run: | - git submodule sync --recursive - git -c protocol.version=2 submodule update --init --force --recursive --depth=1 + with: + submodule: true + - name: Check License Header + uses: apache/skywalking-eyes@9bd5feb - uses: actions/cache@v1 with: path: ~/.m2/repository diff --git a/.github/workflows/ci_frontend.yml b/.github/workflows/ci_frontend.yml index 1feaabaeb3..afa0c8d672 100644 --- a/.github/workflows/ci_frontend.yml +++ b/.github/workflows/ci_frontend.yml @@ -35,12 +35,8 @@ jobs: os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v2 - # In the checkout@v2, it doesn't support git submodule. Execute the commands manually. - - name: checkout submodules - shell: bash - run: | - git submodule sync --recursive - git -c protocol.version=2 submodule update --init --force --recursive --depth=1 + with: + submodule: true - name: Set up Node.js uses: actions/setup-node@v1 with: @@ -52,19 +48,3 @@ jobs: npm install npm run lint npm run build - License-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - # In the checkout@v2, it doesn't support git submodule. Execute the commands manually. - - name: checkout submodules - shell: bash - run: | - git submodule sync --recursive - git -c protocol.version=2 submodule update --init --force --recursive --depth=1 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Check - run: mvn -B apache-rat:check \ No newline at end of file diff --git a/.github/workflows/ci_ut.yml b/.github/workflows/ci_ut.yml index 739c9be7fa..09542d97f1 100644 --- a/.github/workflows/ci_ut.yml +++ b/.github/workflows/ci_ut.yml @@ -33,12 +33,12 @@ jobs: steps: - uses: actions/checkout@v2 - # In the checkout@v2, it doesn't support git submodule. Execute the commands manually. - - name: checkout submodules - shell: bash - run: | - git submodule sync --recursive - git -c protocol.version=2 submodule update --init --force --recursive --depth=1 + with: + submodule: true + - name: Check License Header + uses: apache/skywalking-eyes@9bd5feb + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Only enable review / suggestion here - uses: actions/cache@v1 with: path: ~/.m2/repository @@ -98,12 +98,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - # In the checkout@v2, it doesn't support git submodule. Execute the commands manually. - - name: checkout submodules - shell: bash - run: | - git submodule sync --recursive - git -c protocol.version=2 submodule update --init --force --recursive --depth=1 + with: + submodule: true - name: check code style env: WORKDIR: ./ @@ -117,4 +113,4 @@ jobs: | /opt/reviewdog -f=checkstyle \ -reporter="${INPUT_REPORTER:-github-pr-check}" \ -filter-mode="${INPUT_FILTER_MODE:-added}" \ - -fail-on-error="${INPUT_FAIL_ON_ERROR:-false}" \ No newline at end of file + -fail-on-error="${INPUT_FAIL_ON_ERROR:-false}" diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 0000000000..ea6909e240 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,43 @@ +# Licensed to 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. Apache Software Foundation (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. + +header: + license: + spdx-id: Apache-2.0 + copyright-owner: Apache Software Foundation + + paths-ignore: + - dist + - NOTICE + - LICENSE + - DISCLAIMER + - dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ScriptRunner.java + - mvnw.cmd + - sql/soft_version + - .mvn + - .gitattributes + - '**/licenses/**/LICENSE-*' + - '**/*.md' + - '**/*.json' + - '**/*.iml' + - '**/.babelrc' + - '**/.eslintignore' + - '**/.gitignore' + - '**/LICENSE' + - '**/NOTICE' + + comment: on-failure diff --git a/dolphinscheduler-ui/src/js/module/visibility/index.js b/dolphinscheduler-ui/src/js/module/visibility/index.js index 666ffaaf03..c3b50c60d0 100644 --- a/dolphinscheduler-ui/src/js/module/visibility/index.js +++ b/dolphinscheduler-ui/src/js/module/visibility/index.js @@ -3,7 +3,7 @@ * 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 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 diff --git a/pom.xml b/pom.xml index 721cdc84d6..be9e85a7ab 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,6 @@ 0.238.1 3.1.12 3.0.0 - 0.13 3.4.14 1.6 3.3 @@ -924,49 +923,6 @@ - - org.apache.rat - apache-rat-plugin - ${apache.rat.version} - - false - false - - - AL20 - Apache License, 2.0 - - Licensed to the Apache Software Foundation (ASF) - - - - - - Apache License, 2.0 - - - - **/node_modules/** - **/node/** - **/dist/** - **/licenses/** - .github/** - **/sql/soft_version - **/common/utils/ScriptRunner.java - **/*.json - - **/*.md - **/*.MD - **/*.txt - **/docs/** - **/*.babelrc - **/*.eslint* - **/.mvn/jvm.config - **/.mvn/wrapper/** - - true - - com.github.spotbugs spotbugs-maven-plugin