Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refact(core): adaptor for common 1.2 & fix a string of possible CI problem #286

Merged
merged 41 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
06f1130
chore(ci): update common 1.2 & upgrade action version
imbajin Nov 22, 2023
7e8e021
replace HTTP_CODE
imbajin Nov 22, 2023
b6d260c
Update codeql-analysis.yml
imbajin Nov 22, 2023
bf0dc10
Merge branch 'master' into pr/286
imbajin Dec 5, 2023
568134f
Update pom.xml
imbajin Dec 5, 2023
adf4c43
use docker image for server
imbajin Dec 5, 2023
9d0e477
update webmockserver version to adapt okhttp4.x
imbajin Dec 5, 2023
3e894d3
remove useless client
imbajin Dec 5, 2023
b0f82c6
Revert "remove useless client"
imbajin Dec 5, 2023
9d0f779
chore: replace loading data with docker & fix AssertThrows
imbajin Dec 5, 2023
327f446
update loader image name
imbajin Dec 5, 2023
9a8f736
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
32b4cb9
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
eeaee79
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
06343fd
change path
imbajin Dec 5, 2023
317e9ab
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
3849038
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
e85856f
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
4256911
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
d8b725e
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
2e1221f
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
ce8af87
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
990f931
fix name
imbajin Dec 5, 2023
1385dc9
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
91f300d
update ci logic
imbajin Dec 5, 2023
55ceb52
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
7a3d41a
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
80811d4
Update load-data-into-hugegraph.sh
imbajin Dec 5, 2023
126e115
Update WorkerServiceTest.java
imbajin Dec 6, 2023
4d47f48
Merge branch 'master' into pr/286
imbajin Dec 6, 2023
ce5dddc
update data path
imbajin Dec 6, 2023
0fad470
refactor WorkerServer
imbajin Dec 6, 2023
c2273cf
update the WokerService init & close logic
imbajin Dec 7, 2023
8af9d5a
Update MasterService.java
imbajin Dec 7, 2023
b223826
CI passed & revert the ignore
imbajin Dec 7, 2023
4f4b2c5
Update MessageRecvManagerTest.java
imbajin Dec 7, 2023
80ac743
enable 3rd party check
imbajin Dec 7, 2023
45c9add
Update license-checker.yml
imbajin Dec 7, 2023
ce2849d
Update computer-core/src/main/java/org/apache/hugegraph/computer/core…
imbajin Dec 8, 2023
7541287
Update MasterService.java
imbajin Dec 8, 2023
7be91f2
tiny fix
imbajin Dec 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/configs/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!--
Licensed to the 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.
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 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.
-->

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>github</id>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>

<profiles>
<profile>
<id>local-repo</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>staged-releases</id>
<url>https://repository.apache.org/content/groups/staging/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>staged-releases</id>
<url>https://repository.apache.org/content/groups/staging/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

<activeProfiles>
<activeProfile>local-repo</activeProfile>
</activeProfiles>
</settings>
30 changes: 19 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ jobs:
computer-ci:
runs-on: ubuntu-latest
env:
USE_STAGE: 'true' # Whether to include the stage repository.
TRAVIS_DIR: computer-dist/src/assembly/travis
KUBERNETES_VERSION: 1.20.1
HUGEGRAPH_SERVER_COMMIT_ID: d01c8737d7d5909119671953521f1401dcd1a188
BSP_ETCD_URL: http://localhost:2579
# TODO: delete this env in the future (replaced by docker way now)
HUGEGRAPH_SERVER_COMMIT_ID: d01c8737d7d5909119671953521f1401dcd1a188

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2

Expand Down Expand Up @@ -57,33 +59,38 @@ jobs:
- name: Setup Minikube-Kubernetes
run: $TRAVIS_DIR/install-k8s.sh

- name: Check Component
run: |
sleep 5
curl localhost:9000
kubectl get nodes

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Check Component
run: |
curl localhost:9000
kubectl get nodes

- name: Prepare env and service
run: |
$TRAVIS_DIR/install-env.sh
$TRAVIS_DIR/install-hugegraph-from-source.sh $HUGEGRAPH_SERVER_COMMIT_ID
$TRAVIS_DIR/load-data-into-hugegraph.sh
#$TRAVIS_DIR/install-hugegraph-from-source.sh $HUGEGRAPH_SERVER_COMMIT_ID

- name: Install JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'

- name: Use staged maven repo
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml
mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml

- name: Compile
run: mvn clean compile -Dmaven.javadoc.skip=true -ntp
run: mvn clean compile -e -Dmaven.javadoc.skip=true -ntp

- name: Integrate test
run: mvn test -P integrate-test -ntp
Expand All @@ -92,6 +99,7 @@ jobs:
run: mvn test -P unit-test -ntp

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.0.0
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: target/site/jacoco/jacoco.xml
70 changes: 42 additions & 28 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ name: "CodeQL"

on:
pull_request:
# The branches below must be a subset of the branches above, now enable it in all PR
# branches: [ master ]
# The branches below must be a subset of the branches above, now enable it in all PR
# branches: [ master ]
schedule:
- cron: '45 7 * * 1'

jobs:
analyze:
env:
USE_STAGE: 'true' # Whether to include the stage repository.
name: Analyze
runs-on: ubuntu-latest
permissions:
Expand All @@ -24,43 +26,55 @@ jobs:
language: [ 'go', 'java' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: use staged maven repo settings
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml
mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

#- run: |
# make bootstrap
# make release
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3

50 changes: 27 additions & 23 deletions .github/workflows/license-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
check-license-header:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# More info could refer to: https://github.com/apache/skywalking-eyes
- name: Check License Header
uses: apache/skywalking-eyes@main
Expand All @@ -36,25 +36,29 @@ jobs:
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

# TODO: enable it later
# check-dependency-license:
# runs-on: ubuntu-latest
# env:
# SCRIPT_DEPENDENCY: computer-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
check-dependency-license:
runs-on: ubuntu-latest
env:
SCRIPT_DEPENDENCY: computer-dist/scripts/dependency
USE_STAGE: 'true' # Whether to include the stage repository.
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Use staged maven repo settings
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml
mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml
- name: Compile install
run: mvn package -DskipTests=true -ntp

# TODO: enable it after the check scripts are ready, lack them now
#- name: Generate & check current 3rd-party dependencies
# run: |
# bash $SCRIPT_DEPENDENCY/regenerate_known_dependencies.sh current-dependencies.txt
# bash $SCRIPT_DEPENDENCY/check_dependencies.sh
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/stale@v3
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label'
Expand Down
6 changes: 4 additions & 2 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<module name="TreeWalker">
<!--检查行长度-->
<module name="LineLength">
<property name="max" value="100"/>
<!-- Use 101 due to some legacy code reason -->
<property name="max" value="101"/>
<!--可以忽略的行-->
<property name="ignorePattern"
value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
Expand Down Expand Up @@ -84,7 +85,8 @@
<module name="WhitespaceAround"/>
<!--左圆括号之后和右圆括号之前是否需要有一个空格,不需要-->
<module name="ParenPad"/>
<!--检查修饰符是否符合Java建议,顺序是:public、protected、private、abstract、default、static、final、transient、volatile、synchronized、native、strictfp-->
<!--检查修饰符是否符合Java建议,顺序是:public、protected、private、abstract、default、static、
final、transient、volatile、synchronized、native、strictfp-->
<module name="ModifierOrder"/>
<!--检查代码块的左花括号的放置位置,必须在当前行的末尾-->
<module name="LeftCurly">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public final class Constants {
public static final int FUTURE_TIMEOUT = 300;

/*
* The timeout in millisecond for threadpool shutdown
* The timeout in millisecond for thread-pool shutdown
*/
public static final long SHUTDOWN_TIMEOUT = 5000L;

Expand Down
Loading
Loading