Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/3.3' into jsonutil-customize
Browse files Browse the repository at this point in the history
# Conflicts:
#	dubbo-remoting/dubbo-remoting-http12/src/test/java/org/apache/dubbo/remoting/http12/message/codec/CodeUtilsTest.java
#	dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h12/http2/CompositeExceptionHandler.java
  • Loading branch information
oxsean committed Sep 5, 2024
2 parents abdbe0d + 45c007c commit 27dd643
Show file tree
Hide file tree
Showing 196 changed files with 4,834 additions and 2,343 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ ij_java_extends_list_wrap = normal
ij_java_extends_keyword_wrap = normal
ij_java_binary_operation_wrap = normal
ij_java_binary_operation_sign_on_next_line = true
ij_java_generate_final_locals = false
ij_java_generate_final_parameters = false

[*.groovy]
max_line_length = 180
Expand Down
154 changes: 105 additions & 49 deletions .github/workflows/build-and-test-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Test For PR
name: "Build and Test For PR"

on: [push, pull_request, workflow_dispatch]

Expand All @@ -16,41 +16,56 @@ env:
spring.version:5.3.24;
spring-boot.version:2.7.6;
'
MAVEN_OPTS: >-
-XX:+UseG1GC
-XX:InitiatingHeapOccupancyPercent=45
-XX:+UseStringDeduplication
-XX:-TieredCompilation
-XX:TieredStopAtLevel=1
-Dmaven.javadoc.skip=true
-Dmaven.wagon.http.retryHandler.count=5
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
MAVEN_ARGS: >-
-e
--batch-mode
--no-snapshot-updates
--no-transfer-progress
--fail-fast
jobs:
check-format:
name: Check if code needs formatting
name: "Check if code needs formatting"
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: "Checkout"
uses: actions/checkout@v4
- name: Setup Maven
- name: "Setup Maven"
uses: actions/setup-java@v4
with:
java-version: 21
distribution: zulu
- name: Check if code aligns with code style
- name: "Check if code aligns with code style"
id: check
run: mvn --log-file mvn.log spotless:check
continue-on-error: true
- name: Upload checkstyle result
- name: "Upload checkstyle result"
uses: actions/upload-artifact@v4
with:
name: checkstyle-result
path: mvn.log
- name: Generate Summary for successful run
- name: "Generate Summary for successful run"
if: ${{ steps.check.outcome == 'success' }}
run: |
echo ":ballot_box_with_check: Kudos! No formatting issues found!" >> $GITHUB_STEP_SUMMARY
- name: Generate Summary for failed run
- name: "Generate Summary for failed run"
if: ${{ steps.check.outcome == 'failure' }}
run: |
echo "## :negative_squared_cross_mark: Formatting issues found!" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
cat mvn.log | grep "ERROR" | sed 's/Check if code needs formatting Check if code aligns with code style [0-9A-Z:.-]\+//' | sed 's/\[ERROR] //' | head -n -11 >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "Please run \`mvn spotless:apply\` to fix the formatting issues." >> $GITHUB_STEP_SUMMARY
- name: Fail if code needs formatting
- name: "Fail if code needs formatting"
if: ${{ steps.check.outcome == 'failure' }}
uses: actions/[email protected]
with:
Expand All @@ -64,7 +79,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check License
- name: "Check License"
uses: apache/skywalking-eyes@e1a02359b239bd28de3f6d35fdc870250fa513d5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -75,8 +90,8 @@ jobs:
java-version: 21
- name: "Compile Dubbo (Linux)"
run: |
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
- name: Check Dependencies' License
./mvnw ${{ env.MAVEN_ARGS }} -T 2C clean install -Pskip-spotless -Dmaven.test.skip=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true
- name: "Check Dependencies' License"
uses: apache/skywalking-eyes/dependency@e1a02359b239bd28de3f6d35fdc870250fa513d5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -91,30 +106,48 @@ jobs:
outputs:
version: ${{ steps.dubbo-version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: "Checkout code"
uses: actions/checkout@v3
with:
path: dubbo
- uses: actions/setup-java@v3
- name: "Set up JDK"
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 21
- uses: actions/cache@v3
name: "Cache local Maven repository"
- name: "Set current date as env variable"
run: echo "TODAY=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: "Restore local Maven repository cache"
uses: actions/cache/restore@v4
id: cache-maven-repository
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.TODAY }}
- name: "Restore common local Maven repository cache"
uses: actions/cache/restore@v4
if: steps.cache-maven-repository.outputs.cache-hit != 'true'
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
- name: "Dubbo cache"
uses: actions/cache@v3
with:
path: ~/.m2/repository/org/apache/dubbo
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
- name: "Build Dubbo with Maven"
run: |
cd ./dubbo
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
./mvnw ${{ env.MAVEN_ARGS }} clean install -Psources,'!demo',skip-spotless,checkstyle -Dmaven.test.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
- name: "Save local Maven repository cache"
uses: actions/cache/save@v4
if: steps.cache-maven-repository.outputs.cache-hit != 'true'
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.TODAY }}
- name: "Inspect dubbo cache"
run: find ~/.m2/repository/org/apache/dubbo -type f
- name: "Save dubbo cache"
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository/org/apache/dubbo
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
- name: "Pack class result"
run: |
shopt -s globstar
Expand All @@ -128,8 +161,8 @@ jobs:
if: failure()
run: zip ${{ github.workspace }}/checkstyle.zip *checkstyle* -r
- name: "Upload checkstyle file if failure"
if: failure()
uses: actions/upload-artifact@v3
if: failure()
with:
name: "checkstyle-file"
path: ${{ github.workspace }}/checkstyle.zip
Expand All @@ -149,17 +182,17 @@ jobs:
env:
ZOOKEEPER_VERSION: 3.6.3
steps:
- uses: actions/cache@v3
name: "Cache zookeeper binary archive"
- name: "Cache zookeeper binary archive"
uses: actions/cache@v3
id: "cache-zookeeper"
with:
path: ${{ github.workspace }}/.tmp/zookeeper
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
restore-keys: |
zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
- name: "Set up msys2 if necessary"
if: ${{ startsWith( matrix.os, 'windows') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
uses: msys2/setup-msys2@v2
if: ${{ startsWith( matrix.os, 'windows') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
with:
release: false # support cache, see https://github.com/msys2/setup-msys2#context
- name: "Download zookeeper binary archive in Linux OS"
Expand All @@ -183,25 +216,29 @@ jobs:
env:
DISABLE_FILE_SYSTEM_TEST: true
CURRENT_ROLE: ${{ matrix.case-role }}
ZOOKEEPER_VERSION: 3.6.3
steps:
- uses: actions/checkout@v3
- name: "Checkout code"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Set up JDK ${{ matrix.jdk }}"
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 21
- uses: actions/cache@v3
name: "Cache local Maven repository"
- name: "Set current date as env variable"
run: echo "TODAY=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: "Cache local Maven repository"
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.TODAY }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
- uses: actions/cache@v3
name: "Cache zookeeper binary archive"
- name: "Cache zookeeper binary archive"
uses: actions/cache@v3
id: "cache-zookeeper"
with:
path: ${{ github.workspace }}/.tmp/zookeeper
Expand All @@ -211,7 +248,11 @@ jobs:
- name: "Test with Maven"
timeout-minutes: 90
run: |
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Pjacoco,jdk15ge-simple,'!jdk15ge',jacoco089 -DtrimStackTrace=false -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
set -o pipefail
./mvnw ${{ env.MAVEN_ARGS }} clean test verify -Pjacoco,jdk15ge-simple,'!jdk15ge','!demo',skip-spotless,jacoco089 -DtrimStackTrace=false -Dmaven.test.skip=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper 2>&1 | tee >(grep -n -B 1 -A 200 "FAILURE! -- in" > test_errors.log)
- name: "Print test error log"
if: failure()
run: cat test_errors.log
- name: "Upload coverage result"
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -253,16 +294,18 @@ jobs:
with:
repository: 'apache/dubbo-samples'
ref: master
- name: "Set current date as env variable"
run: echo "TODAY=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: "Cache local Maven repository"
uses: actions/cache@v3
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.TODAY }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
- name: "Restore Dubbo cache"
uses: actions/cache@v3
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository/org/apache/dubbo
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
Expand Down Expand Up @@ -357,16 +400,18 @@ jobs:
with:
repository: 'apache/dubbo-integration-cases'
ref: main
- name: "Set current date as env variable"
run: echo "TODAY=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: "Cache local Maven repository"
uses: actions/cache@v3
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.TODAY }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
- name: "Restore Dubbo cache"
uses: actions/cache@v3
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository/org/apache/dubbo
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
Expand Down Expand Up @@ -502,17 +547,25 @@ jobs:
with:
distribution: 'zulu'
java-version: 21

- name: "Restore local Maven repository cache"
uses: actions/cache/restore@v4
id: cache-maven-repository
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.TODAY }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
- name: "Compile Dubbo (Linux)"
run: |
cd ${{ github.workspace }}/dubbo
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
./mvnw ${{ env.MAVEN_ARGS }} -T 2C clean install -P '!demo',skip-spotless -Dmaven.test.skip=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true
- name: "Run Error Code Inspecting"
env:
DUBBO_ECI_REPORT_AS_ERROR: true
run: |
cd ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector
../mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C package exec:java -Ddubbo.eci.report-as-error=${DUBBO_ECI_REPORT_AS_ERROR} -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -Ddubbo.eci.path=${{ github.workspace }}/dubbo
../mvnw ${{ env.MAVEN_ARGS }} -T 2C package exec:java -Ddubbo.eci.report-as-error=${DUBBO_ECI_REPORT_AS_ERROR} -Dmaven.test.skip=true -Ddubbo.eci.path=${{ github.workspace }}/dubbo
- name: "Upload error code inspection result"
# always() should not be used here, since we don't need to handle the 'canceled' situation.
Expand Down Expand Up @@ -554,13 +607,16 @@ jobs:
- name: "Compile Dubbo (Linux)"
run: |
cd ${{ github.workspace }}/dubbo
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
./mvnw ${{ env.MAVEN_ARGS }} -T 2C clean install -P '!demo',skip-spotless -Dmaven.test.skip=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true
- name: "Compile and run Dubbo demo for native (Linux)"
run: |
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-interface
MVNW="${{ github.workspace }}/dubbo/mvnw ${{ env.MAVEN_ARGS }} -T 2C -Dmaven.test.skip=true"
$MVNW clean install
cd ../dubbo-demo-native-provider
$MVNW clean package -P native native:compile
nohup ./target/dubbo-demo-native-provider &
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
cd ../dubbo-demo-native-consumer
$MVNW clean package -P native native:compile
./target/dubbo-demo-native-consumer
13 changes: 8 additions & 5 deletions .github/workflows/build-and-test-scheduled-3.3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -490,13 +490,16 @@ jobs:
- name: "Compile Dubbo (Linux)"
run: |
cd ${{ github.workspace }}/dubbo
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
./mvnw ${{ env.MAVEN_ARGS }} -T 2C clean install -P '!demo',skip-spotless -Dmaven.test.skip=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true
- name: "Compile and run Dubbo demo for native (Linux)"
run: |
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-interface
MVNW="${{ github.workspace }}/dubbo/mvnw ${{ env.MAVEN_ARGS }} -T 2C -Dmaven.test.skip=true"
$MVNW clean install
cd ../dubbo-demo-native-provider
$MVNW clean package -P native native:compile
nohup ./target/dubbo-demo-native-provider &
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
cd ../dubbo-demo-native-consumer
$MVNW clean package -P native native:compile
./target/dubbo-demo-native-consumer
13 changes: 8 additions & 5 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,16 @@ jobs:
- name: "Compile Dubbo (Linux)"
run: |
cd ${{ github.workspace }}/dubbo
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
./mvnw ${{ env.MAVEN_ARGS }} -T 2C clean install -P '!demo',skip-spotless -Dmaven.test.skip=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true
- name: "Compile and run Dubbo demo for native (Linux)"
run: |
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-interface
MVNW="${{ github.workspace }}/dubbo/mvnw ${{ env.MAVEN_ARGS }} -T 2C -Dmaven.test.skip=true"
$MVNW clean install
cd ../dubbo-demo-native-provider
$MVNW clean package -P native native:compile
nohup ./target/dubbo-demo-native-provider &
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
cd ../dubbo-demo-native-consumer
$MVNW clean package -P native native:compile
./target/dubbo-demo-native-consumer
Loading

0 comments on commit 27dd643

Please sign in to comment.