feat: dogfood review action in repo workflow#11
Conversation
|
ProviderModelNotFoundError |
代码审查结果总体评价有条件合并 详细分析优点
需要关注的问题1. 潜在 bug:API Key 引用不一致 workflow 中同时传入了 zhipu-api-key: ${{ secrets.ZHIPU_API_KEY }}
opencode-go-api-key: ${{ secrets.OPENCODE_GO_API_KEY }}但 2. 模型选择风险 workflow 硬编码使用 建议:在文档或 workflow comment 中说明所需的模型访问要求。 3. Output 格式变更影响
这个格式变更如果下游有依赖旧格式的消费者,会造成兼容性问题。当前 PR 是自己消费自己,影响可控,但需要注意这一点。 小建议
结论代码质量良好,逻辑正确,但存在 API key 验证不完整的问题可能导致后续运行失败。建议修复后再合并。 |
TS (platform.ts): - Cache detectPlatform() result to avoid repeated env reads (#6) - getRepo() returns empty string + warn instead of throw (#5) - fetchAllGiteaComments() capped at MAX_PAGES=20 (#1) - getGiteaToken() checks both GITEA_TOKEN and GITHUB_RUN_OPENCODE_GITEA_TOKEN (#13) - Add /* ignore */ comments to empty catch blocks (#11) Python (run-github-opencode.py): - Use specific exception types: (TimeoutExpired, JSONDecodeError) not bare Exception (#2) - Add HTTP plaintext warning for GITEA_API_URL (#3) - Validate repo/pr format before URL construction (#4) - Add pagination for Gitea comment listing with max_pages=20 (#1) - Unify token lookup to GITEA_TOKEN only (#13)
* feat: add Gitea CI compatibility via platform abstraction layer - New platform.ts: auto-detect GitHub/Gitea via GITEA_API_URL env var - Unified interfaces for PR diff fetch, comment posting, error comment cleanup - Gitea: tea CLI (preferred) → curl REST API fallback - GitHub: unchanged, zero-impact on existing workflows - comment.ts refactored to thin proxy over platform.ts - index.ts: platform-aware diff fetch with pre-fetched file fallback - action.yml (multi-review, review): new gitea-token input - Python: detect_platform() + Gitea error comment cleanup Closes #55 * fix: address AI code review feedback - Remove dead httpRequest code and unused http/https imports (阻塞项 #1) - Reverse diff fetch priority: pre-fetched file first, platform fetch as fallback to avoid duplicate API calls on GitHub (阻塞项 #2) - Fix redundant Python exception catches (Exception covers subclasses) - Use get_env() in detect_platform() for consistency - Add HTTPS warning for GITEA_API_URL using plain HTTP - Validate GITHUB_REPOSITORY format before API calls - Lazy-cache hasTea() result to avoid repeated which calls - Add pagination support for Gitea comment cleanup - Revert tsup externals (https/http no longer imported) - Remove duplicate empty-diff check in index.ts * fix: address second round AI code review feedback TS (platform.ts): - Cache detectPlatform() result to avoid repeated env reads (#6) - getRepo() returns empty string + warn instead of throw (#5) - fetchAllGiteaComments() capped at MAX_PAGES=20 (#1) - getGiteaToken() checks both GITEA_TOKEN and GITHUB_RUN_OPENCODE_GITEA_TOKEN (#13) - Add /* ignore */ comments to empty catch blocks (#11) Python (run-github-opencode.py): - Use specific exception types: (TimeoutExpired, JSONDecodeError) not bare Exception (#2) - Add HTTP plaintext warning for GITEA_API_URL (#3) - Validate repo/pr format before URL construction (#4) - Add pagination for Gitea comment listing with max_pages=20 (#1) - Unify token lookup to GITEA_TOKEN only (#13) * fix: address third round review feedback - Restore error log in GitHub cleanup catch block (#1) - Add --repo to tea pulls diff call (#2) - Python Gitea token fallback: check both GITEA_TOKEN and GITHUB_RUN_OPENCODE_GITEA_TOKEN (#4)

Summary
pull_requestworkflow that uses the publishedSvtter/opencode-actions/review@v1action to review this repo's own PRsgithub-run-opencodeVerification
bash tests/test.sh