feat(issue-feed): trigger IssueTriage bot on new issues#17
Conversation
When a new issue is opened, send an @mention message to IssueTriage bot in the issue-feed channel with a structured TRIAGE URL payload. IssueTriage bot will: - Parse org/repo/issue number from the URL - Fetch full issue content via gh CLI - Apply type and priority labels (idempotent) No new inputs or secrets required. Zero changes to per-repo callers.
yujiawei
left a comment
There was a problem hiding this comment.
Code Review — PR #17 (.github)
Summary
This PR adds a third send() call in the octo-issue-feed.yml reusable workflow to trigger the IssueTriage bot when a new issue is opened. The triage message is sent to the same issue-feed channel with an @mention payload so IssueTriage can pick it up, fetch the issue, and apply labels.
Verdict: Approve
The change is minimal (+9 lines), well-scoped, and non-breaking. The logic is correct and the implementation is clean.
Detailed Findings
✅ Correctness
- The
if action == 'opened'guard correctly limits the triage trigger to new issues only — no spurious triggers onclosed,reopened, orlabeledevents. - The
send()function already handles retries and failure tracking, so the new call gets the same reliability guarantees as the existing ones. - The
repoandnumvariables used in the f-string are already validated viarequire_env()earlier in the script.
✅ Channel target
- The triage message is sent to
151a45970e1546afa9e947ac36a5c4e5(the issue-feed channel) — same as the existing feed message. This is consistent with the described architecture where IssueTriage listens on the issue-feed channel.
✅ Failure handling
- If
send()fails for the triage message, it appends to thefailedlist and the workflow still exits non-zero. This is correct — a failed triage trigger should surface as a workflow failure.
⚠️ Minor observations (non-blocking)
-
Ordering: The triage message is sent after both
feed_msgandproj_msg. This means if the first two succeed but triage fails, the workflow exits non-zero even though the primary notifications were delivered. This is acceptable (fail-loud is better than silent skip), but worth noting. -
Hardcoded channel ID: The channel
151a45970e1546afa9e947ac36a5c4e5is used twice now (forfeed_msgandtriage_msg). Extracting it to a variable (e.g.FEED_CHANNEL_ID) would reduce duplication, but this is a style nit — not worth blocking. -
Bot mention string: The
@[27pmzxx8nad78c9d01e_bot:Octo 助理-IssueTriage]format is opaque but presumably matches the Octo IM mention syntax. If the bot ID ever changes, this string needs updating — consider documenting this coupling in a comment. Again, non-blocking.
Security
- No new secrets, permissions, or external inputs introduced.
- The URL in the triage message is constructed from validated environment variables — no injection risk.
Conclusion
Clean, focused change. The implementation is correct and follows existing patterns. Approved.
背景
v2 方案(已经梦林和 IssueTriage 双方确认):在现有
octo-issue-feed.ymlreusable workflow 里,当新 issue 创建时,额外向 issue-feed 频道发一条 @mention IssueTriage bot 的触发消息。改动
文件:
.github/workflows/octo-issue-feed.yml改动量: Python 脚本 +9 行,YAML 结构不动
在
event_action == 'opened'时,追加第三条send()调用:不变
链路
测试建议
在任意仓库手动创建一个 test issue,确认 IssueTriage 在 issue-feed 收到
[TRIAGE]消息并自动打上标签。