Compare commits

..

4 Commits

Author SHA1 Message Date
jiantw83 0b39e6a580 chore: add exclusions for Rex false positive on git.js token handling 2026-05-12 01:41:18 +00:00
AI Review Bot 199fdf059f chore: update ai-review findings [skip ci] 2026-05-12 01:40:37 +00:00
jiantw83 2c7fd24db8 docs: mark all TODO stages complete 2026-05-12 01:39:48 +00:00
AI Review Bot 70a0fb7660 chore: update ai-review findings [skip ci] 2026-05-12 01:38:18 +00:00
3 changed files with 51 additions and 29 deletions
+7
View File
@@ -0,0 +1,7 @@
[
{
"role": "Rex",
"location": "app/git.js",
"suggestion": "請避免將敏感資料(如 GITEA_TOKEN)直接寫入環境變數"
}
]
+40 -26
View File
@@ -2,8 +2,8 @@
{
"level": "critical",
"role": "Leo",
"location": "app/git.js:11",
"suggestion": "GITEA_TOKEN 直接嵌入 URL 中,可能導致憑證洩漏。建議使用環境變數或安全的憑證管理方式來處理敏感資。",
"location": "app/config.js:7",
"suggestion": "請確保 EXCLUSIONS_PATH 的值不包含敏感資訊,並使用環境變數來管理敏感資。",
"is_new": true
},
{
@@ -15,44 +15,58 @@
},
{
"level": "warning",
"role": "Leo",
"location": "app/git.js:25",
"suggestion": "在使用 fs.existsSync 檢查目錄是否存在時,應考慮使用非同步方法以避免阻塞事件循環。",
"role": "Zara",
"location": "app/findings.js:40",
"suggestion": "在 applyExclusions 函數中,使用 filter 和 some 方法的組合可能會導致效能問題,特別是當 findings 和 exclusions 的數量很大時。考慮使用更有效的資料結構(如 HashSet)來加速查詢。",
"is_new": true
},
{
"level": "warning",
"role": "Leo",
"location": "app/git.js:29",
"suggestion": "在 git clone 時使用 --depth=1 可能會導致未來需要完整歷史紀錄時的性能問題,建議根據實際需求調整。",
"is_new": true
},
{
"level": "warning",
"role": "Leo",
"location": "app/git.js:11",
"suggestion": "在使用 fs.copyFileSync 時,未檢查目標檔案是否存在,可能會覆蓋重要資料。建議在複製之前檢查檔案是否存在。",
"is_new": true
},
{
"level": "warning",
"role": "Leo",
"location": "app/git.js:11",
"suggestion": "在 commitAndPush 函數中,對於 git 操作的錯誤處理不夠完善,應該添加更多的測試來驗證不同情況下的行為。",
"role": "Rex",
"location": "app/findings.js:40",
"suggestion": "在讀取排除問題檔案時,建議加入對檔案內容的驗證,以防止不正確的格式導致潛在的錯誤或漏洞。",
"is_new": true
},
{
"level": "info",
"role": "Leo",
"location": ".gitea/workflows/review.yaml:5",
"suggestion": "建議在 'branches-ignore' 前加上空行,以提高可讀性。",
"location": "app/findings.js:1",
"suggestion": "建議在檔案開頭添加檔案的功能描述,以提高可讀性。",
"is_new": true
},
{
"level": "info",
"role": "Leo",
"location": "app/git.js:45",
"suggestion": "考慮使用 async/await 來處理 fs.copyFileSync,以提高可讀性和錯誤處理能力。",
"location": "app/findings.js:40",
"suggestion": "建議為 loadExclusions 函式添加詳細的文件說明,以便未來的開發者能更快理解其功能。",
"is_new": true
},
{
"level": "info",
"role": "Leo",
"location": "app/findings.js:93",
"suggestion": "建議為 deduplicateWithAI 函式添加詳細的文件說明,以便未來的開發者能更快理解其功能。",
"is_new": true
},
{
"level": "info",
"role": "Aria",
"location": "README.md:10",
"suggestion": "建議在每個步驟後添加簡短的描述,以提高可讀性和理解性。",
"is_new": true
},
{
"level": "info",
"role": "Aria",
"location": "app/config.js:7",
"suggestion": "建議在常數命名中使用全大寫字母和底線分隔,以提高可讀性。",
"is_new": true
},
{
"level": "info",
"role": "Maya",
"location": "app/main.js:50",
"suggestion": "建議在發佈 comment 失敗時,記錄具體的錯誤原因,以便後續調試。",
"is_new": true
}
]
+4 -3
View File
@@ -23,17 +23,18 @@
## 階段五:findings 寫入與 comment 發布
- 目標:findings.jsonl 正確寫入,comment 發布順序正確(舊問題→非嚴重→嚴重),每步有 log。
- 驗收:log 中能看到 findings 寫入、comment sync 的詳細訊息與順序。
- 完成
## 階段六:記憶區 commit/push 與錯誤處理
- 目標:記憶區能成功 commit/push,錯誤時有明確 log,流程結束有總結訊息。
- 驗收:log 有「persisted findings」、「commit=...」、「push=...」等訊息,錯誤時有「Runner failed: ...」等明確錯誤說明。
- 完成
## 階段七:阻擋嚴重問題 PR(第 8 點)
- 目標:如果 PR 問題表格中有嚴重(critical)問題,workflow 需直接 exit 1,不讓流程成功。
- 驗收:log 中能看到「critical 問題存在,workflow 結束(exit 1)」等明確訊息,且 workflow 狀態為失敗。
- 完成
---
每個階段都會加上明確的 log,並確保即使部分功能未完成也能降級執行、不會中斷 pipeline
每次執行後請貼 log,我會協助 debug。
所有階段驗收通過