Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ada45fc
fix: upgrade vulnerable release dependencies
yuluo-yx Nov 3, 2026
fa4cde6
fix: align HTTP and Cloud dependencies with Spring Boot 3.5
yuluo-yx Nov 3, 2026
3d3d17c
ci: retain resolved distribution dependencies for release audits
yuluo-yx Nov 3, 2026
4e93955
fix: align Admin integrations with the Boot 3.5 baseline
yuluo-yx Nov 3, 2026
d43b211
fix: adapt Admin and Redis APIs to upgraded dependencies
yuluo-yx Nov 3, 2026
9340194
fix: patch transitive release dependencies and document remaining adv…
yuluo-yx Nov 3, 2026
2c827ef
test: migrate dashboard principals to the supported Shiro collection
yuluo-yx Nov 3, 2026
74d1609
fix: align Jakarta security and patch gateway compression dependencies
yuluo-yx Nov 3, 2026
30f8ba2
fix: manage published Fastjson modules explicitly
yuluo-yx Nov 3, 2026
1dfc788
fix: preserve Boot framework management before the Shiro Jakarta BOM
yuluo-yx Nov 3, 2026
f5978ee
fix: isolate Jakarta dependency management and align patched runtime …
yuluo-yx Nov 3, 2026
0e73768
fix: align resolved plugin libraries and validate candidate legal doc…
yuluo-yx Nov 3, 2026
8c57716
fix: complete release notices and align tracing and Kubernetes clients
yuluo-yx Nov 3, 2026
274501b
fix: keep candidate image validation from publishing latest tags
yuluo-yx Nov 3, 2026
ef31749
docs: align distribution license versions with the final runtime inve…
yuluo-yx Nov 3, 2026
dd5b67a
ci: fail candidate validation on missing license declarations
yuluo-yx Nov 3, 2026
509fdf6
fix: align example applications with the upgraded Boot and Cloud base…
yuluo-yx Nov 3, 2026
74980a3
ci: include example Surefire runtime dependencies in offline E2E inputs
yuluo-yx Nov 3, 2026
318d9dc
ci: hand off the validated Maven wrapper to test shards
yuluo-yx Nov 3, 2026
798b703
fix: align example discovery clients with the Cloud 2025 release train
yuluo-yx Nov 3, 2026
8d762bf
docs: declare bundled Jakarta Mail API in Admin distribution license
yuluo-yx Nov 3, 2026
808c69e
fix: address RC3 artifact licensing and source distribution review
yuluo-yx Nov 4, 2026
2c96383
fix: disable RememberMe cookie authentication in stateless Admin
yuluo-yx Nov 4, 2026
89c89cc
fix: include dashboard license materials in standalone Admin artifacts
yuluo-yx Nov 4, 2026
b4945ec
fix: stabilize discovery fixtures and scope shaded artifact license c…
yuluo-yx Nov 4, 2026
659aa99
test: await terminal cleanup after remote HTTP peer completion
yuluo-yx Nov 4, 2026
d254507
fix: address dependency release review findings
yuluo-yx Nov 6, 2026
8c866da
docs: remove invalid fastjson license entry
yuluo-yx Nov 6, 2026
074f67e
Merge master into release dependency upgrades
Aias00 Nov 13, 2026
c8c7930
fix: stabilize PR 8292 CI tests
yuluo-yx Nov 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/scripts/collect-release-licenses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Collect legal resources from the exact assembled distribution JARs."""

import argparse
import hashlib
import io
import json
from pathlib import Path, PurePosixPath
import re
import tarfile
import zipfile


LEGAL_NAME = re.compile(r"^(license|notice|copyright|copying)(?:[._-].*)?$", re.I)
TEXT_SUFFIXES = {"", ".txt", ".text", ".md", ".html", ".htm", ".rst", ".adoc"}


def collect(archive):
jars = []
texts = {}
documents = []
with tarfile.open(archive, "r:gz") as distribution:
for member in distribution:
path = PurePosixPath(member.name)
if member.isfile() and ((len(path.parts) == 2 and path.name in {"LICENSE", "NOTICE"})
or (len(path.parts) > 2 and path.parts[1] == "licenses")):
with distribution.extractfile(member) as document:
documents.append(document.read().decode("utf-8-sig", errors="replace").replace("\r\n", "\n"))
if not member.isfile() or path.parent.name != "lib" or path.suffix != ".jar":
continue
if path.name.startswith("shenyu-"):
continue
resources = []
coordinates = []
with distribution.extractfile(member) as jar_stream:
with zipfile.ZipFile(io.BytesIO(jar_stream.read())) as jar:
for entry in sorted(jar.namelist()):
resource = PurePosixPath(entry)
if entry.startswith("META-INF/maven/") and entry.endswith("/pom.properties"):
properties = {}
for line in jar.read(entry).decode("utf-8").splitlines():
key, separator, value = line.partition("=")
if separator and key in {"groupId", "artifactId", "version"}:
properties[key] = value.strip()
if len(properties) == 3:
coordinates.append(properties)
legal_path = LEGAL_NAME.fullmatch(resource.name) or re.search(
r"\.(?:license|notice)(?:\.|$)", resource.name, re.I) or any(
part.lower() in {"license", "licenses"} for part in resource.parts[:-1])
if not legal_path or resource.suffix.lower() not in TEXT_SUFFIXES:
continue
# Legal resources are read in place; archive paths are never extracted.
data = jar.read(entry)
try:
text = data.decode("utf-8-sig")
except UnicodeDecodeError:
text = data.decode("latin-1")
text = text.replace("\r\n", "\n").strip()
if not text:
continue
digest = hashlib.sha256(text.encode("utf-8")).hexdigest()
texts[digest] = text
resources.append({
"path": entry,
"kind": "notice" if re.search(r"(^|[._-])notice([._-]|$)", resource.name, re.I) else "license",
"sha256": digest,
})
jars.append({"name": path.name, "coordinates": coordinates, "resources": resources})
if not jars:
raise ValueError(f"No third-party library JARs found in {archive}")
legal_documents = "\n".join(documents)
missing = [jar["name"] + " / " + resource["path"] for jar in jars for resource in jar["resources"]
if texts[resource["sha256"]] not in legal_documents]
return {"archive": archive.name, "jars": sorted(jars, key=lambda item: item["name"]), "texts": texts,
"missing_legal_resources": missing}


def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--check", action="store_true", help="Require bundled legal documents to reproduce JAR legal resources")
args = parser.parse_args()
output = Path("target/release-audit")
output.mkdir(parents=True, exist_ok=True)
missing = []
for component in ("admin", "bootstrap"):
archives = list(Path(f"shenyu-dist/shenyu-{component}-dist/target").glob(f"apache-shenyu-*-{component}-bin.tar.gz"))
if len(archives) != 1:
raise ValueError(f"Expected one {component} distribution, found {len(archives)}")
report = collect(archives[0])
(output / f"{component}-legal.json").write_text(json.dumps(report, indent=2) + "\n", encoding="utf-8")
print(f"{component}: {len(report['jars'])} third-party JARs, {len(report['texts'])} distinct legal texts")
missing.extend(component + ": " + resource for resource in report["missing_legal_resources"])
if args.check and missing:
raise ValueError("Legal resources missing from distribution documents:\n" + "\n".join(missing))


if __name__ == "__main__":
main()
10 changes: 10 additions & 0 deletions .github/scripts/prepare-e2e-maven-repository-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ fi
mkdir -p "${repository}/fixture/fixture/1.0"
printf 'fixture' > "${repository}/fixture/fixture/1.0/fixture-1.0.jar"
printf 'metadata' > "${repository}/fixture/fixture/1.0/_remote.repositories"
if [[ "$*" == *org.apache.maven.plugins:maven-surefire-plugin:test* ]]; then
if [[ " $* " != *" -N "* || " $* " != *" -Dmaven.test.skip=true "* ]]; then
echo 'Plugin dependency preparation must not compile or execute scenarios' >&2
exit 1
fi
mkdir -p "${repository}/fixture/surefire-runtime/1.0"
printf 'plugin runtime' > "${repository}/fixture/surefire-runtime/1.0/surefire-runtime-1.0.jar"
fi
WRAPPER
chmod +x "${test_dir}/project/mvnw"
cd "${test_dir}/project"
Expand Down Expand Up @@ -140,6 +148,8 @@ DEPENDENCIES
python3 "${script_dir}/e2e-maven-repository.py" restore "${test_dir}/artifact" "${test_dir}/restored"
cmp "${test_dir}/artifact/repository/fixture/fixture/1.0/_remote.repositories" \
"${test_dir}/restored/repository/fixture/fixture/1.0/_remote.repositories"
cmp "${test_dir}/artifact/repository/fixture/surefire-runtime/1.0/surefire-runtime-1.0.jar" \
"${test_dir}/restored/repository/fixture/surefire-runtime/1.0/surefire-runtime-1.0.jar"
cmp "${test_dir}/project/.mvn/wrapper/maven-wrapper.jar" "${test_dir}/restored/wrapper/maven-wrapper.jar"
cmp "${MAVEN_USER_HOME}/wrapper/dists/maven-bin/hash/maven-bin.zip" \
"${test_dir}/restored/maven-user-home/wrapper/dists/maven-bin/hash/maven-bin.zip"
Expand Down
5 changes: 5 additions & 0 deletions .github/scripts/prepare-e2e-maven-repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ if [[ -n "${example_projects}" ]]; then
bash "${script_dir}/maven-with-retry.sh" ./mvnw "${common[@]}" "${examples[@]}" \
"${resolver}:go-offline" "${resolver}:tree" -DoutputType=json -DappendOutput=true \
"-DoutputFile=${artifact_dir}/example-dependencies.json"
# Load the examples' plugin realm: go-offline misses Maven-injected runtime
# dependencies. The parent-only invocation skips tests and compiles no scenarios.
bash "${script_dir}/maven-with-retry.sh" ./mvnw "${common[@]}" \
-f shenyu-examples/pom.xml -N -Dmaven.test.skip=true \
org.apache.maven.plugins:maven-surefire-plugin:test
fi

bash "${script_dir}/maven-with-retry.sh" ./mvnw "${common[@]}" "${tests[@]}" \
Expand Down
20 changes: 20 additions & 0 deletions .github/scripts/restore-shenyu-local-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set -euo pipefail

artifact_dir="${1:-/tmp/shenyu-m2}"
target_dir="${2:-${HOME}/.m2/repository}/org/apache"
project_dir="${3:-${PWD}}"

if [[ -f "${artifact_dir}/repository.tar.gz" ]]; then
tar -xzf "${artifact_dir}/repository.tar.gz" -C "${artifact_dir}"
Expand All @@ -29,6 +30,25 @@ if [[ ! -d "${artifact_dir}/org/apache/shenyu" ]]; then
exit 1
fi

if [[ -f "${artifact_dir}/maven-wrapper.jar" ]]; then
# Reuse the launcher's validated build input instead of downloading it in every shard.
python3 - "${artifact_dir}/maven-wrapper.jar" "${project_dir}/.mvn/wrapper/maven-wrapper.jar" <<'PYTHON'
from pathlib import Path
import sys
import zipfile

source, destination = map(Path, sys.argv[1:])
try:
with zipfile.ZipFile(source) as archive:
if 'org/apache/maven/wrapper/MavenWrapperMain.class' not in archive.namelist() or archive.testzip():
raise SystemExit('Maven wrapper artifact has a missing or corrupt launcher')
except zipfile.BadZipFile:
raise SystemExit('Maven wrapper artifact is not a valid JAR')
destination.parent.mkdir(parents=True, exist_ok=True)
destination.write_bytes(source.read_bytes())
PYTHON
fi

mkdir -p "${target_dir}"
if [[ -d "${target_dir}/shenyu" ]]; then
# Backups under ~/.m2/repository grow every saved dependency cache indefinitely.
Expand Down
29 changes: 28 additions & 1 deletion .github/scripts/test-restore-shenyu-local-repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import tarfile
import tempfile
import unittest
import zipfile
from pathlib import Path

SCRIPT = Path(__file__).with_name("restore-shenyu-local-repo.sh").resolve()
Expand All @@ -35,6 +36,9 @@ def test_archive_and_legacy_handoffs_replace_stale_artifacts(self):
current = artifact / "org/apache/shenyu/module/2.7.3-SNAPSHOT"
current.mkdir(parents=True)
(current / "module.jar").write_text("current")
with zipfile.ZipFile(artifact / "maven-wrapper.jar", "w") as launcher:
launcher.writestr("org/apache/maven/wrapper/MavenWrapperMain.class", "launcher")
project = root / "project"
if archived:
with tarfile.open(artifact / "repository.tar.gz", "w:gz") as archive:
archive.add(artifact / "org", arcname="org")
Expand All @@ -44,13 +48,36 @@ def test_archive_and_legacy_handoffs_replace_stale_artifacts(self):
previous = repository / "org/apache/shenyu/stale"
previous.mkdir(parents=True)
(previous / "old.jar").write_text("stale")
result = subprocess.run(["bash", str(SCRIPT), str(artifact), str(repository)],
result = subprocess.run(["bash", str(SCRIPT), str(artifact), str(repository), str(project)],
env={**os.environ, "RUNNER_TEMP": str(root)}, capture_output=True, text=True)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual((repository / "org/apache/shenyu/module/2.7.3-SNAPSHOT/module.jar").read_text(), "current")
self.assertFalse(previous.exists())
self.assertFalse(list(repository.rglob("shenyu.backup*")))
self.assertEqual(len(list(root.glob("shenyu-m2-previous.*/shenyu/stale/old.jar"))), 1)
self.assertEqual((project / ".mvn/wrapper/maven-wrapper.jar").read_bytes(),
(artifact / "maven-wrapper.jar").read_bytes())

def test_invalid_launcher_preserves_existing_repository_and_wrapper(self):
with tempfile.TemporaryDirectory() as temporary:
root = Path(temporary)
artifact = root / "artifact"
(artifact / "org/apache/shenyu").mkdir(parents=True)
(artifact / "maven-wrapper.jar").write_text("incomplete download")
project = root / "project"
launcher = project / ".mvn/wrapper/maven-wrapper.jar"
launcher.parent.mkdir(parents=True)
launcher.write_text("existing launcher")
repository = root / "repository"
previous = repository / "org/apache/shenyu/old.jar"
previous.parent.mkdir(parents=True)
previous.write_text("existing artifact")
result = subprocess.run(["bash", str(SCRIPT), str(artifact), str(repository), str(project)],
capture_output=True, text=True)
self.assertNotEqual(result.returncode, 0)
self.assertIn("wrapper artifact", result.stderr)
self.assertEqual(launcher.read_text(), "existing launcher")
self.assertEqual(previous.read_text(), "existing artifact")

def test_missing_artifact_fails_before_changing_the_repository(self):
with tempfile.TemporaryDirectory() as temporary:
Expand Down
92 changes: 88 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ name: ci

on:
workflow_dispatch:
inputs:
release_candidate:
description: Build unsigned release artifacts, including Javadoc and source archives
type: boolean
default: false
# Required checks must report a result even for documentation-only PRs.
pull_request:
push:
Expand Down Expand Up @@ -191,17 +196,96 @@ jobs:

- name: Build ShenYu local Maven repository
shell: bash
env:
RELEASE_CANDIDATE: ${{ github.event_name == 'workflow_dispatch' && inputs.release_candidate || false }}
run: |
./mvnw -B -ntp -T 1C install -Prelease -DskipTests -DskipRemoteResources=true \
-Djacoco.skip=true -Dmaven.javadoc.skip=true -Drat.skip=true
release_args=(-Prelease -Dmaven.javadoc.skip=true)
if [[ "$RELEASE_CANDIDATE" == "true" ]]; then
python3 - <<'PYTHON'
import xml.etree.ElementTree as ET
root = ET.parse('pom.xml').getroot()
version = root.findtext('{http://maven.apache.org/POM/4.0.0}version')
if not version or 'SNAPSHOT' in version:
raise SystemExit('Release candidates require a non-SNAPSHOT project version')
print('Building unsigned release candidate:', version)
PYTHON
release_args=(-Prelease,apache-release -Dmaven.javadoc.skip=false -Dgpg.skip=true)
fi
./mvnw -B -ntp -T 1C install "${release_args[@]}" -DskipTests -DskipRemoteResources=true \
-Djacoco.skip=true -Drat.skip=true

mkdir -p /tmp/shenyu-m2
tar -czf /tmp/shenyu-m2/repository.tar.gz -C "${HOME}/.m2/repository" org/apache/shenyu
if [[ "$RELEASE_CANDIDATE" == "true" ]]; then
release_version="$(python3 -c "import xml.etree.ElementTree as E; print(E.parse('pom.xml').getroot().findtext('{http://maven.apache.org/POM/4.0.0}version'))")"
repository_paths=()
for artifact_dir in "${HOME}/.m2/repository/org/apache/shenyu/"*; do
if [[ -d "${artifact_dir}/${release_version}" ]]; then
repository_paths+=("org/apache/shenyu/${artifact_dir##*/}/${release_version}")
fi
done
[[ ${#repository_paths[@]} -gt 0 ]]
tar -czf /tmp/shenyu-m2/repository.tar.gz -C "${HOME}/.m2/repository" "${repository_paths[@]}"
else
tar -czf /tmp/shenyu-m2/repository.tar.gz -C "${HOME}/.m2/repository" org/apache/shenyu
fi
cp .mvn/wrapper/maven-wrapper.jar /tmp/shenyu-m2/maven-wrapper.jar
- name: Resolve distribution runtime dependencies
run: |
bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -pl shenyu-admin,shenyu-bootstrap,shenyu-dist/shenyu-admin-dist,shenyu-dist/shenyu-bootstrap-dist dependency:list \
-DincludeScope=runtime -DoutputFile=target/release-runtime-dependencies.txt
python3 .github/scripts/collect-release-licenses.py
# Fetch the verifier after packaging so its sources cannot enter the source archive.
- name: Check out the pinned ShenYu license verifier
if: github.event_name == 'workflow_dispatch' && inputs.release_candidate
uses: actions/checkout@v4
with:
repository: apache/shenyu-watcher
ref: 94c1bb95ffc65038ea8be4c15fda5167d8d6b675
path: .release-tools/shenyu-watcher
- name: Check candidate distribution licenses
if: github.event_name == 'workflow_dispatch' && inputs.release_candidate
shell: bash
run: |
python3 .github/scripts/collect-release-licenses.py --check
audit_root="${RUNNER_TEMP}/shenyu-release-license-audit"
for component in admin bootstrap; do
archives=("shenyu-dist/shenyu-${component}-dist/target/"apache-shenyu-*-"${component}"-bin.tar.gz)
[[ ${#archives[@]} -eq 1 && -f "${archives[0]}" ]]
mkdir -p "${audit_root}/${component}"
tar -xzf "${archives[0]}" -C "${audit_root}/${component}"
distributions=("${audit_root}/${component}/"apache-shenyu-*-"${component}"-bin)
[[ ${#distributions[@]} -eq 1 && -d "${distributions[0]}/lib" ]]
# The verifier CLI prints failures with exit code zero; enforce its result explicitly.
python3 - "${distributions[0]}/lib" "shenyu-dist/shenyu-${component}-dist" "${distributions[0]}/LICENSE" <<'PYTHON'
import importlib.util
import sys
spec = importlib.util.spec_from_file_location('release_watcher', '.release-tools/shenyu-watcher/shenyu_watcher.py')
watcher = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = watcher
spec.loader.exec_module(watcher)
result = watcher.run_check(sys.argv[2], sys.argv[3], lib_dir=sys.argv[1])
watcher.print_result(result)
if not result.checked or result.unmatched or result.parse_failures:
raise SystemExit('Candidate dependency license declarations are incomplete')
PYTHON
done
- name: Upload distribution runtime dependency reports
uses: actions/upload-artifact@v4
with:
name: shenyu-release-runtime-dependencies
path: |
shenyu-admin/target/release-runtime-dependencies.txt
shenyu-bootstrap/target/release-runtime-dependencies.txt
shenyu-dist/shenyu-admin-dist/target/release-runtime-dependencies.txt
shenyu-dist/shenyu-bootstrap-dist/target/release-runtime-dependencies.txt
target/release-audit/*.json
if-no-files-found: error
retention-days: 7
- name: Upload ShenYu local Maven repository
uses: actions/upload-artifact@v4
with:
name: shenyu-local-maven-repository
path: /tmp/shenyu-m2/repository.tar.gz
path: /tmp/shenyu-m2/
compression-level: 0
if-no-files-found: error
retention-days: 1
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ jobs:
file: ./shenyu-dist/shenyu-admin-dist/docker/Dockerfile
build-args: APP_NAME=apache-shenyu-*-admin-bin
platforms: linux/amd64,linux/arm64
push: true
# Candidate tags still build images, but must not publish an unvoted release as latest.
push: ${{ github.ref_type != 'tag' || !contains(github.ref_name, '-') }}
tags: |
${{ env.REGISTRY }}/${{ env.REPOSITORY }}/admin:latest
${{ env.REGISTRY }}/${{ env.REPOSITORY }}/admin:${{ env.TAG }}
Expand All @@ -110,7 +111,7 @@ jobs:
file: ./shenyu-dist/shenyu-bootstrap-dist/docker/Dockerfile
build-args: APP_NAME=apache-shenyu-*-bootstrap-bin
platforms: linux/amd64,linux/arm64
push: true
push: ${{ github.ref_type != 'tag' || !contains(github.ref_name, '-') }}
tags: |
${{ env.REGISTRY }}/${{ env.REPOSITORY }}/bootstrap:latest
${{ env.REGISTRY }}/${{ env.REPOSITORY }}/bootstrap:${{ env.TAG }}
Loading
Loading