From 85a815f9520e8c8d693037c4fbe9c9e44743c270 Mon Sep 17 00:00:00 2001 From: imbajin Date: Sat, 14 Jan 2023 02:02:35 +0800 Subject: [PATCH 1/4] chore: add rat check in ci --- .github/{workflows => outdated}/release.yml | 0 .github/workflows/license-checker.yml | 12 ++++++++++++ 2 files changed, 12 insertions(+) rename .github/{workflows => outdated}/release.yml (100%) diff --git a/.github/workflows/release.yml b/.github/outdated/release.yml similarity index 100% rename from .github/workflows/release.yml rename to .github/outdated/release.yml diff --git a/.github/workflows/license-checker.yml b/.github/workflows/license-checker.yml index 0a06c42a1..dc30d0e2b 100644 --- a/.github/workflows/license-checker.yml +++ b/.github/workflows/license-checker.yml @@ -40,3 +40,15 @@ jobs: with: log: info config: .licenserc.yaml + + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'adopt' + + - name: License check(RAT) + run: | + mvn apache-rat:check -ntp + find ./ -name rat.txt -print0 | xargs -0 -I file cat file > merged-rat.txt + grep "Binaries" merged-rat.txt -C 3 && cat merged-rat.txt From 0d09830c28b96838eede55a62d46210ab7e1f350 Mon Sep 17 00:00:00 2001 From: imbajin Date: Mon, 16 Jan 2023 22:51:29 +0800 Subject: [PATCH 2/4] Update pom.xml --- pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pom.xml b/pom.xml index c206e6b15..c9ac112c5 100644 --- a/pom.xml +++ b/pom.xml @@ -453,6 +453,14 @@ .repository/** **/.flattened-pom.xml + + **/.prettierrc + **/.stylelintrc + **/*.ts + **/*.tsx + **/*.less + **/*.svg + **/yarn.lock true From a51a3843bb43cf5f02f8f738df51843a1351f14f Mon Sep 17 00:00:00 2001 From: imbajin Date: Mon, 16 Jan 2023 23:02:52 +0800 Subject: [PATCH 3/4] Update pom.xml --- pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index c9ac112c5..13ffb9da5 100644 --- a/pom.xml +++ b/pom.xml @@ -454,13 +454,13 @@ .repository/** **/.flattened-pom.xml - **/.prettierrc - **/.stylelintrc - **/*.ts - **/*.tsx - **/*.less - **/*.svg - **/yarn.lock + .prettierrc + .stylelintrc + *.ts + *.tsx + *.less + *.svg + yarn.lock true From 021d7fc1489c0e906a1ccc0fdc0a586eafb87d16 Mon Sep 17 00:00:00 2001 From: imbajin Date: Wed, 8 Feb 2023 00:21:41 +0800 Subject: [PATCH 4/4] refactor the action files --- .github/workflows/check-dependencies.yml | 32 ------------------- .github/workflows/client-ci.yml | 2 +- .github/workflows/hubble-ci.yml | 10 +++--- .github/workflows/license-checker.yml | 31 +++++++++++++++--- .github/workflows/loader-ci.yml | 10 +++--- .github/workflows/stale.yml | 2 +- .github/workflows/tools-ci.yml | 12 +++---- .../hugegraph/config/TomcatServletConfig.java | 9 ++---- .../hugegraph/loader/util/ParquetUtil.java | 4 --- pom.xml | 8 ----- 10 files changed, 47 insertions(+), 73 deletions(-) delete mode 100644 .github/workflows/check-dependencies.yml diff --git a/.github/workflows/check-dependencies.yml b/.github/workflows/check-dependencies.yml deleted file mode 100644 index 448c12cbf..000000000 --- a/.github/workflows/check-dependencies.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: third-party dependencies check - -on: - push: - branches: - - master - - /^release-.*$/ - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - env: - STATIC_DIR: hugegraph-loader/assembly/static - SCRIPT_DEPENDENCY: hugegraph-dist/scripts/dependency - steps: - - name: Checkout source - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'adopt' - - name: mvn install - run: | - mvn install -DskipTests=true -Dmaven.javadoc.skip=true -ntp - - name: generate current dependencies - run: | - bash $SCRIPT_DEPENDENCY/regenerate_known_dependencies.sh current-dependencies.txt - - name: check third dependencies - run: | - bash $SCRIPT_DEPENDENCY/check_dependencies.sh diff --git a/.github/workflows/client-ci.yml b/.github/workflows/client-ci.yml index 7fc11a421..15488ae09 100644 --- a/.github/workflows/client-ci.yml +++ b/.github/workflows/client-ci.yml @@ -1,4 +1,4 @@ -name: hugegraph-client-ci +name: "hugegraph-client-ci" on: push: diff --git a/.github/workflows/hubble-ci.yml b/.github/workflows/hubble-ci.yml index 260564659..2c0edc8c4 100644 --- a/.github/workflows/hubble-ci.yml +++ b/.github/workflows/hubble-ci.yml @@ -1,4 +1,4 @@ -name: hugegraph-hubble-ci +name: "hugegraph-hubble-ci" on: push: @@ -22,19 +22,19 @@ on: env: TRAVIS_DIR: hugegraph-hubble/hubble-dist/assembly/travis - # TODO: need update it later + # TODO: need update it later (eed6103359fe40d2f1476fb8c56d9388c3111a99) COMMIT_ID: be6ee386b9939dc6bd6fcbdf2274b8acc3a0a314 jobs: hubble-ci: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: STATIC_DIR: hugegraph-hubble/hubble-dist/assembly/static steps: - - name: Install JDK 8 + - name: Install JDK 11 uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '11' distribution: 'adopt' # we also should cache python & yarn & downloads to avoid useless work diff --git a/.github/workflows/license-checker.yml b/.github/workflows/license-checker.yml index 1f2cd15ed..334519eab 100644 --- a/.github/workflows/license-checker.yml +++ b/.github/workflows/license-checker.yml @@ -17,22 +17,21 @@ # under the License. # -name: License checker +name: "license checker" on: push: branches: - master + - /^release-.*$/ pull_request: - branches: - - master jobs: - check-license: + check-license-header: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # A full-featured license tool to check and fix license headers and resolve dependencies' licenses: https://github.com/apache/skywalking-eyes + # More info could refer to: https://github.com/apache/skywalking-eyes - name: Check License Header uses: apache/skywalking-eyes@main env: @@ -51,3 +50,25 @@ jobs: mvn apache-rat:check -ntp find ./ -name rat.txt -print0 | xargs -0 -I file cat file > merged-rat.txt grep "Binaries" merged-rat.txt -C 3 && cat merged-rat.txt + + check-dependency-license: + runs-on: ubuntu-latest + env: + SCRIPT_DEPENDENCY: hugegraph-dist/scripts/dependency + steps: + - name: Checkout source + uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + - name: mvn install + run: | + mvn install -DskipTests=true -ntp + - name: generate current dependencies + run: | + bash $SCRIPT_DEPENDENCY/regenerate_known_dependencies.sh current-dependencies.txt + - name: check third dependencies + run: | + bash $SCRIPT_DEPENDENCY/check_dependencies.sh diff --git a/.github/workflows/loader-ci.yml b/.github/workflows/loader-ci.yml index c2f3b6264..ad4f52894 100644 --- a/.github/workflows/loader-ci.yml +++ b/.github/workflows/loader-ci.yml @@ -1,4 +1,4 @@ -name: hugegraph-loader-ci +name: "hugegraph-loader-ci" on: push: @@ -20,7 +20,7 @@ on: jobs: loader-ci: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: TRAVIS_DIR: hugegraph-loader/assembly/travis STATIC_DIR: hugegraph-loader/assembly/static @@ -29,11 +29,11 @@ jobs: DB_PASS: root DB_DATABASE: load_test steps: - - name: Install JDK 8 + - name: Install JDK 11 uses: actions/setup-java@v3 with: - java-version: '8' - distribution: 'zulu' + java-version: '11' + distribution: 'adopt' - name: Cache Maven packages uses: actions/cache@v3 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 8de32a4f7..3da563725 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,4 +1,4 @@ -name: Mark stale issues and pull requests +name: "Mark stale issues and pull requests" on: schedule: diff --git a/.github/workflows/tools-ci.yml b/.github/workflows/tools-ci.yml index 5e2c535a7..5028048cc 100644 --- a/.github/workflows/tools-ci.yml +++ b/.github/workflows/tools-ci.yml @@ -1,4 +1,4 @@ -name: hugegraph-tools-ci +name: "hugegraph-tools-ci" on: push: branches: @@ -19,17 +19,17 @@ on: jobs: tools-ci: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: TRAVIS_DIR: hugegraph-tools/assembly/travis - # TODO: could we use one param to unify it? or use a action template + # TODO: could we use one param to unify it? or use a action template (could use one ci file) COMMIT_ID: be6ee386b9939dc6bd6fcbdf2274b8acc3a0a314 steps: - - name: Install JDK 8 + - name: Install JDK 11 uses: actions/setup-java@v3 with: - java-version: '8' - distribution: 'zulu' + java-version: '11' + distribution: 'adopt' - name: Cache Maven packages uses: actions/cache@v3 with: diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/config/TomcatServletConfig.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/config/TomcatServletConfig.java index ffce8205b..9d0de09b1 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/config/TomcatServletConfig.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/config/TomcatServletConfig.java @@ -29,13 +29,10 @@ import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.stereotype.Component; -/** - * TODO: 404 not found & ensure if we need this class? - * Reference http://www.zizhixiaoshe.com/article/invalidcookie.html - */ +// TODO: remove this class if we don't need it anymore @Component -public class TomcatServletConfig - implements WebServerFactoryCustomizer { +public class TomcatServletConfig implements + WebServerFactoryCustomizer { @Autowired private HugeConfig config; diff --git a/hugegraph-loader/src/main/java/org/apache/hugegraph/loader/util/ParquetUtil.java b/hugegraph-loader/src/main/java/org/apache/hugegraph/loader/util/ParquetUtil.java index c719f4254..cafcbefbf 100644 --- a/hugegraph-loader/src/main/java/org/apache/hugegraph/loader/util/ParquetUtil.java +++ b/hugegraph-loader/src/main/java/org/apache/hugegraph/loader/util/ParquetUtil.java @@ -68,10 +68,6 @@ public static Object convertObject(Group group, int fieldIndex) { return object; } - /** - * TODO: ensure the refer is valid or rewrite it by ourselves - * Reference:https://stackoverflow.com/questions/53690299/int96value-to-date-string - */ private static Date dateFromInt96(Binary value) { byte[] int96Bytes = value.getBytes(); // Find Julian day diff --git a/pom.xml b/pom.xml index 1000917d2..3ec58ec9b 100644 --- a/pom.xml +++ b/pom.xml @@ -329,14 +329,6 @@ .repository/** **/.flattened-pom.xml - - .prettierrc - .stylelintrc - *.ts - *.tsx - *.less - *.svg - yarn.lock true