11 Commits
Author SHA1 Message Date
Nicholas-Xiong 6194c7b1d9 fix: ai_review 对事件载荷读取/解析失败输出可定位警告(fixes #2070) (#2096)
* fix: surface event payload read/parse failures in ai_review (fixes #2070)

Issue #2070: .github/scripts/ai_review.py::_event_payload() previously
caught (OSError, ValueError) and silently returned {}, which collapsed
three distinct failure modes — missing event file, unreadable file, and
malformed JSON — into a single downstream symptom
('PR number is unavailable for GitHub API review'), making PR review
failures in workflow_dispatch / schedule runs impossible to triage.

Fix preserves the empty-payload degradation contract (so PR_NUMBER still
unblocks the chain when set explicitly), but splits the except clause
into three distinct branches that print a warning identifying the
failure mode by name (file-missing / OSError-derived / JSONDecodeError-
derived), the source path being GITHUB_EVENT_PATH, and the exception
class name. The warning never prints the payload content.

Tests in tests/test_ai_review_github_api.py add regression coverage for:
  - missing event file -> {} + 'GITHUB_EVENT_PATH 指向的文件不存在'
  - unreadable file (chmod 0o000) -> {} + '事件载荷读取失败' (skipped
    on root runners where chmod is a no-op, but never raises)
  - invalid JSON -> {} + '事件载荷 JSON 解析失败'
  - valid JSON happy path -> payload + no warning (guards against the
    warnings accidentally firing on success)
  - PR_NUMBER unset + bad event payload -> RuntimeError surfaces with
    the warning printed first so logs distinguish 'bad payload' vs
    'no PR number'

10 tests pass (5 new + 5 existing) in 0.09s.

* fix: 回应 codex P2 review 反馈 (PR #2096)

1. UnicodeDecodeError 显式分支: open(..., encoding='utf-8') 在非合法 UTF-8
   字节序列上抛 UnicodeDecodeError(是 ValueError 子类,旧 (OSError, ValueError)
   接住了它,但拆成 OSError + JSONDecodeError 后该异常不再被覆盖,会让 review
   终止而非降级). 新增 unicode 分支恢复降级行为,补 1 条独占回归测试.

2. CHANGELOG 收窄到本 PR 实际范围: 移除两条无关条目(parse_analysis_target 来自
   PR #2094,YfinanceFetcher 港股裸码路由来自 PR #2097),它们不应进入本 PR 的
   release notes.
2026-07-25 20:34:35 +08:00
zhulinsen 16e3421c1b fix: secure fork PR review workflow (#2057) 2026-07-21 22:24:19 +08:00
mumu b9f5989a21 fix(issue-1683): [bug]-发布说明生成在作者查询失败时缺少诊断日志 (#1684) 2026-06-14 17:55:52 +08:00
ZhuLinsen 02ca95efd1 ci: simplify release notes generation 2026-06-13 19:27:14 +08:00
mumu 595908c81a chore: reorganize root files (#1257)
* chore: reorganize root files

* fix: mark moved docs assets as binary
2026-05-10 19:50:22 +08:00
mumu 48163e8693 feat: inject CI check results into AI review prompt and clarify blocker criteria (#645)
- Pass auto-check job outputs (syntax_ok, has_py_changes, result) as env vars to ai_review.py
- Add _build_ci_context() to build CI status section injected into review prompt
- Update prompt: AI reviewer must reference CI status before judging validation sufficiency
- Clarify blocker vs suggestion: only correctness/security/CI failure/contradiction/missing rollback are blockers
- Update AGENTS.md: add CI coverage principle, blocking conditions, suggestion conditions
2026-03-14 00:03:47 +08:00
Alfred 537f23b578 docs: Refactor LLM config guide for better clarity and accessibility (#545) (#583) 2026-03-11 13:11:54 +08:00
mumu 498770616f feat(ci): harden smoke gates and automated release pipeline #minor (#336)
- add scripts/ci_gate.sh as unified backend gate entry

- restructure CI into backend-gate/docker-build/web-gate with frontend path detection

- add network-smoke non-blocking workflow for scheduled/manual network checks

- harden docker-publish with tag/manual release_tag flow, semver + changelog validation, and pre-publish docker smoke

- expand PR review and AI review coverage to code/docs/config/workflow changes

- align PR template and contributor docs with AGENTS.md review requirements

- add pytest markers and python-multipart dependency; restore test setup in get_latest_data tests
2026-02-15 23:05:56 +08:00
zhulinsen 01dd381241 fix: use GEMINI_MODEL_FALLBACK or default model for PR 2026-01-14 21:42:12 +08:00
zhulinsen 9fcb5a8df1 feat: 添加自动关闭过期内容和改进 AI 审查调试 2026-01-14 20:40:17 +08:00
zhulinsen 535d774f4b fix: 修复 pr-review.yml YAML 语法错误 2026-01-13 22:32:52 +08:00