cfdaily
f74ae30d41
[moz] impl(§17): CI/部署失败 steps 分支指引 + 基础设施 Issue 转交流程
...
CI / lint (pull_request) Successful in 10s
CI / test (pull_request) Successful in 27s
CI / frontend (pull_request) Successful in 13s
CI / notify-on-failure (pull_request) Successful in 0s
改动 1: ci_failure steps 增加分支指引(代码问题自己修/基础设施问题提Issue给姜维)
改动 2: deploy_failure steps 同上分支指引(2处定义都改)
改动 3: issue_assigned handler 按 type/infrastructure label 分流
- infrastructure label → infrastructure_failure event_type(运维排查 steps)
- 其他 → 原有编码 steps
改动 4: ToolchainApiSection 新增「需要创建 Issue 时」API 指引段落
改动 5: Red Flags 新增「不是我代码的问题」条目
测试: 8 个新测试,463 passed
2026-06-19 13:18:11 +08:00
cfdaily
6e6b52fe3b
fix: asyncio.Lock 懒加载防 event loop 关闭后 import 失败
CI / lint (pull_request) Successful in 12s
CI / test (pull_request) Failing after 6s
CI / notify-on-failure (pull_request) Successful in 0s
2026-06-14 00:09:27 +08:00
cfdaily
3b9ad83405
fix(lint): F541 f-string 无占位符去掉 f 前缀
CI / lint (pull_request) Successful in 7s
CI / test (pull_request) Successful in 9s
CI / notify-on-failure (pull_request) Successful in 1s
2026-06-13 23:40:56 +08:00
cfdaily
c89863a288
feat: §17 ToolchainHandler 强约束实现(Step 1-4)
...
CI / lint (pull_request) Failing after 7s
CI / test (pull_request) Has been skipped
CI / notify-on-failure (pull_request) Successful in 1s
Step 1: 基础设施
- prompt_composer.py: PromptContext 新增 action_type + action_steps 字段
- spawner.py: handler 路径提取 action_type/action_steps 传入 PromptContext
- db.py: comments CHECK 约束加入 action_report
Step 2: ToolchainHandler 强化
- ToolchainContextSection: 加 steps 渲染 + action_hint(按 action_type)
- ToolchainApiSection: 改为 action_report 提交指引 + Gitea 协作指引
- ToolchainConstraintsSection: 5 条强约束 + Red Flags 防self-rationalization
- verify_completion: action_report → output → comment 三层 fallback
- review_merged 始终通过(纯通知)
- infrastructure_failure 始终通过(防递归)
- 修复 LENGTH(content) → LENGTH(body) bug
- on_failure 三分路: 业务→Gitea PR comment / 系统→Gitea Issue / 基础设施→toolchain task
Step 3: toolchain_routes 改造
- 新增 _toolchain_db_path() + _send_toolchain_task()
- 所有 8 个 handler 改为 _send_toolchain_task
- _send_mail 保留但不再被 toolchain handler 调用
- _send_deploy_failure_mail → _send_deploy_failure_task
Step 4: 测试
- 29 个单元测试全部通过
- 全量 456 passed, 3 skipped, 0 failures
2026-06-13 23:36:44 +08:00
cfdaily
fe7f914681
fix: _handle_pull_request 补充 synchronize action dispatch
...
CI / lint (pull_request) Successful in 7s
CI / test (pull_request) Successful in 8s
CI / notify-on-failure (pull_request) Successful in 0s
姜维排查发现 _handle_pull_request 只处理 opened/closed,
Gitea 发 pull_request + action=synchronize 时被静默丢弃。
_handle_pr_synchronize 已存在但未被 dispatch 到。
修复:加 elif action == synchronize dispatch。
pull_request_sync 注册保留作为双保险。
2026-06-13 14:42:38 +08:00
cfdaily
a8a1886f27
fix(toolchain): is_pr detection - check value not key existence
...
CI / lint (pull_request) Successful in 7s
CI / test (pull_request) Successful in 8s
CI / notify-on-failure (pull_request) Successful in 0s
Gitea Issue API returns pull_request: null for pure Issues (key exists but
value is None). 'pull_request' in issue was always True, causing all Issue
@mention mails to show 'PR #N' instead of 'Issue #N'.
Fix: issue.get('pull_request') is not None
2026-06-12 20:26:02 +08:00
cfdaily
e7f28cd36e
fix(mention): address PR #45 review feedback (M1-M3, S1-S3)
...
CI / lint (pull_request) Successful in 7s
CI / test (pull_request) Successful in 8s
CI / notify-on-failure (pull_request) Successful in 0s
M1: Remove '帮忙' from help_keywords to fix keyword priority bug
M3: Add unit tests for mention_utils (§25.7)
S1: Merge two 'if action == opened' blocks in _handle_issues
S2: Extract _send_review_mentions helper to deduplicate @mention code
S3: Remove redundant 'import re' inside conditional block
2026-06-12 18:56:54 +08:00
cfdaily
f25af64f00
feat(toolchain): §25 Gitea @mention end-to-end integration
...
New files:
- src/api/mention_utils.py: extract_mentions(), infer_intent(),
_build_response_guidance(), AGENT_ALIAS mapping
- templates/toolchain/mention.md: @mention notification template
with context API + response guidance by intent type
Modified:
- src/api/toolchain_routes.py: S1-S5 handler changes
- S1: Issue body @mention on opened
- S2+S4: _handle_issue_comment control flow refactored
(guard clause → positive if, CI + @mention independent paths)
- S3: PR body @mention on opened
- S5: Review body @mention on submitted
- New _send_mention_mails() with auto-flow suppression
- src/daemon/toolchain_templates.py: register mention template
Design: docs/design/25-gitea-mention-toolchain.md (v2.0)
Tests: 405 passed, 3 skipped
2026-06-12 18:56:54 +08:00
cfdaily
33c58a7dae
fix(auto-deploy): address PR #44 review feedback (M1, M2)
...
CI / lint (pull_request) Successful in 6s
CI / test (pull_request) Successful in 8s
CI / notify-on-failure (pull_request) Successful in 0s
M1: Replace nohup with asyncio.sleep - preserves subprocess output/error detection
M2: Use PM2_HOME env check + regex matching instead of fragile string match
S1: pm2_name now has clear purpose for M2's regex-based self-restart detection
405 passed, 3 skipped.
2026-06-12 15:07:43 +08:00
cfdaily
d82d29fd79
fix(auto-deploy): prevent self-kill when pm2 restart runs inside webhook handler
...
CI / lint (pull_request) Successful in 7s
CI / test (pull_request) Successful in 9s
CI / notify-on-failure (pull_request) Successful in 0s
post_deploy commands that restart the current process (pm2 restart {pm2_name})
now use nohup+sleep to defer execution, allowing the webhook handler to
return normally before the restart happens.
Fix by jiangwei-infra, synced from install dir.
2026-06-12 15:05:06 +08:00
cfdaily
73454c0787
refactor(auto-deploy): YAML config + post_deploy list + deploy failure mail
...
CI / lint (pull_request) Successful in 7s
CI / test (pull_request) Successful in 8s
CI / notify-on-failure (pull_request) Successful in 1s
- New config/deploy-targets.yaml: centralized deploy target config
- Rewrite auto-deploy in _handle_pr_closed to use YAML config
- Add _send_deploy_failure_mail helper (reuses deploy_failure template)
- Support post_deploy command list (not just pm2 restart)
- Docs-only changes skip post_deploy
- Add pyyaml to pyproject.toml dependencies
- Update design doc §23 with new architecture
2026-06-12 13:57:55 +08:00
cfdaily
b80290fe78
fix: address PR #43 review feedback (M1-M3, S1)
...
M1: git pull in dev dir + rsync to install dir (install dir has no .git)
M2: use asyncio.create_subprocess_exec instead of subprocess.run
M3: add repo whitelist (only sanguo/sanguo_moziplus_v2 triggers auto-deploy)
S1: notify jiangwei-infra on rsync/pm2 restart failure
2026-06-12 13:57:55 +08:00
cfdaily
9bb1e9dc64
feat(toolchain): auto-deploy on PR merge (git pull + pm2 restart) ( #43 )
...
- Add auto-deploy logic in _handle_pr_closed after mail notification
- git pull origin main in install dir on merge
- Smart restart: only restart pm2 when src/templates/frontend/*.py changed
- Pure docs changes: pull only, no restart
- Deploy failure logged but does not block mail notification
- Update design doc §23 with auto-deploy section
2026-06-12 13:57:55 +08:00
cfdaily
c6a0567161
fix(toolchain): 注册 pull_request_sync 和 pull_request_comment event type
...
CI / lint (pull_request) Successful in 8s
CI / test (pull_request) Successful in 9s
CI / notify-on-failure (pull_request) Successful in 0s
Gitea 对 PR branch push 发的是独立事件类型 pull_request_sync,
不是 pull_request + action=synchronize。
同时补注册 pull_request_comment(review comment)。
删除 _handle_pull_request 中永远不会触发的 synchronize 分支。
2026-06-12 10:11:49 +08:00
cfdaily
2c612baa04
fix(toolchain): synchronize fallback + merge 通知
2026-06-12 08:26:42 +08:00
cfdaily
a4bb752d71
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
- 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
2026-06-11 14:00:44 +08:00
cfdaily
d58e38d58f
fix(lint): 修复 PR #14 引入的 lint 回退 (119→0)
...
CI / lint (pull_request) Successful in 6s
CI / test (pull_request) Successful in 9s
CI / notify-on-failure (pull_request) Successful in 0s
PR #14 从旧分支复制文件导致回退了 PR #10 的 lint 修复。
修复内容:
- autoflake 移除未使用导入/变量
- autopep8 修复缩进/空格
- 手动修复 F821(pathlib→Path), F541(f-string), F841(未使用变量)
- 所有修复均通过 flake8 --max-line-length=120 --extend-ignore=E501 检查 (0 errors)
2026-06-09 23:53:29 +08:00
cfdaily
f7fbdac89c
chore: simayi-approved changes - lint fixes, toolchain improvements, healthz
...
All changes reviewed and APPROVED in PR #12 (Review ID: 40):
- toolchain_routes: webhook repo/org format compat, content dedup (sha256), closed issue filter
- dispatcher: inform mail crash 误标 done 修复
- ticker: cleanup and improvements
- healthz endpoint
- conftest: integration/e2e deselect markers
- docs: design docs, test-guide updates
- various lint/whitespace fixes across 30 files
2026-06-09 23:41:53 +08:00
cfdaily
242057dfd6
fix: remove dead code config.get experience
CI / lint (push) Successful in 6s
CI / test (push) Successful in 14s
CI / notify-on-failure (push) Successful in 1s
CI / lint (pull_request) Failing after 13m39s
CI / test (pull_request) Has been skipped
CI / notify-on-failure (pull_request) Failing after 14m58s
2026-06-09 22:23:58 +08:00
cfdaily
09a0928bbc
fix: resolve all flake8 lint errors (118 → 0)
CI / lint (push) Successful in 8s
CI / lint (pull_request) Successful in 5s
CI / test (push) Failing after 8s
CI / test (pull_request) Failing after 8s
CI / notify-on-failure (push) Successful in 1s
CI / notify-on-failure (pull_request) Successful in 3s
2026-06-09 16:43:41 +08:00
cfdaily
83fb270e2a
auto-sync: 2026-06-08 08:51:12
Deploy / ci (push) Waiting to run
Deploy / deploy (push) Blocked by required conditions
Deploy / notify-deploy-failure (push) Blocked by required conditions
2026-06-08 08:51:12 +08:00
cfdaily
900a38524f
auto-sync: 2026-06-08 08:03:50
Deploy / ci (push) Waiting to run
Deploy / deploy (push) Blocked by required conditions
Deploy / notify-deploy-failure (push) Blocked by required conditions
2026-06-08 08:03:50 +08:00
cfdaily
6dc029ad54
auto-sync: 2026-06-08 07:32:38
Deploy / ci (push) Waiting to run
Deploy / deploy (push) Blocked by required conditions
Deploy / notify-deploy-failure (push) Blocked by required conditions
2026-06-08 07:32:38 +08:00
cfdaily
67332422ec
auto-sync: 2026-06-08 07:06:44
Deploy / ci (push) Waiting to run
Deploy / deploy (push) Blocked by required conditions
Deploy / notify-deploy-failure (push) Blocked by required conditions
2026-06-08 07:06:44 +08:00
cfdaily
128874a143
auto-sync: 2026-06-08 00:20:31
Deploy / ci (push) Waiting to run
Deploy / deploy (push) Blocked by required conditions
Deploy / notify-deploy-failure (push) Blocked by required conditions
2026-06-08 00:20:31 +08:00
cfdaily
9398f6c6e3
auto-sync: 2026-06-07 22:17:49
Deploy / ci (push) Waiting to run
Deploy / deploy (push) Blocked by required conditions
Deploy / notify-deploy-failure (push) Blocked by required conditions
2026-06-07 22:17:49 +08:00
cfdaily
1bd228ea59
auto-sync: 2026-06-07 13:59:17
Deploy / ci (push) Waiting to run
Deploy / deploy (push) Blocked by required conditions
Deploy / notify-deploy-failure (push) Blocked by required conditions
2026-06-07 13:59:17 +08:00
cfdaily
97d2f58b53
auto-sync: 2026-06-07 13:50:55
Deploy / ci (push) Waiting to run
Deploy / deploy (push) Blocked by required conditions
Deploy / notify-deploy-failure (push) Blocked by required conditions
2026-06-07 13:50:55 +08:00
cfdaily
70f4e026f1
auto-sync: 2026-06-07 11:57:38
Deploy / ci (push) Waiting to run
Deploy / deploy (push) Blocked by required conditions
Deploy / notify-deploy-failure (push) Blocked by required conditions
2026-06-07 11:57:38 +08:00
cfdaily
9880091f52
auto-sync: 2026-06-07 11:56:54
Deploy / ci (push) Waiting to run
Deploy / deploy (push) Blocked by required conditions
Deploy / notify-deploy-failure (push) Blocked by required conditions
2026-06-07 11:56:54 +08:00