chore(ai-review): 三條 preflight 測試誤判寫入 exclusions 並清空 findings #13

Merged
jiantw83 merged 4 commits from feat/inline-critical-comments into develop 2026-06-16 08:20:04 +00:00
Member
No description provided.
jiantw83 added 3 commits 2026-06-16 08:18:24 +00:00
feat: 嚴重問題改用 Gitea 行內 review comment 標註檔案行數
AI / 計算版本號 (pull_request) Successful in 4s
AI / Code Review (pull_request) Successful in 1m35s
caebd2b112
每個新的嚴重問題改以行內 review comment 標註在問題所在的檔案與行數上,
留言內容為等級/審查員/建議;無法解析出行號(未標行號或一次列出多個
檔案),或行內留言失敗(該行不在 diff 範圍)時,降級為原本的一般 PR comment。

- gitea.js:新增 postPullReviewComment,呼叫 pull reviews API,以 new_position
  對應新版檔案行號、commit_id 帶 PR_HEAD_SHA
- comments.js:新增 parseLocation(支援 file:19 / file:70-82,取起始行)與
  行內留言內容組裝;postNewCriticalComments 先試行內、失敗降級,deps 可注入
- 補 11 個測試(API payload、parseLocation 各情境、行內成功與兩種降級路徑)
- README 更新流程第 7 步說明

app/ 測試 123 pass。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chore: update ai-review findings [ai-review-bot][success]
AI / 計算版本號 (pull_request) Successful in 2s
AI / Code Review (pull_request) Successful in 2s
8419e60848
chore(ai-review): 三條 preflight 測試誤判寫入 exclusions 並清空 findings
AI / 計算版本號 (pull_request) Successful in 4s
AI / Code Review (pull_request) Successful in 1m17s
f047b4473e
Owner

🤖 AI Code Review 團隊

👤 名稱 🎯 職責 🧠 個性
Leo 可維護性審查員 有遠見、重視長期維護成本,常常思考「六個月後的自己能看懂嗎?」
Zara 效能優化專家 追求極致效能,對任何不必要的資源消耗都感到不舒服,喜歡用數據說話
Rex 資安審查員 謹慎、多疑、對任何潛在風險都保持高度警覺,寧可誤報也不放過漏洞
Aria 程式碼風格審查員 嚴謹、注重細節、對程式碼整潔度有高度要求,說話直接但不失禮貌
Maya 測試品質審查員 對測試覆蓋率有執念,相信沒有測試的程式碼等於沒有完成,溫和但堅持

🔍 服務:gemini 模型:gemini-2.5-flash

## 🤖 AI Code Review 團隊 | 👤 名稱 | 🎯 職責 | 🧠 個性 | |--------|--------|--------| | **Leo** | 可維護性審查員 | 有遠見、重視長期維護成本,常常思考「六個月後的自己能看懂嗎?」 | | **Zara** | 效能優化專家 | 追求極致效能,對任何不必要的資源消耗都感到不舒服,喜歡用數據說話 | | **Rex** | 資安審查員 | 謹慎、多疑、對任何潛在風險都保持高度警覺,寧可誤報也不放過漏洞 | | **Aria** | 程式碼風格審查員 | 嚴謹、注重細節、對程式碼整潔度有高度要求,說話直接但不失禮貌 | | **Maya** | 測試品質審查員 | 對測試覆蓋率有執念,相信沒有測試的程式碼等於沒有完成,溫和但堅持 | > 🔍 服務:gemini 模型:gemini-2.5-flash
Owner

🔍 新發現問題(2 筆)

等級 審查員 位置 建議
🟡 警告 Maya app/comments.test.js:84 請為 postNewCriticalComments 函數新增一個測試案例,驗證當傳入空的 findings 陣列時,函數能正確執行且不發布任何 comment。這能確保邊界條件的處理是符合預期的。
🟡 警告 Maya app/comments.test.js:84 目前 postNewCriticalComments 的測試案例主要針對單一 critical finding。建議新增一個測試案例,包含多個 is_newlevel === 'critical' 的 findings,其中一些可以成功發布行內 comment,另一些則因 parseLocation 失敗或 postInline 拋出錯誤而降級為一般 comment。這能更全面地驗證迴圈邏輯和多個問題的處理。
## 🔍 新發現問題(2 筆) | 等級 | 審查員 | 位置 | 建議 | |------|--------|------|------| | 🟡 警告 | Maya | app/comments.test.js:84 | 請為 `postNewCriticalComments` 函數新增一個測試案例,驗證當傳入空的 `findings` 陣列時,函數能正確執行且不發布任何 comment。這能確保邊界條件的處理是符合預期的。 | | 🟡 警告 | Maya | app/comments.test.js:84 | 目前 `postNewCriticalComments` 的測試案例主要針對單一 critical finding。建議新增一個測試案例,包含多個 `is_new` 且 `level === 'critical'` 的 findings,其中一些可以成功發布行內 comment,另一些則因 `parseLocation` 失敗或 `postInline` 拋出錯誤而降級為一般 comment。這能更全面地驗證迴圈邏輯和多個問題的處理。 |
admin added 1 commit 2026-06-16 08:19:50 +00:00
chore: update ai-review findings [ai-review-bot][success]
AI / 計算版本號 (pull_request) Successful in 3s
AI / Code Review (pull_request) Successful in 4s
e03b1c7045
jiantw83 scheduled this pull request to auto merge when all checks succeed 2026-06-16 08:20:03 +00:00
jiantw83 merged commit 5ac73091cd into develop 2026-06-16 08:20:04 +00:00
jiantw83 deleted branch feat/inline-critical-comments 2026-06-16 08:20:04 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: actions/code-review#13