feat(tracker): wire GitHub adapter into watcher/router/resolver + GithubClient methods - #55
Merged
Merged
Conversation
## 主要改动
- gitea_watcher / im_reply_router / issue_resolver: 三处硬编码 GiteaClient()
改走 build_tracker_client(tracker_config), 按 WORKFLOW.md tracker.provider 选 client
- github_client: 补 get_pr (对齐 GiteaClient.get_pr) + search_issues
(Gitea 风格 params -> GitHub /search/issues q 查询, 解包 items 信封,
back-fill repository.full_name 让上层无感)
- github_client._paginate: 加可选 unwrap_key, 支持 /search/* 的 {items:[...]} 信封
## 设计决策
- 无注入 client / 无 tracker 配置 -> 默认 Gitea (向后兼容)
- DI 路径 (client=mock / gitea_client=mock) 不受影响, 仍优先
- get_pr/search_issues 签名+返回结构对齐 GiteaClient, auto_review (get_pr/search_issues)
上层无需改动
- issue_resolver 只换 client 工厂, 不碰 repo-base 路径那块
## 测试
- test_github_client: get_pr 端点路由 + 透传; search_issues 翻译/解包/repo 反解;
_build_search_query 各 qualifier 映射
- test_tracker_factory_wiring: 三处调用点 default->Gitea / github->Github /
注入 client 绕过 factory
- 全量: pytest tests/ -> 707 passed
- 实跑 (无 mock factory): 工厂选型 + watcher 接线 + get_pr/search_issues 端点路由确认
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
git_board.py 的 REVIEW/RELATED/ALL scope 通过 _SCOPE_PARAMS 发送 boolean
key review_requested / reviewed (见 git_board._SCOPE_PARAMS / _BOOLEAN_KEYS),
但 _build_search_query 之前只翻译 reviewer, 导致这两个 key 被静默丢弃 ->
GitHub provider 下 REVIEW/RELATED scope 退化成无过滤全量搜索.
## 主要改动
- github_client._build_search_query: 新增 review_requested -> review-requested:
和 reviewed -> reviewed-by: 翻译 ("true" -> @me, 同 assigned/mentioned/created
的处理); reviewer 及其它 key 行为不变
- test_github_client: 用 git_board REVIEW scope fan-out 后的真实参数
({type,state,review_requested/reviewed}) 调 _build_search_query / search_issues,
断言这俩 key 不再被丢弃
## 测试
- pytest tests/test_github_client.py tests/test_tracker_factory_wiring.py: 36 passed
- pytest tests/test_git_board.py: 23 passed (无回归)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
把已写好但悬空的 GitHub adapter 接进生产路径:
gitea_watcher/im_reply_router/issue_resolver三处硬编码GiteaClient()改走build_tracker_client(默认 gitea 行为不变,向后兼容);GithubClient补get_pr/search_issues。含评审 Major 修复:
_build_search_query补齐review_requested/reviewedkey(此前漏翻,GitHub provider 下 REVIEW scope 会静默丢过滤)。Verification (独立评审 agent 复跑)
不做的事
reviewer分支(git_board 从不发)留为兼容,未清(死代码,可后续清)🤖 Generated with Claude Code