From a87db4bb4cd67c195cfd7f84fe45872e0e722123 Mon Sep 17 00:00:00 2001 From: Thespica Date: Wed, 9 Oct 2024 20:18:16 +0800 Subject: [PATCH] remove unused code, add deprecated annotation, makr TODO in ci and script, adjust java version for client ci --- .github/workflows/client-ci.yml | 26 ++++++++++++------- .github/workflows/loader-ci.yml | 2 ++ .github/workflows/spark-connector-ci.yml | 2 ++ .../travis/install-hugegraph-from-source.sh | 1 + .../hugegraph/structure/schema/EdgeLabel.java | 21 ++++++++++----- .../travis/install-hugegraph-from-source.sh | 1 + .../travis/install-hugegraph-from-source.sh | 1 + 7 files changed, 38 insertions(+), 16 deletions(-) diff --git a/.github/workflows/client-ci.yml b/.github/workflows/client-ci.yml index eb89403f4..5e484b94a 100644 --- a/.github/workflows/client-ci.yml +++ b/.github/workflows/client-ci.yml @@ -28,14 +28,14 @@ jobs: COMMIT_ID: 6a4041e strategy: fail-fast: false -# matrix: -# JAVA_VERSION: [ '8' ] + matrix: + JAVA_VERSION: [ '8' ] steps: -# - name: Install JDK 8 -# uses: actions/setup-java@v3 -# with: -# java-version: ${{ matrix.JAVA_VERSION }} -# distribution: 'zulu' + - name: Install JDK 11 for server environment + uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: 'zulu' - name: Cache Maven packages uses: actions/cache@v3 @@ -61,13 +61,21 @@ jobs: - name: Prepare env and service run: | +# $TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID +# TODO(@Thespica): Replace the script while server is ready $TRAVIS_DIR/install-hugegraph-from-source.sh + - name: Install Java ${{ matrix.JAVA_VERSION }} for client + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.JAVA_VERSION }} + distribution: 'zulu' + - name: Run test run: | cd hugegraph-client && ls * - mvn test -Dtest=UnitTestSuite -ntp || true - mvn test -Dtest=ApiTestSuite || true + mvn test -Dtest=UnitTestSuite -ntp + mvn test -Dtest=ApiTestSuite mvn test -Dtest=FuncTestSuite - name: Upload coverage to Codecov diff --git a/.github/workflows/loader-ci.yml b/.github/workflows/loader-ci.yml index 2cc252b09..8012c63f5 100644 --- a/.github/workflows/loader-ci.yml +++ b/.github/workflows/loader-ci.yml @@ -64,6 +64,8 @@ jobs: run: | $TRAVIS_DIR/install-hadoop.sh $TRAVIS_DIR/install-mysql.sh ${{ env.DB_DATABASE }} ${{ env.DB_PASS }} +# $TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID +# TODO(@Thespica): Replace the script while server is ready $TRAVIS_DIR/install-hugegraph-from-source.sh - name: Run test diff --git a/.github/workflows/spark-connector-ci.yml b/.github/workflows/spark-connector-ci.yml index a2183b119..603d746c9 100644 --- a/.github/workflows/spark-connector-ci.yml +++ b/.github/workflows/spark-connector-ci.yml @@ -57,6 +57,8 @@ jobs: - name: Prepare env and service run: | +# $TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID +# TODO(@Thespica): Replace the script while server is ready $TRAVIS_DIR/install-hugegraph-from-source.sh - name: Run test diff --git a/hugegraph-client/assembly/travis/install-hugegraph-from-source.sh b/hugegraph-client/assembly/travis/install-hugegraph-from-source.sh index 250be0c3c..84fcda437 100755 --- a/hugegraph-client/assembly/travis/install-hugegraph-from-source.sh +++ b/hugegraph-client/assembly/travis/install-hugegraph-from-source.sh @@ -17,6 +17,7 @@ # set -ev +# TODO(@Thespica): restore the script while server is ready #if [[ $# -ne 1 ]]; then # echo "Must input an existing commit id of hugegraph server" && exit 1 #fi diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/EdgeLabel.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/EdgeLabel.java index 62633443e..bbc8e544c 100644 --- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/EdgeLabel.java +++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/EdgeLabel.java @@ -44,11 +44,6 @@ public class EdgeLabel extends SchemaLabel { private String parentLabel; @JsonProperty("frequency") private Frequency frequency; - // TODO(@Thespica): remove unused documented code -// @JsonProperty("source_label") -// private String sourceLabel; -// @JsonProperty("target_label") -// private String targetLabel; @JsonProperty("links") private Set> links; @JsonProperty("sort_keys") @@ -263,6 +258,8 @@ public Builder link(String sourceLabel, String targetLabel) { HashMap map = new HashMap<>(); map.put(sourceLabel, targetLabel); this.edgeLabel.links.add(map); + this.sourceLabel = null; + this.targetLabel = null; return this; } @@ -286,7 +283,12 @@ public Builder asGeneral() { } - // TODO(@Thespcia): should be marked as @Deprecated? + /** + * Set the source label of the edge label + * @deprecated + * Suggested use {@link #link(String, String)} to set the source and target label pair + */ + @Deprecated @Override public Builder sourceLabel(String label) { E.checkArgument(this.edgeLabel.links.isEmpty(), @@ -296,7 +298,12 @@ public Builder sourceLabel(String label) { return this; } - // TODO(@Thespcia): should be marked as @Deprecated? + /** + * Set the target label of the edge label + * @deprecated + * Suggested use {@link #link(String, String)} to set the source and target label pair + */ + @Deprecated @Override public Builder targetLabel(String label) { E.checkArgument(this.edgeLabel.links.isEmpty(), diff --git a/hugegraph-loader/assembly/travis/install-hugegraph-from-source.sh b/hugegraph-loader/assembly/travis/install-hugegraph-from-source.sh index 4ab75b529..43820edc6 100755 --- a/hugegraph-loader/assembly/travis/install-hugegraph-from-source.sh +++ b/hugegraph-loader/assembly/travis/install-hugegraph-from-source.sh @@ -17,6 +17,7 @@ # set -ev +# TODO(@Thespica): restore the script while server is ready #if [[ $# -ne 1 ]]; then # echo "Must input an existing commit id of hugegraph server" && exit 1 #fi diff --git a/hugegraph-spark-connector/assembly/travis/install-hugegraph-from-source.sh b/hugegraph-spark-connector/assembly/travis/install-hugegraph-from-source.sh index 4ab75b529..43820edc6 100755 --- a/hugegraph-spark-connector/assembly/travis/install-hugegraph-from-source.sh +++ b/hugegraph-spark-connector/assembly/travis/install-hugegraph-from-source.sh @@ -17,6 +17,7 @@ # set -ev +# TODO(@Thespica): restore the script while server is ready #if [[ $# -ne 1 ]]; then # echo "Must input an existing commit id of hugegraph server" && exit 1 #fi