feat: 1、流水线总开关配置 2、删除p0p1p2级别阻断
All checks were successful
Redis序列化结构检查 / redis-schema-check (push) Has been skipped

This commit is contained in:
2026-07-14 10:58:05 +08:00
parent 7a8ca7ce0b
commit 114b053733
10 changed files with 74 additions and 68 deletions

View File

@@ -38,7 +38,6 @@ include_modules:
- `detection.patterns`W01~W03
- `ignore.key_patterns`(锁/计数器/token
- `block_severities`P0/P1/P2
- `detection.min_confidence``max_field_depth`
---
@@ -46,17 +45,14 @@ include_modules:
## 2. 业务仓完整配置示例
```yaml
# 总开关false 时不执行检测、不发通知、流水线直接通过
enabled: true
# 运行模式
# notify - 仅通知,不阻断流水线
# block - 按 block_severities 阻断流水线exit 1
# block - 检测到结构变更即阻断流水线exit 1
mode: notify
# block 模式下触发 exit 1 的严重级别全部阻断P0/P1/P2
block_severities:
- P0
- P1
- P2
# 是否扫描测试代码(已确认:不扫描)
scan_test_sources: false
@@ -146,25 +142,28 @@ include_modules:
## 3. 配置项说明
### 3.1 mode
### 3.1 enabled
总开关。默认 `true`
| 值 | 行为 |
|----|------|
| `true` | 正常执行检测(再按 `mode` / `notify` 行为) |
| `false` | 跳过检测与通知,流水线 `exit 0`(与 `notify.enabled` 无关) |
临时关闭时可仅改此项,无需删除 workflow。
### 3.2 mode
| 值 | 行为 |
|----|------|
| `notify` | 检测到变更 → 发企微 → `exit 0` |
| `block` | 检测到 `block_severities` 中的级别 → 发企微 → `exit 1` |
### 3.2 block_severities
默认 `["P0", "P1", "P2"]``block` 模式下任意级别变更均 `exit 1`
| `block` | 检测到任意结构变更 → 发企微 → `exit 1` |
建议上线初期仍使用 `mode: notify` 观察误报情况,确认稳定后再切换:
```yaml
mode: block
block_severities:
- P0
- P1
- P2
```
### 3.3 notify
@@ -280,7 +279,6 @@ include_modules:
```yaml
mode: block
block_severities: [P0, P1, P2]
include_modules: [] # 扩至全仓
```
@@ -288,7 +286,6 @@ include_modules: [] # 扩至全仓
```yaml
mode: block
block_severities: [P0, P1, P2]
include_modules: [] # 空表示全部模块
detection:
patterns: [W01, W02, W03, W04, W05]