Skip to content

Commit 6b1207c

Browse files
committed
Merge remote-tracking branch 'origin/master' into integration/agent-gateway-p003
2 parents a34127b + a87a361 commit 6b1207c

243 files changed

Lines changed: 12131 additions & 695 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/scripts/resolve-ci-modules.sh‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ max_modules="${MAX_CI_MODULES:-8}"
2222
has_code_changes=false
2323
full_build_required=false
2424
modules=()
25+
module_count=0
2526

2627
if ! command -v jq >/dev/null 2>&1; then
2728
echo "jq is required to resolve changed Maven modules." >&2
@@ -32,13 +33,14 @@ add_module() {
3233
local module="$1"
3334
local existing
3435

35-
for existing in "${modules[@]}"; do
36+
for existing in ${modules[@]+"${modules[@]}"}; do
3637
if [[ "${existing}" == "${module}" ]]; then
3738
return
3839
fi
3940
done
4041

4142
modules+=("${module}")
43+
module_count=$((module_count + 1))
4244
}
4345

4446
is_root_reactor_module() {
@@ -82,6 +84,10 @@ is_ignored_change() {
8284
local file="$1"
8385

8486
case "${file}" in
87+
# The opt-in reactor is packaged and smoke-tested by minimal-http.yml.
88+
shenyu-bootstrap-http/*|script/performance/minimal-http/*)
89+
return 0
90+
;;
8591
*.png|*.jpg|*.jpeg|*.gif|*.svg|*.ico|*.pdf|*.doc|*.docx|DISCLAIMER|*/resources/static/*)
8692
return 0
8793
;;
@@ -125,18 +131,23 @@ done < <(printf '%s' "${changed_files_json}" | jq -r '.[]')
125131
# SPI changes can affect modules that consume shared classes without declaring a
126132
# direct Maven dependency on every transitive module. Build the full reactor so
127133
# those modules cannot silently use a stale SNAPSHOT from the Maven cache.
128-
for module in "${modules[@]}"; do
134+
for module in ${modules[@]+"${modules[@]}"}; do
129135
if [[ "${module}" == "shenyu-spi" ]]; then
130136
full_build_required=true
131137
break
132138
fi
133139
done
134140

135-
if [[ "${has_code_changes}" == "true" && ("${#modules[@]}" -eq 0 || "${#modules[@]}" -gt "${max_modules}") ]]; then
141+
if [[ "${has_code_changes}" == "true" && ("${module_count}" -eq 0 || "${module_count}" -gt "${max_modules}") ]]; then
136142
full_build_required=true
137143
fi
138144

139-
modules_csv="$(IFS=,; printf '%s' "${modules[*]}")"
145+
# Bash 3.2 treats even an initialized empty array as unset with nounset.
146+
# Only expand the joined array after at least one module has been recorded.
147+
modules_csv=""
148+
if [[ "${module_count}" -gt 0 ]]; then
149+
modules_csv="$(IFS=,; printf '%s' "${modules[*]}")"
150+
fi
140151

141152
{
142153
echo "has_code_changes=${has_code_changes}"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -euo pipefail
18+
output=$(mktemp)
19+
trap 'rm -f "$output"' EXIT
20+
21+
assert_routing() {
22+
CHANGED_FILES_JSON="$1" GITHUB_OUTPUT="$output" "${BASH}" .github/scripts/resolve-ci-modules.sh > /dev/null
23+
grep -Fxq "has_code_changes=$2" "$output"
24+
grep -Fxq "modules=$3" "$output"
25+
grep -Fxq "full_build_required=$4" "$output"
26+
: > "$output"
27+
}
28+
29+
assert_routing '[]' false '' false
30+
assert_routing '["README.md"]' false '' false
31+
assert_routing '["shenyu-bootstrap-http/pom.xml"]' false '' false
32+
assert_routing '["shenyu-bootstrap-http/src/main/java/org/apache/shenyu/bootstrap/http/ShenyuHttpApplication.java"]' false '' false
33+
assert_routing '["script/performance/minimal-http/fixture.py"]' false '' false
34+
assert_routing '["shenyu-bootstrap-http/pom.xml","shenyu-common/pom.xml"]' true 'shenyu-common' false
35+
assert_routing '["pom.xml"]' true '' true
36+
assert_routing '["shenyu-common/pom.xml","shenyu-common/pom.xml"]' true 'shenyu-common' false
37+
assert_routing '["shenyu-spi/pom.xml"]' true 'shenyu-spi' true
38+
MAX_CI_MODULES=0 assert_routing '["shenyu-common/pom.xml"]' true 'shenyu-common' true
39+
echo 'Minimal HTTP CI routing tests passed (10 cases)'

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ jobs:
347347
with:
348348
submodules: true
349349
- name: Check License Header
350-
uses: apache/skywalking-eyes@9bd5feb86b5817aa6072b008f9866a2c3bbc8587
350+
uses: apache/skywalking-eyes@a196742f472feaffafea537ce5a2a4c3c53a8de4 # v0.9.0; supports REM headers in Windows batch files
351351
env:
352352
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
353353

‎.github/workflows/integrated-test.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,12 @@ jobs:
196196
- name: Verify integrated test image
197197
run: docker image inspect apache/${{ matrix.case }}:latest --format '{{.Id}}'
198198
- name: Start docker compose
199-
run: docker compose -f ./shenyu-integrated-test/${{ matrix.case }}/docker-compose.yml up -d
199+
run: |
200+
if ! docker compose -f ./shenyu-integrated-test/${{ matrix.case }}/docker-compose.yml up -d; then
201+
docker compose -f ./shenyu-integrated-test/${{ matrix.case }}/docker-compose.yml ps --all || true
202+
docker compose -f ./shenyu-integrated-test/${{ matrix.case }}/docker-compose.yml logs --no-color --tail=200 || true
203+
exit 1
204+
fi
200205
- name: Wait for docker compose start up completely
201206
run: bash ./shenyu-integrated-test/${{ matrix.case }}/script/healthcheck.sh
202207
- name: Disk space info

‎.github/workflows/minimal-http.yml‎

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: minimal-http
17+
on:
18+
pull_request:
19+
paths:
20+
- 'pom.xml'
21+
- 'shenyu-bootstrap-http/**'
22+
- 'shenyu-common/**'
23+
- 'shenyu-admin/**'
24+
- 'shenyu-admin-listener/**'
25+
- 'shenyu-dist/**'
26+
- 'shenyu-web/**'
27+
- 'shenyu-plugin/**'
28+
- 'shenyu-spring-boot-starter/**'
29+
- 'shenyu-sync-data-center/**'
30+
- 'shenyu-loadbalancer/**'
31+
- 'shenyu-spi/**'
32+
- 'script/performance/minimal-http/**'
33+
- '.github/workflows/minimal-http.yml'
34+
- '.github/scripts/resolve-ci-modules.sh'
35+
- '.github/scripts/test-minimal-http-routing.sh'
36+
workflow_dispatch:
37+
38+
permissions:
39+
contents: read
40+
41+
jobs:
42+
packaged-smoke:
43+
runs-on: ubuntu-latest
44+
timeout-minutes: 30
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: actions/setup-java@v4
48+
with:
49+
distribution: temurin
50+
java-version: '17'
51+
cache: maven
52+
- uses: actions/setup-python@v5
53+
with:
54+
python-version: '3.12'
55+
- name: Resolve archive version
56+
id: version
57+
run: echo "version=$(./mvnw -q -N -DforceStdout help:evaluate -Dexpression=project.version)" >> "$GITHUB_OUTPUT"
58+
- name: Build opt-in assembly with Checkstyle and RAT
59+
run: |
60+
bash .github/scripts/test-minimal-http-routing.sh
61+
./mvnw -B -Pminimal-http -pl shenyu-bootstrap-http -am clean install -DskipTests -Dmaven.javadoc.skip=true -Djacoco.skip=true
62+
- name: Record resolved runtime dependencies
63+
run: ./mvnw -B -Pminimal-http -pl shenyu-bootstrap-http dependency:list -DincludeScope=runtime -DoutputFile=target/runtime-dependencies.txt
64+
- name: Check harness and packaged routing
65+
env:
66+
SHENYU_VERSION: ${{ steps.version.outputs.version }}
67+
run: |
68+
python -m pip install -r script/performance/minimal-http/requirements.txt
69+
python -m unittest discover -s script/performance/minimal-http -p 'test_*.py'
70+
python script/performance/minimal-http/benchmark.py \
71+
--minimal "shenyu-bootstrap-http/target/apache-shenyu-http-${SHENYU_VERSION}-bin/apache-shenyu-http" \
72+
--java "$JAVA_HOME/bin/java" --smoke-only \
73+
--output shenyu-bootstrap-http/target/smoke
74+
- name: Build disposable Admin and test real centrally synchronized routes
75+
env:
76+
SHENYU_VERSION: ${{ steps.version.outputs.version }}
77+
run: |
78+
./mvnw -B -Prelease -pl shenyu-dist/shenyu-admin-dist -am package -DskipTests -Dmaven.javadoc.skip=true -Djacoco.skip=true
79+
tar -xzf "shenyu-dist/shenyu-admin-dist/target/apache-shenyu-${SHENYU_VERSION}-admin-bin.tar.gz" -C shenyu-dist/shenyu-admin-dist/target
80+
python script/performance/minimal-http/admin_smoke.py \
81+
--admin "shenyu-dist/shenyu-admin-dist/target/apache-shenyu-${SHENYU_VERSION}-admin-bin" \
82+
--minimal "shenyu-bootstrap-http/target/apache-shenyu-http-${SHENYU_VERSION}-bin/apache-shenyu-http" \
83+
--java "$JAVA_HOME/bin/java" --output shenyu-bootstrap-http/target/admin-smoke
84+
- uses: actions/upload-artifact@v4
85+
if: always()
86+
with:
87+
name: minimal-http-package-and-smoke
88+
path: |
89+
shenyu-bootstrap-http/target/*-bin.tar.gz
90+
shenyu-bootstrap-http/target/runtime-dependencies.txt
91+
shenyu-bootstrap-http/target/smoke/
92+
shenyu-bootstrap-http/target/admin-smoke/

‎actions/paths-filter/LICENSE‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
The MIT License (MIT)
3+
4+
Copyright (c) 2020 Michal Dorner and contributors
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

0 commit comments

Comments
 (0)