Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop-issue#12…
Browse files Browse the repository at this point in the history
…017-ui-fix

# Conflicts:
#	console-ui/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js
#	console-ui/src/reducers/authority.js
  • Loading branch information
RickonZhang0929 committed Oct 28, 2024
2 parents 5f12172 + 4334cd1 commit 7b3fe68
Show file tree
Hide file tree
Showing 289 changed files with 13,681 additions and 5,846 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ name: "Continuous Integration"
on:
push:
branches: [ master, develop, v1.x-develop, v1.X ]
pull_request:
pull_request_target:
branches: [ develop, v1.x-develop ]

permissions:
contents: read # to fetch code (actions/checkout)
permissions: read-all

jobs:
ci:
Expand All @@ -21,16 +20,20 @@ jobs:
java: [8]
steps:
- name: "Cache Maven Repos"
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- if: github.event_name == 'pull_request_target'
run: echo "REF=refs/pull/${{ github.event.number }}/merge" >> "$GITHUB_ENV"
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ env.REF }}
- name: "Set up JDK ${{ matrix.java }}"
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
Expand All @@ -44,7 +47,11 @@ jobs:
- name: "Test With Maven"
run: mvn -Prelease-nacos clean test -DtrimStackTrace=false -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: "Codecov"
uses: codecov/[email protected]
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true
fail_ci_if_error: true
files: ./address/target/site/jacoco/jacoco.xml,./api/target/site/jacoco/jacoco.xml,./auth/target/site/jacoco/jacoco.xml,./client/target/site/jacoco/jacoco.xml,./common/target/site/jacoco/jacoco.xml,./config/target/site/jacoco/jacoco.xml,./consistency/target/site/jacoco/jacoco.xml,./console/target/site/jacoco/jacoco.xml,./core/target/site/jacoco/jacoco.xml,./logger-adapter-impl/log4j2-adapter/target/site/jacoco/jacoco.xml,./logger-adapter-impl/logback-adapter-12/target/site/jacoco/jacoco.xml,./naming/target/site/jacoco/jacoco.xml,./persistence/target/site/jacoco/jacoco.xml,./plugin-default-impl/nacos-default-auth-plugin/target/site/jacoco/jacoco.xml,./plugin-default-impl/nacos-default-control-plugin/target/site/jacoco/jacoco.xml,./plugin/auth/target/site/jacoco/jacoco.xml,./plugin/config/target/site/jacoco/jacoco.xml,./plugin/control/target/site/jacoco/jacoco.xml,./plugin/datasource/target/site/jacoco/jacoco.xml,./plugin/encryption/target/site/jacoco/jacoco.xml,./plugin/environment/target/site/jacoco/jacoco.xml,./plugin/trace/target/site/jacoco/jacoco.xml,./prometheus/target/site/jacoco/jacoco.xml,./sys/target/site/jacoco/jacoco.xml
token: ${{ secrets.CODECOV_TOKEN }}
7 changes: 4 additions & 3 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ jobs:
- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v2
echo ${{ github.event.pull_request.number }} > ./pr/pr.txt
- uses: actions/upload-artifact@v3
name: Upload PR number
with:
name: pr
path: pr/
path: pr/pr.txt
31 changes: 31 additions & 0 deletions .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Comment on PR"

on:
pull_request_target:
types: [opened, reopened]

jobs:
thanks-and-hint-to-document:
runs-on: ubuntu-20.04
permissions:
pull-requests: write
name: Say thanks for the PR and hint to document
steps:
- name: comment on the pull request
uses: hasura/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
number: ${{ github.event.number }}
id: thanks-and-hint-to-document
recreate: true
message: |
Thanks for your this PR. :pray:
Please check again for your PR changes whether contains any usage/api/configuration change such as `Add new API `, `Add new configuration`, `Change default value of configuration`.
If so, please add or update documents(markdown type) in `docs/next/` for repository [nacos-group/nacos-group.github.io](https://github.com/nacos-group/nacos-group.github.io/tree/develop-astro-nacos/src/content/docs/next)
---
感谢您提交的PR。 :pray:
请再次查看您的PR内容,确认是否包含任何使用方式/API/配置参数的变更,如:`新增API`、`新增配置参数`、`修改默认配置`等操作。
如果是,请确保在提交之前,在仓库[nacos-group/nacos-group.github.io](https://github.com/nacos-group/nacos-group.github.io/tree/develop-astro-nacos/src/content/docs/next)中的`docs/next/`目录下添加或更新文档(markdown格式)。
115 changes: 102 additions & 13 deletions .github/workflows/pr-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ env:
DOCKER_REPO: wuyfeedocker/nacos-ci
DOCKER_REPO_B: wuyfeehub/nacos-ci
TEST_REPO_NAME: nacos-group/nacos-e2e
HEADER_PARAMS: "-H \"Accept: application/vnd.github+json\" -H \"Authorization: Bearer ${{ secrets.ACTION_TOKEN }}\" -H \"X-GitHub-Api-Version: 2022-11-28\""
HEADER_PARAMS_WRITE_COMMENT: "-H \"Accept: application/vnd.github+json\" -H \"Authorization: Bearer ${{ secrets.ACTION_TOKEN }}\" -H \"X-GitHub-Api-Version: 2022-11-28\""
BASE_URL_NACOS: https://api.github.com/repos/${GITHUB_REPOSITORY}
BASE_URL_ROBOT: https://api.github.com/repos/wuyfee/nacos

jobs:
docker:
Expand Down Expand Up @@ -108,20 +112,28 @@ jobs:
REPLICA_COUNT: 3
DATABASE: mysql
NODE_PORT: 30000
AUTH_ENABLED: false
ACTUAL_MODE: cluster
strategy:
fail-fast: false
matrix:
mode: ["cluster","standalone"]
mode: ["cluster","standalone","standalone_auth"]
version: ${{ fromJSON(needs.docker.outputs.version-json) }}
steps:
- name: set nodeport
run: |
echo "NODE_PORT=$(expr $(expr $(expr $(expr ${{ strategy.job-index }} + 1) * ${{ github.run_number }}) % 30000) + 30000)" >> $GITHUB_ENV
- name: set cluster params
if: ${{ matrix.mode == 'standalone' }}
- name: set params values
run: |
echo "REPLICA_COUNT=1" >> $GITHUB_ENV
echo "DATABASE=embedded" >> $GITHUB_ENV
if [[ ${{ matrix.mode }} == "standalone"* ]];then
if [[ ${{ matrix.mode }} = "standalone_auth" ]]; then
echo "AUTH_ENABLED=true" >> $GITHUB_ENV
fi
echo "ACTUAL_MODE=standalone" >> $GITHUB_ENV
echo "REPLICA_COUNT=1" >> $GITHUB_ENV
echo "DATABASE=embedded" >> $GITHUB_ENV
echo ${{ matrix.mode }}-nacos-${{ github.run_id }}-${{ strategy.job-index }}
fi
- name: allocate docker repo
run: |
if [[ $(expr $(expr ${{ github.run_id }} + ${{ strategy.job-index }} ) % 2 ) -eq 1 ]]; then
Expand Down Expand Up @@ -149,12 +161,14 @@ jobs:
values:
namespace: nacos-${{ github.run_id }}-${{ strategy.job-index }}
global:
mode: ${{ matrix.mode }}
mode: ${{ env.ACTUAL_MODE }}
nacos:
replicaCount: ${{ env.REPLICA_COUNT }}
image:
repository: ${{ env.DOCKER_REPO_ACTUAL }}
tag: ${{ matrix.version }}
auth:
enabled: ${{ env.AUTH_ENABLED }}
storage:
type: ${{ env.DATABASE }}
db:
Expand All @@ -165,18 +179,27 @@ jobs:
service:
nodePort: ${{ env.NODE_PORT }}
type: ClusterIP
e2e-java-test:
if: ${{ success() }}
name: Java e2e Test
needs: [docker, deploy]
runs-on: ubuntu-latest
timeout-minutes: 60
env:
CODE_PATH: java/nacos-2X
strategy:
fail-fast: false
matrix:
mode: ["cluster","standalone"]
mode: ["cluster","standalone","standalone_auth"]
version: ${{ fromJSON(needs.docker.outputs.version-json) }}
steps:
- name: set code path
run: |
if [[ ${{ matrix.mode }} = "standalone_auth" ]]; then
echo "CODE_PATH=java/auth" >> $GITHUB_ENV
echo ${{ matrix.mode }}-nacos-${{ github.run_id }}-${{ strategy.job-index }}
fi
- uses: apache/rocketmq-test-tool@java-dev
name: java e2e test
with:
Expand All @@ -192,7 +215,7 @@ jobs:
REPO_NAME: ${{ env.TEST_REPO_NAME }}
CODE: https://github.com/${{ env.TEST_REPO_NAME }}
BRANCH: main
CODE_PATH: java/nacos-2X
CODE_PATH: ${{ env.CODE_PATH }}
CMD: mvn clean test -B
ALL_IP: null
CONTAINER:
Expand All @@ -203,7 +226,6 @@ jobs:
RESOURCE_REQUIRE:
cpu: 2
memory: 2Gi
- uses: actions/upload-artifact@v3
if: always()
name: Upload test log
Expand Down Expand Up @@ -296,6 +318,7 @@ jobs:
BRANCH: main
CODE_PATH: cpp
CMD: |
yum-config-manager remove centos-sclo-rh
cd /root/code/cpp && make install
echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ~/.bashrc && source ~/.bashrc
cd /root/code/cpp/nacoscpptest
Expand Down Expand Up @@ -454,7 +477,7 @@ jobs:
BRANCH: main
CODE_PATH: python
CMD: |
cd /root/code/python
cd /root/code/python
pip3 install -r requirements.txt
source ~/.bashrc
cd nacospythontest && pytest --junitxml ../target/surefire-reports/TEST-report.xml test/*_test.py --log-cli-level=DEBUG
Expand All @@ -480,15 +503,15 @@ jobs:
clean:
if: always()
if: ${{ always() }}
name: Clean
needs: [docker, e2e-java-test, e2e-go-test, e2e-cpp-test, e2e-csharp-test, e2e-nodejs-test, e2e-python-test]
runs-on: ubuntu-latest
timeout-minutes: 60
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
mode: ["cluster","standalone"]
mode: ["cluster","standalone","standalone_auth"]
version: ${{ fromJSON(needs.docker.outputs.version-json) }}
steps:
- uses: apache/rocketmq-test-tool@java-dev
Expand All @@ -498,3 +521,69 @@ jobs:
action: clean
namespace: nacos-${{ github.run_id }}-${{ strategy.job-index }}
askConfig: ${{ secrets.ASK_CONFIG_VIRGINA }}
write-comment:
if: ${{ always() }}
name: write comment to pr
needs: [docker, deploy, e2e-java-test, e2e-go-test, e2e-cpp-test, e2e-csharp-test, e2e-nodejs-test, e2e-python-test, clean]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: 'Download artifact'
uses: actions/[email protected]
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
});
var matchArtifactPR = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifactPR.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
- name: unzip pr
run: |
unzip pr.zip
cat pr.txt
pr_number=`cat pr.txt`
echo "PR_NUMBER=${pr_number}" >> $GITHUB_ENV
- name: write issue comment
run: |
echo ${{ env.PR_NUMBER }}
job_status=""
if [ ${{ needs.docker.result }} = 'success' ] && [ ${{ needs.deploy.result }} = 'success' ] && [ ${{ needs.e2e-java-test.result }} = 'success' ] && [ ${{ needs.e2e-go-test.result }} = 'success' ] && [ ${{ needs.e2e-cpp-test.result }} = 'success' ] && [ ${{ needs.e2e-csharp-test.result }} = 'success' ] && [ ${{ needs.e2e-nodejs-test.result }} = 'success' ] && [ ${{ needs.e2e-python-test.result }} = 'success' ]; then
jobs_status='$\\color{green}{SUCCESS}$'
jobs_status+="\n[DETAILS](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }})"
else
jobs_status='$\\color{red}{FAILURE}$'
jobs_status+="\n[DETAILS](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }})"
fi
echo ${jobs_status}
markdown_content="${jobs_status}"
generate_content() {
if [ $1 = "success" ];then
echo "\n ✅ $2 $1 "
else
echo "\n ❌ $2 $1 "
fi
}
markdown_content+=$(generate_content ${{ needs.docker.result }} "- docker: ")
markdown_content+=$(generate_content ${{ needs.deploy.result }} "- deploy (standalone & cluster & standalone_auth): ")
markdown_content+=$(generate_content ${{ needs.e2e-java-test.result }} "- e2e-java-test (standalone & cluster & standalone_auth): ")
markdown_content+=$(generate_content ${{ needs.e2e-go-test.result }} "- e2e-go-test (standalone & cluster): ")
markdown_content+=$(generate_content ${{ needs.e2e-cpp-test.result }} "- e2e-cpp-test (standalone & cluster): ")
markdown_content+=$(generate_content ${{ needs.e2e-csharp-test.result }} "- e2e-csharp-test (standalone & cluster): ")
markdown_content+=$(generate_content ${{ needs.e2e-nodejs-test.result }} "- e2e-nodejs-test (standalone & cluster): ")
markdown_content+=$(generate_content ${{ needs.e2e-python-test.result }} "- e2e-python-test (standalone & cluster): ")
markdown_content+=$(generate_content ${{ needs.clean.result }} "- clean (standalone & cluster & standalone_auth): ")
echo "markdown_content: \n ${markdown_content}"
payload=`echo "{\"body\": \"${markdown_content}\"}" | jq .`
curl -L -X POST ${{ env.HEADER_PARAMS_WRITE_COMMENT }} ${{ env.BASE_URL_NACOS }}/issues/${{ env.PR_NUMBER }}/comments -d "${payload}"
Loading

0 comments on commit 7b3fe68

Please sign in to comment.