Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
97 changes: 97 additions & 0 deletions .github/workflows/native-plugin.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 69 additions & 0 deletions .github/workflows/plugin-frontend.yml
Original file line number Diff line number Diff line change
@@ -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
63 changes: 63 additions & 0 deletions .github/workflows/plugin-network-smoke.yml
Original file line number Diff line number Diff line change
@@ -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
94 changes: 94 additions & 0 deletions .github/workflows/plugin-release-integration.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions ruoyi-fastapi-backend/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,15 @@ PLUGIN_DEPENDENCY_PIP_INDEX_URL = ''
PLUGIN_DEPENDENCY_NPM_REGISTRY = ''
# 单条依赖安装命令超时时间(秒)
PLUGIN_DEPENDENCY_INSTALL_TIMEOUT = 600

# -------- 签名插件制品与维护发布配置 --------
# 是否启用签名插件制品;启用前必须配置外部信任公钥文件
PLUGIN_ARTIFACT_ENABLED = false
# 不可变制品存储目录,相对路径基于后端项目根目录解析
PLUGIN_ARTIFACT_STORE = 'vf_admin/plugin_artifacts'
# 宿主管理的发布者公钥 JSON 文件路径;启用时必填,相对路径基于后端项目根目录解析
PLUGIN_ARTIFACT_TRUST_FILE = ''
# 宿主 worker 心跳间隔(秒),取值范围为 1 至 60
PLUGIN_ARTIFACT_HEARTBEAT_SECONDS = 15
# 宿主 worker 心跳失效时间(秒),取值范围为 3 至 600,且不得小于心跳间隔的三倍
PLUGIN_ARTIFACT_WORKER_TTL_SECONDS = 60
12 changes: 12 additions & 0 deletions ruoyi-fastapi-backend/.env.dockermy
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,15 @@ PLUGIN_DEPENDENCY_PIP_INDEX_URL = ''
PLUGIN_DEPENDENCY_NPM_REGISTRY = ''
# 单条依赖安装命令超时时间(秒)
PLUGIN_DEPENDENCY_INSTALL_TIMEOUT = 600

# -------- 签名插件制品与维护发布配置 --------
# 是否启用签名插件制品;启用前必须配置外部信任公钥文件
PLUGIN_ARTIFACT_ENABLED = false
# 不可变制品存储目录,相对路径基于后端项目根目录解析
PLUGIN_ARTIFACT_STORE = 'vf_admin/plugin_artifacts'
# 宿主管理的发布者公钥 JSON 文件路径;启用时必填,相对路径基于后端项目根目录解析
PLUGIN_ARTIFACT_TRUST_FILE = ''
# 宿主 worker 心跳间隔(秒),取值范围为 1 至 60
PLUGIN_ARTIFACT_HEARTBEAT_SECONDS = 15
# 宿主 worker 心跳失效时间(秒),取值范围为 3 至 600,且不得小于心跳间隔的三倍
PLUGIN_ARTIFACT_WORKER_TTL_SECONDS = 60
12 changes: 12 additions & 0 deletions ruoyi-fastapi-backend/.env.dockerpg
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,15 @@ PLUGIN_DEPENDENCY_PIP_INDEX_URL = ''
PLUGIN_DEPENDENCY_NPM_REGISTRY = ''
# 单条依赖安装命令超时时间(秒)
PLUGIN_DEPENDENCY_INSTALL_TIMEOUT = 600

# -------- 签名插件制品与维护发布配置 --------
# 是否启用签名插件制品;启用前必须配置外部信任公钥文件
PLUGIN_ARTIFACT_ENABLED = false
# 不可变制品存储目录,相对路径基于后端项目根目录解析
PLUGIN_ARTIFACT_STORE = 'vf_admin/plugin_artifacts'
# 宿主管理的发布者公钥 JSON 文件路径;启用时必填,相对路径基于后端项目根目录解析
PLUGIN_ARTIFACT_TRUST_FILE = ''
# 宿主 worker 心跳间隔(秒),取值范围为 1 至 60
PLUGIN_ARTIFACT_HEARTBEAT_SECONDS = 15
# 宿主 worker 心跳失效时间(秒),取值范围为 3 至 600,且不得小于心跳间隔的三倍
PLUGIN_ARTIFACT_WORKER_TTL_SECONDS = 60
12 changes: 12 additions & 0 deletions ruoyi-fastapi-backend/.env.prod
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,15 @@ PLUGIN_DEPENDENCY_PIP_INDEX_URL = ''
PLUGIN_DEPENDENCY_NPM_REGISTRY = ''
# 单条依赖安装命令超时时间(秒)
PLUGIN_DEPENDENCY_INSTALL_TIMEOUT = 600

# -------- 签名插件制品与维护发布配置 --------
# 是否启用签名插件制品;启用前必须配置外部信任公钥文件
PLUGIN_ARTIFACT_ENABLED = false
# 不可变制品存储目录,相对路径基于后端项目根目录解析
PLUGIN_ARTIFACT_STORE = 'vf_admin/plugin_artifacts'
# 宿主管理的发布者公钥 JSON 文件路径;启用时必填,相对路径基于后端项目根目录解析
PLUGIN_ARTIFACT_TRUST_FILE = ''
# 宿主 worker 心跳间隔(秒),取值范围为 1 至 60
PLUGIN_ARTIFACT_HEARTBEAT_SECONDS = 15
# 宿主 worker 心跳失效时间(秒),取值范围为 3 至 600,且不得小于心跳间隔的三倍
PLUGIN_ARTIFACT_WORKER_TTL_SECONDS = 60
Loading
Loading