Commit ddc46d3
committed
ci: enforce codegen sync + raise coverage thresholds from 0%
加两道 CI 卡点,把 SDK 的回归保护从"形同虚设"提到"防得住典型回归"。
开发者改了 `__xxx_async_template.py` 但忘跑 `make codegen`,对应的
`xxx.py` 就和 template 脱节,下次别人跑 codegen 会被覆盖。CI 现在
跑 `make codegen && git diff --exit-code`,发现 diff 直接 fail 并提示
本地补跑 `make codegen` 后提交。
零风险:当前 main 上 `make codegen` 输出零 diff,新 step 立即就能过。
`coverage.yaml` 之前 full / incremental 全设 0,等于不卡。
基于本地实测当前覆盖率(line 90.74% / branch 82.85%)设:
- 全量阈值:line 85 / branch 78(留 ~5% buffer 防 CI 抖动误伤)
- 增量阈值:line 85 / branch 75(推动新代码自带测试)
- directory_overrides:
- utils: 90/90(基础设施代码,保持高线)
- knowledgebase: 95/90(历史高覆盖)
- memory_collection: 80/50(历史短板,不严于现状,先不回退)
- conversation_service: 65/60(历史短板,同上)
`uv run --python 3.10 --all-extras python scripts/check_coverage.py`
本地跑通 23 项检查全 ✅。
- pyink/isort 格式 check:当前 19 个存量文件不合规(含
`tests/e2e/test_workspace_id.py` 等),需要先 reformat 再加 check。
- ruff/pylint lint check
- 多 Python 版本矩阵(目前只跑 3.10)
- E2E on CI(需要 Secret 配 AccessKey)
Change-Id: I8bd1fb2f3262fe77143d606e5f0ebb9125cf0932
Co-developed-by: Claude <noreply@anthropic.com>1 parent 333f548 commit ddc46d3
2 files changed
Lines changed: 70 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
48 | 59 | | |
49 | 60 | | |
50 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
6 | 21 | | |
7 | 22 | | |
8 | 23 | | |
9 | 24 | | |
10 | 25 | | |
11 | 26 | | |
12 | | - | |
| 27 | + | |
13 | 28 | | |
14 | | - | |
| 29 | + | |
15 | 30 | | |
16 | 31 | | |
17 | 32 | | |
18 | 33 | | |
19 | 34 | | |
20 | 35 | | |
21 | | - | |
| 36 | + | |
22 | 37 | | |
23 | | - | |
| 38 | + | |
24 | 39 | | |
25 | 40 | | |
26 | 41 | | |
27 | 42 | | |
28 | 43 | | |
29 | 44 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
0 commit comments