Commit Graph

2 Commits

Author SHA1 Message Date
Jeffery 40ebfe99a8 feat: 前置驗證納入 git push 認證檢查
AI / Code Review (pull_request) Failing after 2m48s
AI / 計算版本號 (pull_request) Successful in 2s
git push 走 askpass + HTTP 認證,與 Gitea REST API 是兩套機制,API token
有效不代表 push 能用(曾出現 askpass 無法執行、could not read Username 而
push 失敗)。新增 git.js verifyRemoteAccess() 以相同 askpass + remote URL
跑唯讀 git ls-remote,preflight 呼叫並在失敗時 exit 1,提前攔下設定問題。

新增 git.test.js 對 verifyRemoteAccess 的測試(成功、失敗不丟例外、token
不外洩、askpass 清理)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 13:39:04 +08:00
Jeffery 766f2ddf40 feat: 啟動時前置驗證所有驗證相關設定
AI / 計算版本號 (pull_request) Failing after 1s
AI / Code Review (pull_request) Has been skipped
新增 app/preflight.js,在 action 啟動(Step1 之後、其餘步驟之前)集中
檢查必要環境變數、GITEA_TOKEN 讀 repo、GITEA_COMMENT_TOKEN、以及 LLM
provider/API Key(多把只要一把通過即可,Ollama 改檢查 base URL 連線)。
任一項失敗即印出原因並 exit 1,避免分析到一半或發 comment 時才失敗。

main.js 在 Step1 後呼叫 runPreflight();新增 preflight.test.js 覆蓋
成功、缺環境變數、token 無效、所有 LLM key 失敗、Ollama 等情境。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 10:41:40 +08:00