feat: 支持 v2 插件、独立前端和签名制品发布 (#130)

* feat: 支持 v2 插件、原生扩展与签名发布

* fix: 修复测试

* feat: 增强宿主 SDK、运行观测与制品维护能力

* feat: 增强文件传输、配置观测与本地开发能力

* feat: 支持 SSE 实时事件流并完善开发脚手架

* feat: 完善长连接鉴权复核与关闭回收

* feat: 增强生命周期与任务关闭可靠性

* feat: 收紧健康检查契约并补齐前端与真实网络验收

* feat: 增加SDK溯源与离线更新工具并验证跨版本兼容

* feat: 增加持久化业务示例与受控 Python 交付

* feat: 增加统一运行诊断与多worker状态观测

* feat: 增加固定目标发布等待与自动验收

* fix: 修复多环境插件部署前缀与代理配置不一致

* fix: 修复测试
This commit is contained in:
insistence
2026-10-09 23:49:45 +08:00
committed by GitHub
parent a89aec54aa
commit 4bd83bc7cd
287 changed files with 41945 additions and 331 deletions
+97
View File
@@ -0,0 +1,97 @@
name: Native Plugin
on:
push:
branches: [master]
paths:
- 'ruoyi-fastapi-backend/plugins/core/**'
- 'ruoyi-fastapi-backend/plugins/examples/rust/**'
- 'ruoyi-fastapi-backend/plugins/examples/python/task_demo/**'
- 'ruoyi-fastapi-backend/scripts/plugin_task_integration.py'
- 'ruoyi-fastapi-backend/scripts/build_native_plugin.py'
- 'ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/**'
- 'ruoyi-fastapi-backend/cli/runtime/plugin/sdk.py'
- 'ruoyi-fastapi-backend/cli/groups/plugin/commands/developer.py'
- 'ruoyi-fastapi-backend/cli/groups/plugin/commands/sdk.py'
- 'ruoyi-fastapi-backend/cli/groups/plugin/commands/artifact*.py'
- 'ruoyi-fastapi-backend/cli/groups/plugin/artifact_controller.py'
- 'ruoyi-fastapi-backend/cli/groups/plugin/command.py'
- 'ruoyi-fastapi-frontend/src/utils/pluginBridge*'
- 'ruoyi-fastapi-backend/pyproject.toml'
- 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_runtime_scaffold*.py'
- 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_runtime_sdk.py'
- 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_sdk_commands.py'
- 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_artifact_commands.py'
- 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_release_wait.py'
- 'ruoyi-fastapi-backend/tests/plugins/**'
- '.github/workflows/native-plugin.yml'
pull_request:
branches: [master]
paths:
- 'ruoyi-fastapi-backend/plugins/core/**'
- 'ruoyi-fastapi-backend/plugins/examples/rust/**'
- 'ruoyi-fastapi-backend/plugins/examples/python/task_demo/**'
- 'ruoyi-fastapi-backend/scripts/plugin_task_integration.py'
- 'ruoyi-fastapi-backend/scripts/build_native_plugin.py'
- 'ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/**'
- 'ruoyi-fastapi-backend/cli/runtime/plugin/sdk.py'
- 'ruoyi-fastapi-backend/cli/groups/plugin/commands/developer.py'
- 'ruoyi-fastapi-backend/cli/groups/plugin/commands/sdk.py'
- 'ruoyi-fastapi-backend/cli/groups/plugin/commands/artifact*.py'
- 'ruoyi-fastapi-backend/cli/groups/plugin/artifact_controller.py'
- 'ruoyi-fastapi-backend/cli/groups/plugin/command.py'
- 'ruoyi-fastapi-frontend/src/utils/pluginBridge*'
- 'ruoyi-fastapi-backend/pyproject.toml'
- 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_runtime_scaffold*.py'
- 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_runtime_sdk.py'
- 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_sdk_commands.py'
- 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_artifact_commands.py'
- 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_release_wait.py'
- 'ruoyi-fastapi-backend/tests/plugins/**'
- '.github/workflows/native-plugin.yml'
workflow_dispatch:
jobs:
native:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python: ['3.10', '3.11', '3.12', '3.13']
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ruoyi-fastapi-backend
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: ruoyi-fastapi-backend/requirements.txt
- name: Install host and build dependencies
run: python -m pip install -r requirements.txt 'maturin>=1.15,<2' pytest pytest-asyncio aiosqlite
- name: Install Rust
run: rustup toolchain install 1.99.0 --profile minimal --component rustfmt --component clippy
- name: Select Rust
run: rustup default 1.99.0
- name: Check Rust formatting
run: cargo fmt --manifest-path plugins/examples/rust/rust_demo/Cargo.toml --check
- name: Verify v1 and v2 plugin scaffolds
run: python -m pytest tests/cli/runtime/plugin/test_runtime_scaffold.py tests/cli/runtime/plugin/test_runtime_scaffold_v2.py -q
- name: Verify SDK provenance and offline update commands
run: python -m pytest tests/cli/runtime/plugin/test_runtime_sdk.py tests/cli/root/test_plugin_sdk_commands.py -q
- name: Verify persistent task plugin
run: python -m pytest tests/plugins/examples/test_task_demo.py -q
- name: Build and assemble source-free plugin
run: python scripts/build_native_plugin.py --output target/native-package
- name: Check Rust code
run: cargo clippy --manifest-path plugins/examples/rust/rust_demo/Cargo.toml --locked -- -D warnings
- name: Exercise native library through the host runtime
env:
RUOYI_NATIVE_PLUGIN_DIR: ${{ github.workspace }}/ruoyi-fastapi-backend/target/native-package/rust_demo
run: python -m pytest tests/plugins/native tests/plugins/core/native tests/plugins/core/runtime/test_host_services.py tests/plugins/core/runtime/test_job_dispatcher.py -q
- name: Verify signed artifacts and maintenance releases
env:
RUOYI_NATIVE_PLUGIN_DIR: ${{ github.workspace }}/ruoyi-fastapi-backend/target/native-package/rust_demo
run: python -m pytest tests/plugins/core/artifacts tests/plugins/core/deployment tests/plugins/core/management/test_release_dao.py tests/plugins/core/management/test_artifact_views.py tests/module_plugin/controller/test_plugin_release_controller.py tests/cli/root/test_plugin_artifact_commands.py tests/cli/root/test_plugin_release_wait.py tests/sql/test_plugin_release_schema.py -q
+69
View File
@@ -0,0 +1,69 @@
name: Plugin Frontend Tests
on:
push:
branches: [master]
paths:
- 'ruoyi-fastapi-frontend/src/api/system/plugin.js'
- 'ruoyi-fastapi-frontend/src/components/PluginFrame/**'
- 'ruoyi-fastapi-frontend/src/views/system/plugin/**'
- 'ruoyi-fastapi-frontend/src/utils/**'
- 'ruoyi-fastapi-frontend/src/plugins/**'
- 'ruoyi-fastapi-frontend/src/router/**'
- 'ruoyi-fastapi-frontend/src/store/modules/permission.js'
- 'ruoyi-fastapi-frontend/src/store/modules/user.js'
- 'ruoyi-fastapi-frontend/src/permission.js'
- 'ruoyi-fastapi-frontend/plugins/**'
- 'ruoyi-fastapi-frontend/tests/plugins/**'
- 'ruoyi-fastapi-frontend/tests/run-tests.js'
- 'ruoyi-fastapi-frontend/package.json'
- 'ruoyi-fastapi-frontend/package-lock.json'
- 'ruoyi-fastapi-frontend/vite.config.js'
- 'ruoyi-fastapi-frontend/vite/**'
- 'ruoyi-fastapi-backend/plugins/examples/python/bundle_demo/web/**'
- '.github/workflows/plugin-frontend.yml'
pull_request:
branches: [master]
paths:
- 'ruoyi-fastapi-frontend/src/api/system/plugin.js'
- 'ruoyi-fastapi-frontend/src/components/PluginFrame/**'
- 'ruoyi-fastapi-frontend/src/views/system/plugin/**'
- 'ruoyi-fastapi-frontend/src/utils/**'
- 'ruoyi-fastapi-frontend/src/plugins/**'
- 'ruoyi-fastapi-frontend/src/router/**'
- 'ruoyi-fastapi-frontend/src/store/modules/permission.js'
- 'ruoyi-fastapi-frontend/src/store/modules/user.js'
- 'ruoyi-fastapi-frontend/src/permission.js'
- 'ruoyi-fastapi-frontend/plugins/**'
- 'ruoyi-fastapi-frontend/tests/plugins/**'
- 'ruoyi-fastapi-frontend/tests/run-tests.js'
- 'ruoyi-fastapi-frontend/package.json'
- 'ruoyi-fastapi-frontend/package-lock.json'
- 'ruoyi-fastapi-frontend/vite.config.js'
- 'ruoyi-fastapi-frontend/vite/**'
- 'ruoyi-fastapi-backend/plugins/examples/python/bundle_demo/web/**'
- '.github/workflows/plugin-frontend.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
plugins:
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: ruoyi-fastapi-frontend
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: '22'
cache: npm
cache-dependency-path: ruoyi-fastapi-frontend/package.json
- name: Install frontend dependencies
# This repository does not commit npm lockfiles, so npm ci is not available.
run: npm install --no-audit --no-fund --package-lock=false
- name: Verify plugin bridge, sessions and management views
run: npm run test:plugin
@@ -0,0 +1,63 @@
name: Plugin Network Smoke
on:
pull_request:
branches: [master]
paths:
- 'ruoyi-fastapi-backend/plugins/**'
- 'ruoyi-fastapi-backend/module_plugin/**'
- 'ruoyi-fastapi-backend/module_admin/service/login_service.py'
- 'ruoyi-fastapi-backend/common/**'
- 'ruoyi-fastapi-backend/config/**'
- 'ruoyi-fastapi-backend/middlewares/**'
- 'ruoyi-fastapi-backend/utils/**'
- 'ruoyi-fastapi-backend/tests/**'
- 'ruoyi-fastapi-backend/requirements.txt'
- 'ruoyi-fastapi-backend/pyproject.toml'
- 'ruoyi-fastapi-frontend/**'
- '.github/workflows/plugin-network-smoke.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
browser:
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: ruoyi-fastapi-backend
env:
RUOYI_PLUGIN_NETWORK_SMOKE: '1'
# The fixture replaces account, DB and Redis access; no external service is used.
DB_SOURCES: '{"primary":{"db_type":"mysql","db_host":"127.0.0.1","db_port":3306,"db_username":"network-smoke","db_password":"network-smoke","db_database":"network-smoke"}}'
JWT_SECRET_KEY: 'isolated-plugin-network-smoke-ci-only'
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: pip
cache-dependency-path: ruoyi-fastapi-backend/requirements.txt
- uses: actions/setup-node@v6
with:
node-version: '22'
cache: npm
cache-dependency-path: ruoyi-fastapi-frontend/package.json
- name: Install host and browser test dependencies
run: python -m pip install -r requirements.txt pytest pytest-asyncio aiosqlite playwright
- name: Install Chromium
run: python -m playwright install --with-deps chromium
- name: Install frontend dependencies
# This repository does not commit npm lockfiles, so npm ci is not available.
run: npm --prefix ../ruoyi-fastapi-frontend install --no-audit --no-fund --package-lock=false
- name: Verify HTTPS proxy, iframe sessions and long connections
run: python -m pytest tests/plugins/integration/test_network_smoke.py -v --junitxml=target/plugin-network-smoke/results.xml
- name: Upload browser trace, screenshots and proxy log
if: always()
uses: actions/upload-artifact@v4
with:
name: plugin-network-smoke
path: ruoyi-fastapi-backend/target/plugin-network-smoke/
retention-days: 7
@@ -0,0 +1,94 @@
name: Plugin Release Integration
on:
pull_request:
branches: [master]
paths:
- 'ruoyi-fastapi-backend/plugins/core/**'
- 'ruoyi-fastapi-backend/plugins/examples/python/task_demo/**'
- 'ruoyi-fastapi-frontend/src/utils/pluginBridge.js'
- 'ruoyi-fastapi-backend/config/**'
- 'ruoyi-fastapi-backend/cli/groups/plugin/**'
- 'ruoyi-fastapi-backend/cli/runtime/plugin/**'
- 'ruoyi-fastapi-backend/module_plugin/**'
- 'ruoyi-fastapi-backend/server.py'
- 'ruoyi-fastapi-backend/app.py'
- 'ruoyi-fastapi-backend/sql/ruoyi-fastapi*.sql'
- 'ruoyi-fastapi-backend/scripts/plugin_release_integration.py'
- 'ruoyi-fastapi-backend/scripts/plugin_task_integration.py'
- 'ruoyi-fastapi-backend/tests/plugins/**'
- 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_artifact_commands.py'
- 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_release_wait.py'
- 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_diagnostics.py'
- 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/**'
- 'ruoyi-fastapi-backend/tests/module_plugin/**'
- 'ruoyi-fastapi-backend/tests/server/test_plugin_runtime.py'
- 'ruoyi-fastapi-backend/tests/sql/test_plugin_release_schema.py'
- 'ruoyi-fastapi-backend/pyproject.toml'
- 'ruoyi-fastapi-backend/requirements.txt'
- 'ruoyi-fastapi-backend/requirements-pg.txt'
- '.github/workflows/plugin-release-integration.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
release:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ['3.10', '3.11', '3.12', '3.13']
defaults:
run:
working-directory: ruoyi-fastapi-backend
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ci-only-mysql
ports: ['3306:3306']
options: >-
--health-cmd="mysqladmin ping -h localhost"
--health-interval=10s --health-timeout=5s --health-retries=12
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: ci-only-postgres
ports: ['5432:5432']
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s --health-timeout=5s --health-retries=12
redis:
image: redis:6.2
ports: ['6379:6379']
options: >-
--health-cmd="redis-cli ping"
--health-interval=10s --health-timeout=5s --health-retries=12
env:
RUOYI_PLUGIN_IT_ALLOW: '1'
RUOYI_IT_MYSQL_PASSWORD: ci-only-mysql
RUOYI_IT_PG_PASSWORD: ci-only-postgres
RUOYI_IT_REDIS_PASSWORD: ''
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: ruoyi-fastapi-backend/requirements*.txt
- name: Install host dependencies
run: python -m pip install -r requirements.txt -r requirements-pg.txt
- uses: actions/setup-node@v5
with:
node-version: '22'
- name: Test and build task plugin bundle
run: |
npm --prefix plugins/examples/python/task_demo/web install --no-audit --no-fund --package-lock=false
npm --prefix plugins/examples/python/task_demo/web test
npm --prefix plugins/examples/python/task_demo/web run build
- name: Verify MySQL and Redis maintenance releases
run: python scripts/plugin_release_integration.py --engine mysql
- name: Verify PostgreSQL and Redis maintenance releases
run: python scripts/plugin_release_integration.py --engine postgresql