Skip to content

Commit

Permalink
Merge branch 'master' into fix_hotload_service
Browse files Browse the repository at this point in the history
  • Loading branch information
owen200008 committed Apr 13, 2021
2 parents 76429ab + ba2692e commit 396a94a
Show file tree
Hide file tree
Showing 579 changed files with 19,318 additions and 3,724 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
@@ -0,0 +1,4 @@
# Git will understand that all files specified are not text,
# and it should not try to change them.
# This will prevent file formatting (such as `crlf` endings to `lf` endings) while commit.
* -text
185 changes: 185 additions & 0 deletions .github/workflows/build-and-test.yml
@@ -0,0 +1,185 @@
name: Build and Test

on: [push, pull_request, workflow_dispatch]

env:
FORK_COUNT: 2
FAIL_FAST: 0
SHOW_ERROR_DETAIL: 1
#multi-version size limit
VERSIONS_LIMIT: 4
CANDIDATE_VERSIONS: '
spring.version:4.3.30.RELEASE;
spring-boot.version:1.5.22.RELEASE;
spring-boot.version:2.4.1;
'
DUBBO_SPRING_BOOT_REF: '2.7.x'

jobs:
build-source:
runs-on: ubuntu-18.04
outputs:
version: ${{ steps.dubbo-version.outputs.version }}
steps:
- uses: actions/checkout@v2
with:
path: dubbo
- uses: actions/setup-java@v1
with:
java-version: 8
- uses: actions/cache@v2
name: "Cache local Maven repository"
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- name: "Dubbo cache"
uses: actions/cache@v2
with:
path: ~/.m2/repository/org/apache/dubbo
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
- name: "Calculate Dubbo Version"
id: dubbo-version
run: |
REVISION=`awk '/<revision>[^<]+<\/revision>/{gsub(/<revision>|<\/revision>/,"",$1);print $1;exit;}' ./dubbo/pom.xml`
echo "::set-output name=version::$REVISION"
echo "dubbo version: $REVISION"
- name: "Build Dubbo with Maven"
run: |
cd ./dubbo
./mvnw --batch-mode -U -e --no-transfer-progress clean source:jar install -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true
unit-test:
needs: [build-source]
name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }})"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-18.04, windows-2019 ]
jdk: [ 8, 11 ]
steps:
- uses: actions/checkout@v2
- name: "Set up JDK ${{ matrix.jdk }}"
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}
- uses: actions/cache@v2
name: "Cache local Maven repository"
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Test with Maven with Integration Tests"
timeout-minutes: 40
if: ${{ startsWith( matrix.os, 'ubuntu') }}
run: ./mvnw --batch-mode -U -e --no-transfer-progress clean test verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true
- name: "Test with Maven without Integration Tests"
env:
DISABLE_FILE_SYSTEM_TEST: true
timeout-minutes: 40
if: ${{ startsWith( matrix.os, 'windows') }}
run: ./mvnw --batch-mode -U -e --no-transfer-progress clean test verify -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"rat.skip=false" -D"maven.javadoc.skip=true"
- name: "Pack rat file if failure"
if: failure()
run: 7z a ${{ github.workspace }}/rat.zip *rat.txt -r
- name: "Upload rat file if failure"
if: failure()
uses: actions/upload-artifact@v2
with:
name: "rat-file-${{ matrix.os }}-JDK${{ matrix.jdk }}"
path: ${{ github.workspace }}/rat.zip
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v1

integration-test-prepare:
runs-on: ubuntu-18.04
env:
JOB_COUNT: 3
steps:
- uses: actions/checkout@v2
with:
repository: 'apache/dubbo-samples'
ref: master
- name: "Prepare test list"
run: |
bash ./test/scripts/prepare-test.sh
- name: "Upload test list"
uses: actions/upload-artifact@v2
with:
name: test-list
path: test/jobs

integration-test-job:
needs: [build-source, integration-test-prepare]
name: "Integration Test on ubuntu-18.04 (JobId: ${{matrix.job_id}})"
runs-on: ubuntu-18.04
timeout-minutes: 30
env:
JAVA_VER: 8
TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt
strategy:
fail-fast: false
matrix:
job_id: [1, 2, 3]
steps:
- uses: actions/checkout@v2
with:
repository: 'apache/dubbo-samples'
ref: master
- name: "Cache local Maven repository"
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Restore Dubbo cache"
uses: actions/cache@v2
with:
path: ~/.m2/repository/org/apache/dubbo
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
- name: "Download test list"
uses: actions/download-artifact@v2
with:
name: test-list
path: test/jobs/
- name: "Set up JDK 8"
uses: actions/setup-java@v1
with:
java-version: 8
- name: "Init Candidate Versions"
run: |
DUBBO_VERSION="${{needs.build-source.outputs.version}}"
CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS"
echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV
- name: "Build test image"
run: |
cd test && bash ./build-test-image.sh
- name: "Run tests"
run: cd test && bash ./run-tests.sh
- name: "Upload test result"
if: always()
uses: actions/upload-artifact@v2
with:
name: test-result
path: test/jobs/*-result*

integration-test-result:
needs: [integration-test-job]
if: always()
runs-on: ubuntu-18.04
env:
JAVA_VER: 8
steps:
- uses: actions/checkout@v2
with:
repository: 'apache/dubbo-samples'
ref: master
- name: "Download test result"
uses: actions/download-artifact@v2
with:
name: test-result
path: test/jobs/
- name: "Merge test result"
run: ./test/scripts/merge-test-results.sh
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

42 changes: 21 additions & 21 deletions CONTRIBUTING.md
@@ -1,18 +1,18 @@

## Contributing to dubbo
Dubbo is released under the non-restrictive Apache 2.0 license, and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. If you want to contribute even something trivial please do not hesitate, but follow the guidelines below.
## Contributing to Dubbo
Dubbo is released under the non-restrictive Apache 2.0 licenses and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. Contributions of all form to this repository is acceptable, as long as it follows the prescribed community guidelines enumerated below.

### Sign the Contributor License Agreement
Before we accept a non-trivial patch or pull request we will need you to sign the Contributor License Agreement. Signing the contributor’s agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests.
Before we accept a non-trivial patch or pull request (PRs), we will need you to sign the Contributor License Agreement. Signing the contributors' agreement does not grant anyone commits rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors may get invited to join the core team that will grant them privileges to merge existing PRs.

### Contact

#### Mailing list

The mailing list is the recommended way for discussing almost anything that related to Dubbo. Please refer to this [guide](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide) for detailed documentation on how to subscribe.
The mailing list is the recommended way of pursuing a discussion on almost anything related to Dubbo. Please refer to this [guide](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide) for detailed documentation on how to subscribe.

- [dev@dubbo.apache.org](mailto:dev-subscribe@dubbo.apache.org): the develop mailing list, you can ask question here if you have encountered any problem when using or developing Dubbo.
- [commits@dubbo.apache.org](mailto:commits-subscribe@dubbo.apache.org): all the commits will be sent to this mailing list. You can subscribe to it if you are interested in Dubbo's development.
- [dev@dubbo.apache.org](mailto:dev-subscribe@dubbo.apache.org): the developer mailing list where you can ask questions about an issue you may have encountered while working with Dubbo.
- [commits@dubbo.apache.org](mailto:commits-subscribe@dubbo.apache.org): the commit updates will get broadcasted on this mailing list. You can subscribe to it, should you be interested in following Dubbo's development.
- [notifications@dubbo.apache.org](mailto:notifications-subscribe@dubbo.apache.org): all the Github [issue](https://github.com/apache/dubbo/issues) updates and [pull request](https://github.com/apache/dubbo/pulls) updates will be sent to this mailing list.

### Reporting issue
Expand All @@ -21,33 +21,33 @@ Please follow the [template](https://github.com/apache/dubbo/issues/new?templat

### Code Conventions
Our code style is almost in line with the standard java conventions (Popular IDE's default setting satisfy this), with the following additional restricts:
* If there are more than 120 characters in current line, start a new line.
* If there are more than 120 characters in the current line, begin a new line.

* Make sure all new .java files to have a simple Javadoc class comment with at least a @date tag identifying birth, and preferably at least a paragraph on what the class is for.
* Make sure all new .java files to have a simple Javadoc class comment with at least a @date tag identifying birth, and preferably at least a paragraph on the intended purpose of the class.

* Add the ASF license header comment to all new .java files (copy from existing files in the project)

* Make sure no @author tag added to the file you contribute since @author tag is not used at Apache, other ways such as cvs will record all your contributions fairly.
* Make sure no @author tag gets appended to the file you contribute to as the @author tag is incompatible with Apache. Rest assured, other ways, including CVS, will ensure transparency, fairness in recording your contributions.

* Add some Javadocs and, if you change the namespace, some XSD doc elements.

* A few unit tests should be added for a new feature or an important bugfix.
* Sufficient unit-tests should accompany new feature development or non-trivial bug fixes.

* If no-one else is using your branch, please rebase it against the current master (or other target branch in the main project).
* If no-one else is using your branch, please rebase it against the current master (or another target branch in the main project).

* When writing a commit message please follow these conventions, if you are fixing an existing issue please add Fixes #XXX at the end of the commit message (where XXX is the issue number).
* When writing a commit message, please follow the following conventions: should your commit address an open issue, please add Fixes #XXX at the end of the commit message (where XXX is the issue number).

### Contribution flow

This is a rough outline of what a contributor's workflow looks like:
A rough outline of an ideal contributors' workflow is as follows:

* Fork the current repository
* Create a topic branch from where to base the contribution. This is usually master.
* Create a topic branch from where to base the contribution. Mostly, it's the master branch.
* Make commits of logical units.
* Make sure commit messages are in the proper format (see below).
* Make sure the commit messages are in the proper format (see below).
* Push changes in a topic branch to your forked repository.
* Follow the checklist in the [pull request template](https://github.com/apache/dubbo/blob/master/PULL_REQUEST_TEMPLATE.md)
* Before you sending out the pull request, please sync your forked repository with remote repository, this will make your pull request simple and clear. See guide below:
* Before sending out the pull request, please sync your forked repository with the remote repository to ensure that your PR is elegant, concise. Reference the guide below:
```
git remote add upstream git@github.com:apache/dubbo.git
git fetch upstream
Expand All @@ -62,15 +62,15 @@ Thanks for contributing!

### Code style

We provide a template file [dubbo_codestyle_for_idea.xml](https://github.com/apache/dubbo/tree/master/codestyle/dubbo_codestyle_for_idea.xml) for IntelliJ idea, you can import it to you IDE.
If you use Eclipse you can config manually by referencing the same file.
We provide a template file [dubbo_codestyle_for_idea.xml](https://github.com/apache/dubbo/tree/master/codestyle/dubbo_codestyle_for_idea.xml) for IntelliJ idea that you can import it to your workplace.
If you use Eclipse, you can use the IntelliJ Idea template for manually configuring your file.

**NOTICE**

It is very important to set the dubbo_codestyle_for_idea.xml, otherwise you will fail to pass the Travis CI. Steps to set the code style are as below:
It's critical to set the dubbo_codestyle_for_idea.xml to avoid the failure of your Travis CI builds. Steps to configure the code styles are as follows:

1. Enter `Editor > Code Style`
2. To manage a code style scheme, in the Code Style page, select the desired scheme from the drop-down list, and click ![manage profiles](codestyle/manage_profiles.png).
From the drop-down list, select `Import Scheme`, then select this option `IntelliJ IDEA code style XML` to import scheme
2. To manage a code style scheme, in the Code Style page, select the desired scheme from the drop-down list, and click on ![manage profiles](codestyle/manage_profiles.png).
From the drop-down list, select `Import Scheme`, then choose the option `IntelliJ IDEA code style XML` to import the scheme.
3. In the Scheme field, type the name of the new scheme and press ⏎ to save the changes.

36 changes: 20 additions & 16 deletions Jenkinsfile
Expand Up @@ -12,12 +12,12 @@ pipeline {
}

environment {
JAVA_HOME = "${tool 'JDK 1.8 (latest)'}"
JAVA_HOME = "${tool 'jdk_1.8_latest'}"
}

tools {
maven 'Maven 3 (latest)'
jdk 'JDK 1.8 (latest)'
maven 'maven_3_latest'
jdk 'jdk_1.8_latest'
}

triggers {
Expand All @@ -38,7 +38,7 @@ pipeline {
stage('Duplicate deploy check') {
steps {
script {
def deployedCommitId = sh(returnStdout: true, script: "curl --silent https://builds.apache.org/job/Apache%20Dubbo/job/${env.JOB_BASE_NAME}/lastSuccessfulBuild/artifact/DEPLOY_COMMIT_ID || true").trim()
def deployedCommitId = sh(returnStdout: true, script: "curl --silent https://ci-builds.apache.org/job/Dubbo/job/${env.JOB_BASE_NAME}/lastSuccessfulBuild/artifact/DEPLOY_COMMIT_ID || true").trim()
env.DEPLOYED_COMMIT_ID = deployedCommitId
def commitId = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
env.COMMIT_ID = commitId
Expand All @@ -65,22 +65,26 @@ pipeline {
def commitId = env.COMMIT_ID
println "Current commit id: $commitId"

def commitStatusJson = sh(script: "curl --silent https://api.github.com/repos/apache/dubbo/commits/$commitId/status", returnStdout: true).trim()
println "Commit status: \r\n$commitStatusJson"
def commitStatusJson = sh(script: "curl --silent https://api.github.com/repos/apache/dubbo/actions/runs", returnStdout: true).trim()

def jsonSlurper = new JsonSlurper()
def jsonObject = jsonSlurper.parseText(commitStatusJson)

def status = jsonObject.state

println "Current commit status is $status"

if (status == "success") {
env.STATUS_CHECK = "true"
println "Continue to deploy snapshot"
} else {
env.STATUS_CHECK = "false"
println "Current commit status not allow to deploy snapshot"
def runs = jsonObject.workflow_runs

for (def run in runs) {
if (run.workflow_id == 5030221 && run.head_sha == commitId &&
run.event == "push" && run.head_branch == "master") {
println "Find github action for current commit: $run"
if (run.status == "completed" && run.conclusion == "success") {
env.STATUS_CHECK = "true"
println "CI status is success for commitId:$commitId, continue to deploy"
} else {
env.STATUS_CHECK = "false"
println "CI status is not success for commitId:$commitId"
}
break;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
@@ -1,5 +1,5 @@
Apache Dubbo
Copyright 2018-2020 The Apache Software Foundation
Copyright 2018-2021 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
Expand Down

0 comments on commit 396a94a

Please sign in to comment.