feat: 支持 ntfy 一等通知渠道(P6-A) - #1271
Conversation
🤖 自动审查报告
📁 修改的文件
... 还有 10 个文件 🧠 AI 代码审查意见结论Ready to Merge 审查结果必要性通过 关联性通过 类型判定通过 描述完整性完整 风险级别低
综上,风险评估全面,且已通过设计和文档说明进行规避或提醒。 必改项无。 建议项无。 总评:
|
ZhuLinsen
left a comment
There was a problem hiding this comment.
评审结论
- 必要性:通过。Issue #1200 的 P6-A 明确要求补齐 ntfy 一等通知渠道,本 PR 覆盖发送、诊断、Web 测试、路由、Actions 和文档,动机成立。
- 是否有对应 issue:有,Refs #1200。
- PR 类型:feat/docs/test。新增运行时通知渠道,同时补充配置文档、CHANGELOG 和对应后端/API/Web/workflow 测试。
- description 完整性:完整。已包含背景、范围、兼容性与风险、验证命令与结果、外部 ntfy JSON publish 依据、README 不更新理由、回滚方案和 EXTRACT_PROMPT 说明,符合 AGENTS.md 对用户可见变更的交付要求。
- 是否可直接合入:可。当前 CI 全部成功,文档与
.env.example/docs/CHANGELOG.md已同步,未发现当前 diff 新引入的阻断性正确性或兼容性问题;mergeable_state=blocked不单独构成阻断。
🤖 此回复由 OpenReview Bot 自动生成,仅供参考。如有疑问请 @维护者。
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 789d040864
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
已处理这轮 OpenReview 反馈:
本地验证:
提交: |
ZhuLinsen
left a comment
There was a problem hiding this comment.
评审结论
- 必要性:通过。Issue #1200 P6-A 明确要求补齐 ntfy 一等通知渠道,本 PR 覆盖发送、诊断、Web 测试、路由、Actions 与文档,范围匹配。
- 是否有对应 issue:有,Refs #1200。
- PR 类型:feat。新增运行时通知渠道能力,附带必要的 docs/test 更新。
- description 完整性:完整。缺失项:无;已包含背景、范围、验证命令与结果、兼容性风险、官方 ntfy API 依据、README 不更新理由、回滚方案和 EXTRACT_PROMPT 说明。
- 是否可直接合入:可。当前阻断型 CI 已通过;
mergeable_state=blocked结合仓库保护策略本身不构成代码阻断,未发现必须修改项。
🤖 此回复由 OpenReview Bot 自动生成,仅供参考。如有疑问请 @维护者。
* feat: add ntfy notification channel * test: add ntfy smoke evidence images * fix: validate ntfy endpoint in structured config * fix: align ntfy endpoint validation
* feat: add ntfy notification channel * test: add ntfy smoke evidence images * fix: validate ntfy endpoint in structured config * fix: align ntfy endpoint validation
* feat: add ntfy notification channel * test: add ntfy smoke evidence images * fix: validate ntfy endpoint in structured config * fix: align ntfy endpoint validation
* feat: add ntfy notification channel * test: add ntfy smoke evidence images * fix: validate ntfy endpoint in structured config * fix: align ntfy endpoint validation
PR Type
Background And Problem
Issue #1200 的 P6-A 需要补齐长尾通知渠道中的
ntfy一等渠道支持。当前项目已有多渠道通知、配置诊断、Web 配置测试和 GitHub Actions 通知环境映射,但ntfy还不能作为正式渠道参与普通发送、聚合日报发送、路由校验、配置诊断和 Web 测试。本 PR 只实现
ntfy,不混入 Gotify / WebPush / Apprise / Bark 等后续渠道。NTFY_URL按现有ASTRBOT_URL风格定义为完整 topic endpoint,例如https://ntfy.sh/my-topic或https://self-hosted:port/my-topic;发送时解析 server root 和 topic,并使用 ntfy JSON publish API,避免中文标题依赖 HTTP header 编码。Scope Of Change
src/notification_sender/ntfy_sender.py,实现 ntfy JSON publish 发送、topic endpoint 解析、Bearer token、SSL verify 复用和错误处理。NotificationChannel.NTFY到普通通知发送、聚合日报_send_notifications()、配置检测、路由白名单、诊断和系统配置服务。ntfy,并对NTFY_URLtopic path 做校验与脱敏展示。NTFY_URL/NTFY_TOKEN,并补齐静态测试。.env.example、docs/notifications.md、docs/full-guide.md、docs/full-guide_EN.md、docs/CHANGELOG.md;未更新 README,细节保留在专题文档。Issue Link
Refs #1200
Verification Commands And Results
结果:通过。
结果:
248 passed, 43 subtests passed in 8.23s。结果:
277 passed, 35 warnings, 43 subtests passed。结果:
3 passed。结果:通过。
结果:通过;保留既有 Vite chunk size warning。
结果:通过。
PATH=.venv/bin:$PATH ./scripts/ci_gate.sh结果:
1898 passed, 2 deselected, 42 warnings, 166 subtests passed in 45.97s,backend-gate: all checks passed。真实 ntfy smoke 验证
https://ntfy.sh,topic 为dsa,ntfy 返回 message event:NtfySender发送,命令返回True,手机 ntfy app 收到DSA ntfy sender smoke / hello from DSA sender:Compatibility And Risk
NTFY_URL必须包含 topic path;仅配置 server root(如https://ntfy.sh)会被诊断/配置测试判定为无效,避免误发送到空 topic。WEBHOOK_VERIFY_SSL现在同时影响 custom webhook、AstrBot 和 ntfy,已在.env.example和通知文档中说明。MARKDOWN_TO_IMAGE_CHANNELS对既有渠道保持原语义,仅显式排除ntfy,因为本实现只支持文本/JSON publish,不走图片发送路径。NTFY_TOKEN。Rollback Plan
如需回滚,直接 revert this PR 即可;未引入数据迁移,也不会改写已有
.env。若用户已新增NTFY_URL/NTFY_TOKEN,回滚后这些配置会被旧版本忽略,可手动从环境变量或 GitHub Actions secrets 中移除。EXTRACT_PROMPT Change (if applicable)
未修改
src/services/image_stock_extractor.py中的EXTRACT_PROMPT。展开 / Expand: Full EXTRACT_PROMPT
Checklist
docs/CHANGELOG.md;README.md仅在首页级信息变化时更新,细节优先写入docs/*.md/ If user-visible changes are included, relevant docs anddocs/CHANGELOG.mdare updated;README.mdis updated only for homepage-level changes, with details kept indocs/*.md