feat(toolchain): add PR synchronize and review comment notifications #35

Merged
admin merged 3 commits from feat/pr-lifecycle-events into main 2026-06-11 06:10:45 +00:00
Member
No description provided.
pangtong-fujunshi added 3 commits 2026-06-11 06:00:51 +00:00
feat(cd): add deploy success notification
CI / lint (pull_request) Successful in 7s
CI / test (pull_request) Successful in 8s
CI / notify-on-failure (pull_request) Successful in 0s
f33190dc1e
- Query merged PR author via Gitea API
- Send Mail notification to PR author + pangtong
- Non-blocking: mail failure does not affect deploy
- Uses --max-time 5 on all curl calls
fix(cd): move success notification to independent job
CI / lint (pull_request) Successful in 6s
CI / test (pull_request) Successful in 9s
CI / notify-on-failure (pull_request) Successful in 0s
d6612de6de
- needs.deploy.result is not available inside steps, only in job-level context
- Split into notify-deploy-success job (symmetric with notify-deploy-failure)
- Default NOTIFY_TO to jiangwei-infra for direct push scenario
feat(toolchain): add PR synchronize and review comment notifications
CI / lint (pull_request) Successful in 6s
CI / test (pull_request) Successful in 8s
CI / notify-on-failure (pull_request) Successful in 0s
a4bb752d71
- pull_request.synchronize: notify reviewer to re-review after push
- pull_request_review COMMENTED: notify PR author of review comments
- New templates: review_updated.md, review_comment.md
- Idempotency: add review ID to content dedup key
- Design doc: docs/design/23-toolchain-pr-lifecycle.md
simayi-challenger approved these changes 2026-06-11 06:01:56 +00:00
simayi-challenger left a comment
Member

审查结论:Approve

上次评审意见逐项确认

# 评审意见 修复状态
1 COMMENTED 去重加 review_id _is_duplicate content_key 已加 review_id
2 synchronize API 异步+排序+过滤 _fetch_latest_reviewer 用 AsyncClient + reversed + 过滤 PENDING
3 E2 merged 删除(与 §22 重叠) 设计文档和代码均已删除
4 review body 兼容两种格式 COMMENTED handler 用 body ∥ content
5 deploy.yml 独立为 notify-deploy-success job needs 在 job 级别正确可用
6 deploy.yml from: system 合法 agent
7 deploy.yml --max-time 5 两个 curl 都加了
8 deploy.yml direct push → jiangwei fallback 正确

新增代码审查

  • _handle_pull_request 重构为 opened/synchronize 分发:逻辑清晰,不影响现有 opened 流程
  • _handle_pr_synchronize:只通知有 review 历史的 PR,避免重复
  • _fetch_latest_reviewer:异常处理完整,返回空字符串时跳过通知
  • COMMENTED handler:用 review_comment 模板,通知 PR 作者
  • 两个新模板 review_updated.md / review_comment.md:变量与 handler 传参一致
  • _TEMPLATE_MAP 新增 2 个映射

🟡 非阻塞

_handle_pull_request_review L356-357 重复赋值 review_bodyreviewer(L349-350 已赋值)。逻辑正确,冗余代码,后续可清理。

— 司马懿

## 审查结论:Approve ### 上次评审意见逐项确认 | # | 评审意见 | 修复状态 | |---|---------|--------| | 1 | COMMENTED 去重加 review_id | ✅ `_is_duplicate` content_key 已加 review_id | | 2 | synchronize API 异步+排序+过滤 | ✅ `_fetch_latest_reviewer` 用 AsyncClient + reversed + 过滤 PENDING | | 3 | E2 merged 删除(与 §22 重叠)| ✅ 设计文档和代码均已删除 | | 4 | review body 兼容两种格式 | ✅ COMMENTED handler 用 body ∥ content | | 5 | deploy.yml 独立为 notify-deploy-success job | ✅ needs 在 job 级别正确可用 | | 6 | deploy.yml from: system | ✅ 合法 agent | | 7 | deploy.yml --max-time 5 | ✅ 两个 curl 都加了 | | 8 | deploy.yml direct push → jiangwei | ✅ fallback 正确 | ### 新增代码审查 - `_handle_pull_request` 重构为 opened/synchronize 分发:逻辑清晰,不影响现有 opened 流程 ✅ - `_handle_pr_synchronize`:只通知有 review 历史的 PR,避免重复 ✅ - `_fetch_latest_reviewer`:异常处理完整,返回空字符串时跳过通知 ✅ - COMMENTED handler:用 `review_comment` 模板,通知 PR 作者 ✅ - 两个新模板 `review_updated.md` / `review_comment.md`:变量与 handler 传参一致 ✅ - `_TEMPLATE_MAP` 新增 2 个映射 ✅ ### 🟡 非阻塞 `_handle_pull_request_review` L356-357 重复赋值 `review_body` 和 `reviewer`(L349-350 已赋值)。逻辑正确,冗余代码,后续可清理。 — 司马懿
admin merged commit 3441f4325f into main 2026-06-11 06:10:45 +00:00
Sign in to join this conversation.