From 4a6a1806f6127f206cc911008af50a8e960a2e5a Mon Sep 17 00:00:00 2001 From: JeffreyChen Date: Wed, 29 Apr 2026 00:48:27 +0800 Subject: [PATCH 1/2] docs: render architecture diagram with mermaid --- README.md | 54 +++++++++++++++++++++++------------------- README/README_zh-CN.md | 54 +++++++++++++++++++++++------------------- README/README_zh-TW.md | 54 +++++++++++++++++++++++------------------- 3 files changed, 87 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index 871abab..2f7e84c 100644 --- a/README.md +++ b/README.md @@ -112,31 +112,35 @@ pip install -r requirements.txt ## Architecture -``` -┌─────────────────────────────────────────────────────────────────┐ -│ CLI / MCP / GUI / Control Socket │ -└──────────────────┬──────────────────────────────────────────────┘ - │ action JSON -┌──────────────────▼──────────────────────────────────────────────┐ -│ Action Executor (LD_* dispatch + safe builtins) │ -└──────────────────┬──────────────────────────────────────────────┘ - │ start_test -┌──────────────────▼──────────────────────────────────────────────┐ -│ locust_wrapper_proxy (per-protocol task store) │ -└──────────────────┬──────────────────────────────────────────────┘ - │ - ┌───────────────┴───────────────┬──────────────┬──────────────┐ - ▼ ▼ ▼ ▼ -HTTP / FastHttp WebSocket gRPC MQTT Raw TCP / UDP - │ │ │ │ - └───────────────┬───────────────┴──────────────┴──────────────┘ - │ Locust events - ┌───────────────┴───────────────┐ - ▼ ▼ -test_record_instance Prometheus / InfluxDB / OTel - │ - ├── HTML / JSON / XML / CSV / JUnit / Summary reports - └── SQLite persistence (cross-run comparison) +```mermaid +flowchart TD + subgraph Entry["Entry Surfaces"] + CLI[CLI] + MCP[MCP Server] + GUI[GUI] + SOCK[Control Socket] + end + + Entry -- "action JSON" --> EXEC["Action Executor
(LD_* dispatch + safe builtins)"] + EXEC -- "start_test" --> WRAPPER["locust_wrapper_proxy
(per-protocol task store)"] + + WRAPPER --> HTTP["HTTP / FastHttp"] + WRAPPER --> WS["WebSocket"] + WRAPPER --> GRPC["gRPC"] + WRAPPER --> MQTT["MQTT"] + WRAPPER --> RAW["Raw TCP / UDP"] + + HTTP -- "Locust events" --> BUS([Locust Event Bus]) + WS --> BUS + GRPC --> BUS + MQTT --> BUS + RAW --> BUS + + BUS --> REC["test_record_instance"] + BUS --> METRICS["Prometheus / InfluxDB / OTel"] + + REC --> REPORTS["HTML / JSON / XML / CSV / JUnit / Summary reports"] + REC --> SQLITE[("SQLite persistence
(cross-run comparison)")] ``` The dependency direction always points from the action layer down to Locust, never the other way around. diff --git a/README/README_zh-CN.md b/README/README_zh-CN.md index 0301d51..254ca88 100644 --- a/README/README_zh-CN.md +++ b/README/README_zh-CN.md @@ -107,31 +107,35 @@ pip install -r requirements.txt ## 架构 -``` -┌─────────────────────────────────────────────────────────────────┐ -│ CLI / MCP / GUI / 控制 Socket │ -└──────────────────┬──────────────────────────────────────────────┘ - │ 动作 JSON -┌──────────────────▼──────────────────────────────────────────────┐ -│ 动作 Executor(LD_* 派发 + 安全 builtin) │ -└──────────────────┬──────────────────────────────────────────────┘ - │ start_test -┌──────────────────▼──────────────────────────────────────────────┐ -│ locust_wrapper_proxy(每协议 task store) │ -└──────────────────┬──────────────────────────────────────────────┘ - │ - ┌───────────────┴───────────────┬──────────────┬──────────────┐ - ▼ ▼ ▼ ▼ -HTTP / FastHttp WebSocket gRPC MQTT 原生 TCP / UDP - │ │ │ │ - └───────────────┬───────────────┴──────────────┴──────────────┘ - │ Locust 事件 - ┌───────────────┴───────────────┐ - ▼ ▼ -test_record_instance Prometheus / InfluxDB / OTel - │ - ├── HTML / JSON / XML / CSV / JUnit / Summary 报告 - └── SQLite 持久化(跨次比对) +```mermaid +flowchart TD + subgraph Entry["入口接口"] + CLI[CLI] + MCP[MCP Server] + GUI[GUI] + SOCK[控制 Socket] + end + + Entry -- "动作 JSON" --> EXEC["动作 Executor
(LD_* 派发 + 安全 builtin)"] + EXEC -- "start_test" --> WRAPPER["locust_wrapper_proxy
(每协议 task store)"] + + WRAPPER --> HTTP["HTTP / FastHttp"] + WRAPPER --> WS["WebSocket"] + WRAPPER --> GRPC["gRPC"] + WRAPPER --> MQTT["MQTT"] + WRAPPER --> RAW["原生 TCP / UDP"] + + HTTP -- "Locust 事件" --> BUS([Locust Event Bus]) + WS --> BUS + GRPC --> BUS + MQTT --> BUS + RAW --> BUS + + BUS --> REC["test_record_instance"] + BUS --> METRICS["Prometheus / InfluxDB / OTel"] + + REC --> REPORTS["HTML / JSON / XML / CSV / JUnit / Summary 报告"] + REC --> SQLITE[("SQLite 持久化
(跨次比对)")] ``` 依赖方向永远是动作层 → Locust。 diff --git a/README/README_zh-TW.md b/README/README_zh-TW.md index 0bf0bd6..2f5a3be 100644 --- a/README/README_zh-TW.md +++ b/README/README_zh-TW.md @@ -107,31 +107,35 @@ pip install -r requirements.txt ## 架構 -``` -┌─────────────────────────────────────────────────────────────────┐ -│ CLI / MCP / GUI / 控制 Socket │ -└──────────────────┬──────────────────────────────────────────────┘ - │ 動作 JSON -┌──────────────────▼──────────────────────────────────────────────┐ -│ 動作 Executor(LD_* 派發 + 安全 builtin) │ -└──────────────────┬──────────────────────────────────────────────┘ - │ start_test -┌──────────────────▼──────────────────────────────────────────────┐ -│ locust_wrapper_proxy(每協定 task store) │ -└──────────────────┬──────────────────────────────────────────────┘ - │ - ┌───────────────┴───────────────┬──────────────┬──────────────┐ - ▼ ▼ ▼ ▼ -HTTP / FastHttp WebSocket gRPC MQTT 原生 TCP / UDP - │ │ │ │ - └───────────────┬───────────────┴──────────────┴──────────────┘ - │ Locust 事件 - ┌───────────────┴───────────────┐ - ▼ ▼ -test_record_instance Prometheus / InfluxDB / OTel - │ - ├── HTML / JSON / XML / CSV / JUnit / Summary 報告 - └── SQLite 持久化(跨次比對) +```mermaid +flowchart TD + subgraph Entry["入口介面"] + CLI[CLI] + MCP[MCP Server] + GUI[GUI] + SOCK[控制 Socket] + end + + Entry -- "動作 JSON" --> EXEC["動作 Executor
(LD_* 派發 + 安全 builtin)"] + EXEC -- "start_test" --> WRAPPER["locust_wrapper_proxy
(每協定 task store)"] + + WRAPPER --> HTTP["HTTP / FastHttp"] + WRAPPER --> WS["WebSocket"] + WRAPPER --> GRPC["gRPC"] + WRAPPER --> MQTT["MQTT"] + WRAPPER --> RAW["原生 TCP / UDP"] + + HTTP -- "Locust 事件" --> BUS([Locust Event Bus]) + WS --> BUS + GRPC --> BUS + MQTT --> BUS + RAW --> BUS + + BUS --> REC["test_record_instance"] + BUS --> METRICS["Prometheus / InfluxDB / OTel"] + + REC --> REPORTS["HTML / JSON / XML / CSV / JUnit / Summary 報告"] + REC --> SQLITE[("SQLite 持久化
(跨次比對)")] ``` 依賴方向永遠是動作層 → Locust。 From 5330e8e9b630a4d8f78c2edfef1004d84b305430 Mon Sep 17 00:00:00 2001 From: JeffreyChen Date: Thu, 30 Apr 2026 15:28:48 +0800 Subject: [PATCH 2/2] fix: restrict PyPI publish to push events on main Gate publish workflow on workflow_run.event == 'push' so scheduled CI runs no longer trigger daily releases. Only merges/pushes to main now publish a new version. --- .github/workflows/publish-pypi.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 92bed00..7881ecb 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -16,10 +16,11 @@ jobs: # gate strictly on the main branch and check out the exact commit # that passed CI, avoiding any race with a later push to main and # ensuring no fork-originated ref is ever materialised here. + # Restrict to `push` events so scheduled CI runs do not publish. if: >- ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' - && github.event.workflow_run.event != 'pull_request' }} + && github.event.workflow_run.event == 'push' }} runs-on: ubuntu-latest steps: