Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/apache/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ChineseTony committed Sep 19, 2024
2 parents b3be691 + 0d6c94b commit f8454eb
Show file tree
Hide file tree
Showing 231 changed files with 14,010 additions and 1,843 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- master
- develop
- bazel

permissions:
actions: write

jobs:
build:
name: "bazel-compile (${{ matrix.os }})"
Expand All @@ -19,4 +23,14 @@ jobs:
- name: Build
run: bazel build --config=remote //...
- name: Run Tests
run: bazel test --config=remote //...
run: bazel test --config=remote //...
- name: Retry if failed
# if it failed , retry 2 times at most
if: failure() && fromJSON(github.run_attempt) < 3
continue-on-error: true
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Attempting to retry workflow..."
gh workflow run rerun-workflow.yml -F run_id=${{ github.run_id }}
45 changes: 45 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run Integration Tests
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches: [master, develop]

jobs:
it-test:
name: "maven-compile (${{ matrix.os }}, JDK-${{ matrix.jdk }})"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
jdk: [8]
steps:
- name: Cache Maven Repos
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.jdk }}
distribution: "adopt"
cache: "maven"

- name: Run integration tests with Maven
run: mvn clean verify -Pit-test -Pskip-unit-tests

- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: 'test/target/failsafe-reports/TEST-*.xml'
annotate_only: true
include_passed: true
detailed_summary: true
28 changes: 26 additions & 2 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
types: [opened, reopened, synchronize]
push:
branches: [master, develop, bazel]

permissions:
actions: write

jobs:
java_build:
name: "maven-compile (${{ matrix.os }}, JDK-${{ matrix.jdk }})"
Expand All @@ -25,10 +29,30 @@ jobs:
cache: "maven"
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Upload JVM crash logs

- name: Upload Auth JVM crash logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: jvm-crash-logs
path: /Users/runner/work/rocketmq/rocketmq/auth/hs_err_pid*.log
retention-days: 1
retention-days: 1

- name: Upload broker JVM crash logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: jvm-crash-logs
path: /Users/runner/work/rocketmq/rocketmq/broker/hs_err_pid*.log
retention-days: 1

- name: Retry if failed
# if it failed , retry 2 times at most
if: failure() && fromJSON(github.run_attempt) < 3
continue-on-error: true
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Attempting to retry workflow..."
gh workflow run rerun-workflow.yml -F run_id=${{ github.run_id }}
4 changes: 2 additions & 2 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Build distribution tar
run: |
mvn -Prelease-all -DskipTests -Dspotbugs.skip=true clean install -U
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload distribution tar
with:
name: rocketmq
Expand All @@ -30,7 +30,7 @@ jobs:
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: pr
path: pr/
15 changes: 9 additions & 6 deletions .github/workflows/pr-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
java-version: ["8"]
steps:
- name: 'Download artifact'
uses: actions/github-script@v3.1.0
uses: actions/github-script@v7
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
mkdir versionlist
touch versionlist/"${version}-`echo ${{ matrix.base-image }} | sed -e "s/:/-/g"`"
sh ./build-image-local.sh ${version} ${{ matrix.base-image }} ${{ matrix.java-version }} ${DOCKER_REPO}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload distribution tar
with:
name: versionlist
Expand All @@ -85,7 +85,7 @@ jobs:
outputs:
version-json: ${{ steps.show_versions.outputs.version-json }}
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: Download versionlist
with:
name: versionlist
Expand All @@ -96,6 +96,7 @@ jobs:
a=(`ls versionlist`)
printf '%s\n' "${a[@]}" | jq -R . | jq -s .
echo version-json=`printf '%s\n' "${a[@]}" | jq -R . | jq -s .` >> $GITHUB_OUTPUT
deploy:
if: ${{ success() }}
name: Deploy RocketMQ
Expand Down Expand Up @@ -158,7 +159,7 @@ jobs:
annotate_only: true
include_passed: true
detailed_summary: true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
name: Upload test log
with:
Expand Down Expand Up @@ -187,6 +188,8 @@ jobs:
test-cmd: |
cd ../common && mvn -Prelease -DskipTests clean package -U
cd ../rocketmq-admintools && source bin/env.sh
wget https://go.dev/dl/go1.22.6.linux-amd64.tar.gz && \
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.6.linux-amd64.tar.gz
cd ../golang && go get -u github.com/apache/rocketmq-clients/golang && gotestsum --junitfile ./target/surefire-reports/TEST-report.xml ./mqgotest/... -timeout 2m -v
job-id: 0
- name: Publish Test Report
Expand All @@ -197,7 +200,7 @@ jobs:
annotate_only: true
include_passed: true
detailed_summary: true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
name: Upload test log
with:
Expand Down Expand Up @@ -233,7 +236,7 @@ jobs:
annotate_only: true
include_passed: true
detailed_summary: true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
name: Upload test log
with:
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/push-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Build distribution tar
run: |
mvn -Prelease-all -DskipTests -Dspotbugs.skip=true clean install -U
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload distribution tar
with:
name: rocketmq
Expand All @@ -53,7 +53,7 @@ jobs:
repository: apache/rocketmq-docker.git
ref: master
path: rocketmq-docker
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: Download distribution tar
with:
name: rocketmq
Expand All @@ -72,7 +72,7 @@ jobs:
mkdir versionlist
touch versionlist/"${version}-`echo ${{ matrix.base-image }} | sed -e "s/:/-/g"`"
sh ./build-image-local.sh ${version} ${{ matrix.base-image }} ${{ matrix.java-version }} ${DOCKER_REPO}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload distribution tar
with:
name: versionlist
Expand All @@ -90,7 +90,7 @@ jobs:
outputs:
version-json: ${{ steps.show_versions.outputs.version-json }}
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: Download versionlist
with:
name: versionlist
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
annotate_only: true
include_passed: true
detailed_summary: true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
name: Upload test log
with:
Expand Down Expand Up @@ -192,6 +192,8 @@ jobs:
test-cmd: |
cd ../common && mvn -Prelease -DskipTests clean package -U
cd ../rocketmq-admintools && source bin/env.sh
wget https://go.dev/dl/go1.22.6.linux-amd64.tar.gz && \
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.6.linux-amd64.tar.gz
cd ../golang && go get -u github.com/apache/rocketmq-clients/golang && gotestsum --junitfile ./target/surefire-reports/TEST-report.xml ./mqgotest/... -timeout 2m -v
job-id: 0
- name: Publish Test Report
Expand All @@ -202,7 +204,7 @@ jobs:
annotate_only: true
include_passed: true
detailed_summary: true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
name: Upload test log
with:
Expand Down Expand Up @@ -238,7 +240,7 @@ jobs:
annotate_only: true
include_passed: true
detailed_summary: true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
name: Upload test log
with:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/rerun-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Rerun workflow
on:
workflow_dispatch:
inputs:
run_id:
required: true

permissions:
actions: write

jobs:
rerun:
runs-on: ubuntu-latest
steps:
- name: rerun ${{ inputs.run_id }}
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
gh run rerun ${{ inputs.run_id }} --failed
10 changes: 5 additions & 5 deletions .github/workflows/snapshot-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
MAVEN_SETTINGS: ${{ github.workspace }}/.github/asf-deploy-settings.xml
run: |
mvn -Prelease-all -DskipTests -Dspotbugs.skip=true clean install -U
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload distribution tar
with:
name: rocketmq
Expand All @@ -91,7 +91,7 @@ jobs:
repository: apache/rocketmq-docker.git
ref: master
path: rocketmq-docker
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: Download distribution tar
with:
name: rocketmq
Expand All @@ -110,7 +110,7 @@ jobs:
mkdir versionlist
touch versionlist/"${version}-`echo ${{ matrix.base-image }} | sed -e "s/:/-/g"`"
sh ./build-image-local.sh ${version} ${{ matrix.base-image }} ${{ matrix.java-version }} ${DOCKER_REPO}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload distribution tar
with:
name: versionlist
Expand All @@ -125,7 +125,7 @@ jobs:
outputs:
version-json: ${{ steps.show_versions.outputs.version-json }}
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: Download versionlist
with:
name: versionlist
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
annotate_only: true
include_passed: true
detailed_summary: true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
name: Upload test log
with:
Expand Down
2 changes: 1 addition & 1 deletion acl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-all</artifactId>
<version>5.2.1-SNAPSHOT</version>
<version>5.3.1-SNAPSHOT</version>
</parent>
<artifactId>rocketmq-acl</artifactId>
<name>rocketmq-acl ${project.version}</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class AclUtils {

public static byte[] combineRequestContent(RemotingCommand request, SortedMap<String, String> fieldsMap) {
try {
StringBuilder sb = new StringBuilder("");
StringBuilder sb = new StringBuilder();
for (Map.Entry<String, String> entry : fieldsMap.entrySet()) {
if (!SessionCredentials.SIGNATURE.equals(entry.getKey())) {
sb.append(entry.getValue());
Expand Down Expand Up @@ -71,12 +71,12 @@ public static void IPv6AddressCheck(String netAddress) {
if (isAsterisk(netAddress) || isMinus(netAddress)) {
int asterisk = netAddress.indexOf("*");
int minus = netAddress.indexOf("-");
// '*' must be the end of netAddress if it exists
// '*' must be the end of netAddress if it exists
if (asterisk > -1 && asterisk != netAddress.length() - 1) {
throw new AclException(String.format("NetAddress examine scope Exception netAddress is %s", netAddress));
}

// format like "2::ac5:78:1-200:*" or "2::ac5:78:1-200" is legal
// format like "2::ac5:78:1-200:*" or "2::ac5:78:1-200" is legal
if (minus > -1) {
if (asterisk == -1) {
if (minus <= netAddress.lastIndexOf(":")) {
Expand Down Expand Up @@ -128,7 +128,7 @@ public static String[] getAddresses(String netAddress, String partialAddress) {
}

public static boolean isScope(String netAddress, int index) {
// IPv6 Address
// IPv6 Address
if (isColon(netAddress)) {
netAddress = expandIP(netAddress, 8);
String[] strArray = StringUtils.split(netAddress, ":");
Expand Down
Loading

0 comments on commit f8454eb

Please sign in to comment.