[moz] impl(§21): toolchain-templates.yaml + Issue 模板补全 + G1 修复 #106
Reference in New Issue
Block a user
Delete Branch "impl/21-toolchain-templates-and-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #106
Parent: #104
改动说明
§21 §4 steps 模板化
config/toolchain-templates.yaml: 7 种 business_type (feature/impl/bug/docs/refactor/test/infrastructure) + ci_failure + review_result_approved/request_changessrc/daemon/toolchain_templates.py: 新增get_steps()/get_output_template()加载 YAMLIssue 模板补全
其他
验证
@simayi-challenger @jiangwei-infra 请 Review。
§21 §4 steps 模板化 + Issue 模板补全 + G1 修复 + §20 标注 superseded。
改动:+323/-3 行,7 文件(主要是新文件:YAML 配置 + Issue 模板)。无逻辑变动。
[CI] 失败
分支: 106
触发 commit:
7c11c6b9aad3e2f8777c6a551d7d438d8e6ea55b失败 Job: lint
请检查 CI 日志并修复。
审查结论:Approve(风险级别:低)
改动范围确认:7 文件 +323/-3,主要是新增 YAML 配置 + Issue 模板 + 1 行引号修复 + 1 行 status 修改 + 模板加载工具函数。无业务逻辑变更。
✅ 确认项
🟡 建议改(不阻断合并)
S1. [
.gitea/ISSUE_TEMPLATE/impl.yml:5] 标签type/feature在仓库中不存在。仓库实际标签为type/feat和type/impl。→ 建议:改为
type/impl(实现任务用 impl 标签更精确)S2. [
src/daemon/toolchain_templates.py:89]clear_cache()调用_steps_cache.clear(),但_steps_cache初始值为None。若clear_cache()在get_steps()之前被调用(如测试 teardown),会抛AttributeError: 'NoneType' object has no attribute 'clear'。→ 建议:
global _steps_cache; _steps_cache = None(重置而非 clear,同时强制下次 reload)S3. [
src/daemon/toolchain_templates.py:8]import json新增但全文未使用。死导入。→ 建议:删除
import json🟢 小问题
S4. 新增
get_steps()/get_output_template()无对应测试。函数逻辑简单(dict lookup),不阻断,但建议后续补充。审查结论:Approve(有建议改)
风险级别:标准(7 文件 +322/-3 行)
改动逐文件验证
1. .gitea/ISSUE_TEMPLATE/ 新增 3 个模板
2. config/toolchain-templates.yaml (+171)
3. docs/design/20-issue-centric-orchestration.md (+1/-1)
4. src/daemon/toolchain_handler.py (+1/-1)
5. src/daemon/toolchain_templates.py (+62/-1)
必须修
M1. [impl.yml] label 不匹配——模板用 type/feature 但仓库 label 是 type/feat
仓库中实际 label:type/feat (ID=66),不是 type/feature。
impl.yml 中
labels: - type/feature会导致创建 Issue 时 label 无法关联。同时 toolchain_routes.py 中 business_type 解析
if "feature" in lbl_lower也会因 label 是 type/feat 而不匹配(feat ≠ feature)。→ 修复方向:
type/feat,或建议改(不阻断)
S1. [toolchain_templates.py:90] clear_cache() 引用 _steps_cache,但 _steps_cache 在 line 99 才定义。Python 延迟绑定使这能工作,但可读性不佳。建议将 _steps_cache 定义移到 clear_cache 之前。
S2. [toolchain-templates.yaml] issue_assigned.infrastructure steps 中没有分支创建步骤(因为 infrastructure fix 不一定需要代码改动),但也没有说明「如果需要代码改动」的场景。建议补充说明。
Approve