feat(multi-review): support custom reviewer personas from target repo#214
Conversation
Load custom reviewer YAML files from the target repository's .github/reviewers/ directory. Custom personas can extend or override built-in ones (quality, security, performance, architecture, regression-test). Key changes: - Add loadCustomReviewers() in reviewers.ts to scan .github/reviewers/*.yaml|*.yml - Merge custom personas into loadReviewers() with override-on-collision - Pass GITHUB_WORKSPACE as repoDir in index.ts - Add 7 unit tests in custom-reviewers.test.ts - Update README with custom personas documentation Closes #213
|
无需回归测试 检测到的 PR 类型:新功能 该 PR 新增了自定义 reviewer 角色(persona)支持,属于纯新增功能,未修改现有行为。内置 reviewer 的加载逻辑未发生变化,仅在此基础上增加了从 |
|
最终决策:有条件合并 / CONDITIONAL MERGE Quality reviewer 发现一个阻塞性测试隔离问题:测试 "silently skips when .github/reviewers/ does not exist" 因前面的测试创建了目标目录且未清理,实际并未验证目录缺失时的行为。其余 reviewer 均无阻塞项。 阻塞项
建议项
📋 各 Reviewer 详细审查结果quality有条件合并 / CONDITIONAL MERGE 此 PR 总体设计合理,实现清晰,向后兼容性好。但存在一个测试隔离问题需要修复。 阻塞项
建议项
security存在风险 / AT RISK 安全分析摘要 阻塞项:无 建议项
performance性能良好 / GOOD 本次 PR 添加了从仓库
阻塞项:无 建议项:无 architecture架构合理 / SOUND 架构分析摘要本次 PR 为 耦合度: 模块放置: 分层: 自定义 reviewer 的 YAML 解析逻辑直接嵌入在 接口设计: 改动范围: 改动集中在 一致性: 自定义 reviewer 的加载、解析、warning 输出、Map 管理方式均与内置 reviewer 加载逻辑一致。覆盖(override)行为的日志清晰。 阻塞项:无 建议项:无 |
分析总结PR 实现了标题和描述中声明的所有功能,没有发现遗漏。 对照验证:
无遗漏 |
|
Rank: P1 — mergeable after minor fixes. Clean feature with good test coverage. Adds custom reviewer personas from FindingsTest pollution ( Missing CHANGELOG — should-fix: This feature addition needs an entry under @Svtter — thanks for the PR. Both fixes are quick; the feature itself is well-structured and follows existing patterns. |


Summary
Allows target repositories to define custom reviewer personas by placing YAML files in
.github/reviewers/. This enables project-specific review configurations without modifying the action itself.How it works
.yamlor.ymlfiles in your repo's.github/reviewers/directorynameandpromptfieldsdefault-teamjust like built-in onesExample:
Changes
multi-review/src/reviewers.ts: AddloadCustomReviewers()to scan.github/reviewers/, merge intoloadReviewers()multi-review/src/index.ts: PassGITHUB_WORKSPACEasrepoDirfor custom persona resolutionmulti-review/src/custom-reviewers.test.ts: 7 new tests covering custom loading, override, skip-missing-dir, invalid-YAML handling,.ymlextension, and built-in+custom mixingmulti-review/README.md: Document custom personas featuremulti-review/package.json: Addcustom-reviewers.test.tsto test scriptSafety
permission: { edit: "deny", bash: "deny" }already prevents code execution from any custom prompt.github/reviewers/produces no error (fully opt-in)Closes #213