Jeffery and Claude Opus 4.8
9e88f5a9d5
fix(release-cleanup): 清理改用重試+有上限併發+best-effort 續行
...
cleanupReleases/cleanupOrphanTags 改用 delete-utils:暫時性錯誤(429/5xx、
網路例外)重試、永久性錯誤(401/403/404)即止、單筆失敗只記錄不中斷並彙報失敗數,
並以有上限併發加速。解決 AI review 的重試/錯誤分流/併發/部分失敗續行系列建議。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 15:28:40 +08:00
Jeffery and Claude Opus 4.8
7d34ceb439
feat(delete-utils): 新增刪除重試、併發與 best-effort 共用工具
...
新增 deleteWithRetry(暫時性錯誤指數退避重試、永久性錯誤即止)、
runWithConcurrency(有上限併發)與 isRetryableStatus,供清理流程強化錯誤處理。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 15:28:40 +08:00
Jeffery and Claude Opus 4.8
1f8f1a6939
chore(ai-review): 更新 findings.json
...
CI / AI Code Review (pull_request) Failing after 51m54s
移除本輪已修復(pathToFileURL、網路錯誤/空陣列測試)與已具防護的 finding
(id 已驗證正整數);保留 6 條錯誤處理/併發/TOCTOU 設計取捨。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 14:14:18 +08:00
Jeffery and Claude Opus 4.8
1f615fee90
test(release-cleanup): 補上一般網路錯誤與空陣列邊界測試
...
新增 fetchAllPages 在 fetch 拋一般網路錯誤時向外拋出的測試,以及
selectReleasesToDelete 對空陣列回傳空陣列的測試。測試共 67 項全數通過。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 14:14:18 +08:00
Jeffery and Claude Opus 4.8
f1fce4b6e4
fix(release-cleanup): 以 pathToFileURL 判斷直接執行入口
...
改用 node:url 的 pathToFileURL(process.argv[1]).href 比對,正確處理含空白/
特殊字元路徑與跨平台差異,取代脆弱的手動 file:// 字串拼接。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 14:14:18 +08:00
AI Review Bot
cafb33d725
chore: update ai-review findings [ai-review-bot][failure]
2026-06-26 06:10:30 +00:00
Jeffery and Claude Opus 4.8
7d41ca50b4
chore(ai-review): 更新 findings.json
...
CI / AI Code Review (pull_request) Failing after 48s
移除已修復(categorizeTags 型別防禦)的 finding;保留 6 條錯誤處理/併發/TOCTOU 設計取捨。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 14:09:40 +08:00
Jeffery and Claude Opus 4.8
3abe884c0f
docs(release-cleanup): 更新 README cleanupOrphanTags 連結行號與更新時間
...
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 14:09:40 +08:00
Jeffery and Claude Opus 4.8
50b626cf87
test(tags): 驗證 categorizeTags 對 null/非字串 name 不拋例外
...
新增測試:含 null、name 為數字、缺 name 的項目皆歸為 skip,正常 name 維持 keep。測試共 65 項全數通過。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 14:09:40 +08:00
Jeffery and Claude Opus 4.8
8b92e9739c
fix(tags): categorizeTags 防禦 null/非字串 name 項目
...
對 null/非物件 tag 與非字串 name 一律歸為 skip,避免存取 tag.name 或比對時出錯。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 14:09:40 +08:00
AI Review Bot
0e16c89367
chore: update ai-review findings [ai-review-bot][failure]
2026-06-26 06:06:16 +00:00
Jeffery and Claude Opus 4.8
8606fd94c3
chore(ai-review): 更新 findings.json
...
CI / AI Code Review (pull_request) Failing after 25s
移除已具測試覆蓋的 config 驗證 finding;保留 6 條錯誤處理/併發/TOCTOU 設計取捨,
其中 TOCTOU 已補上程式碼註解文件化。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 14:05:09 +08:00
Jeffery and Claude Opus 4.8
3586ab3803
docs(release-cleanup): 於 cleanupOrphanTags 註記 TOCTOU 殘餘競態
...
明確文件化 release 與 tag 兩次獨立 API 呼叫間的時序競態(已知限制),
說明現行緩解與為何屬排程任務可接受範圍。僅註解變更。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 14:05:09 +08:00
AI Review Bot
e6bd11a019
chore: update ai-review findings [ai-review-bot][failure]
2026-06-26 06:00:47 +00:00
Jeffery and Claude Opus 4.8
9e598143bf
chore(ai-review): 更新 findings.json 與 exclusions.json
...
CI / AI Code Review (pull_request) Failing after 55s
移除本輪已修復(防禦異常結構)與重複提報的 finding;保留 4 條錯誤處理類設計取捨;
將 config.js replace 型別 finding 登記為不成立(已有 typeof 防護)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 13:59:49 +08:00
Jeffery and Claude Opus 4.8
9a71e2d09d
test(release-cleanup): 補上異常結構 release 與 fetchAllPages 失敗測試
...
新增 cleanupReleases 處理 null/缺欄位 release 不拋例外的測試,以及
cleanupOrphanTags 在 fetchAllPages 拋錯時向外拋出的測試。測試共 64 項全數通過。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 13:59:49 +08:00
Jeffery and Claude Opus 4.8
24bcad7141
fix(release-cleanup): cleanupReleases 防禦 null/異常結構的 release 項目
...
在刪除迴圈中先檢查項目為非 null 物件,避免對非預期結構解構時拋出未捕捉例外。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 13:59:49 +08:00
AI Review Bot
1bc6ce6d8c
chore: update ai-review findings [ai-review-bot][failure]
2026-06-26 05:56:45 +00:00
Jeffery and Claude Opus 4.8
7b742ed85e
chore(ai-review): 更新 findings.json 與 exclusions.json
...
CI / AI Code Review (pull_request) Failing after 50s
移除本輪已修復(server URL 正規化、id 整數驗證、整合測試)與重複提報的 finding;
保留 7 條設計取捨(重試/錯誤處理/DoS/TOCTOU/deleteResource 策略);
新增 3 條不適用至 exclusions(baseUrl 由已驗證 config 組成、tag 白名單非必要、
categorizeTags 拆分無益)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 13:55:48 +08:00
Jeffery and Claude Opus 4.8
edc933be73
test(release-cleanup): 補上整合測試、server URL 正規化與 id 驗證測試
...
新增端對端整合測試(列出→刪除舊 release→重列→列 tag→刪孤立 tag 的呼叫順序)、
loadConfig 去尾斜線測試,並將 id 編碼測試改為驗證非整數 id 被略過。測試共 62 項全數通過。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 13:55:48 +08:00
Jeffery and Claude Opus 4.8
353a6af7c3
fix(release-cleanup): 去除 server URL 結尾斜線並驗證 release id 為正整數
...
- loadConfig 去除 GITEA_SERVER_URL 結尾的 /,避免拼出 //api/v1 錯誤路徑
- cleanupReleases 要求 id 為正整數,非整數一律略過(縱深防禦,不僅依賴編碼)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 13:55:48 +08:00
AI Review Bot
888edfea27
chore: update ai-review findings [ai-review-bot][failure]
2026-06-26 03:44:06 +00:00
Jeffery and Claude Opus 4.8
b461f72d43
chore(ai-review): 更新 findings.json 與 exclusions.json
...
CI / AI Code Review (pull_request) Failing after 43s
移除已修復(決定性排序)與多項重複提報的 finding;保留 7 條設計取捨;
新增 6 條不適用/誤報至 exclusions(內部 IP 黑名單會破壞自架 Gitea、
section 排版主觀、無效日期已註記、CI 堆疊輸出無妨、MAX_PAGES 為安全上限、
通用 log 抽象效益低)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:43:16 +08:00
Jeffery and Claude Opus 4.8
de094c542f
docs(release-cleanup): 更新 README cleanupReleases 連結行號與更新時間
...
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:43:16 +08:00
Jeffery and Claude Opus 4.8
858e628db6
test(release-cleanup): 驗證相同 created_at 時的決定性排序
...
新增測試:多筆 created_at 相同時,以 id 大小決定保留/刪除順序。測試共 60 項全數通過。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:43:16 +08:00
Jeffery and Claude Opus 4.8
9e33cb8ba8
fix(release-cleanup): selectReleasesToDelete 在時間相同時以 id 決定順序
...
排序加入次要鍵(id 數值,大者視為新),避免多筆 created_at 相同時保留/
刪除的選擇因引擎排序穩定性而不確定。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:43:16 +08:00
AI Review Bot
e0ab6f2693
chore: update ai-review findings [ai-review-bot][failure]
2026-06-26 03:34:26 +00:00
Jeffery and Claude Opus 4.8
b57180153e
chore(ai-review): 更新 findings.json 與 exclusions.json
...
CI / AI Code Review (pull_request) Failing after 32s
移除本輪已具測試覆蓋的 finding(MAX_PAGES 邊界、刪除失敗記錄)與多項
先前已修復卻被重複提報者;保留 6 條設計取捨類待人工評估;新增 2 條不適用
(_getHeaders 過度設計、排序中間陣列與前次優化衝突)至 exclusions。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:33:45 +08:00
Jeffery and Claude Opus 4.8
fd2dfa8732
test(release-cleanup): 補上 MAX_PAGES 邊界與刪除失敗記錄測試
...
新增 fetchAllPages 於第 MAX_PAGES 頁回空陣列時正常結束的測試,以及
cleanupReleases/cleanupOrphanTags 在 deleteResource 回非 204 時繼續處理
並寫入 stderr 錯誤記錄的測試。測試共 59 項全數通過。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:33:45 +08:00
AI Review Bot
76bccfeea9
chore: update ai-review findings [ai-review-bot][failure]
2026-06-26 03:30:27 +00:00
Jeffery and Claude Opus 4.8
1cc217f04e
chore(ai-review): 更新 findings.json 與 exclusions.json
...
CI / AI Code Review (pull_request) Failing after 50s
移除本輪已修復(Date.parse 預算、結束碼/sanitizeBody/logger 測試)的 finding;
保留 7 條設計取捨類(重試/錯誤閾值/SRP/並行化/回應大小 DoS 防護);
將 6 條不適用或誤報(Node<16、push.apply、'null' 字串、已用 Set、env 可注入、
Set 轉換)登記至 exclusions。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:29:30 +08:00
Jeffery and Claude Opus 4.8
941d3c0a8c
docs(release-cleanup): 更新 README cleanupReleases 連結行號與更新時間
...
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:29:30 +08:00
Jeffery and Claude Opus 4.8
826b559006
test(release-cleanup): 補上結束碼、sanitizeBody 與 logger 輸出測試
...
新增子行程驗證 index.js 失敗時以非零狀態結束、fetchAllPages 錯誤訊息
清理控制字元與長度限制、以及 logger 各輸出函式格式與 stdout/stderr 分流測試。
測試共 56 項全數通過。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:29:30 +08:00
Jeffery and Claude Opus 4.8
87db9030d6
perf(release-cleanup): selectReleasesToDelete 預先計算時間戳
...
排序前先一次性計算各 release 的 created_at 時間戳,避免在排序比較器中
重複呼叫 Date.parse;排序結果與原行為等價。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:29:30 +08:00
AI Review Bot
c0285794ae
chore: update ai-review findings [ai-review-bot][failure]
2026-06-26 03:22:50 +00:00
Jeffery and Claude Opus 4.8
c11440e139
chore(ai-review): 更新 findings.json 與 exclusions.json
...
CI / AI Code Review (pull_request) Failing after 46s
移除本輪已修復(MAX_PAGES、URL 編碼)與已具測試/已收斂的 finding;
保留 5 條設計取捨類(重試/錯誤閾值/SRP/並行化)待人工評估;
將 logger 分隔線常數建議登記為不適用於 exclusions。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:21:56 +08:00
Jeffery and Claude Opus 4.8
322e42087d
docs(release-cleanup): 更新 README gitea-client 連結行號與更新時間
...
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:21:56 +08:00
Jeffery and Claude Opus 4.8
0ba93a40a9
test(release-cleanup): 補上 MAX_PAGES 與刪除 URL 編碼測試
...
新增 fetchAllPages 超過 MAX_PAGES 中止的測試,以及 cleanupReleases/
cleanupOrphanTags 對含 ../ 的 id/tag 名稱編碼的測試。測試共 50 項全數通過。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:21:56 +08:00
Jeffery and Claude Opus 4.8
aa4f6364e2
fix(release-cleanup): 加入分頁上限並編碼刪除 URL 路徑片段
...
- fetchAllPages 加入 MAX_PAGES(1000)安全斷點,避免 API 異常時無限迴圈
- 刪除 release/tag 時對 id 與 tag 名稱做 encodeURIComponent,
防止特殊字元造成路徑穿越(正常數值/版本字串編碼後不變)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:21:56 +08:00
AI Review Bot
49ac5d4ec4
chore: update ai-review findings [ai-review-bot][failure]
2026-06-26 03:05:47 +00:00
Jeffery and Claude Opus 4.8
8dae4aceaf
chore(ai-review): 更新 findings.json
...
CI / AI Code Review (pull_request) Failing after 1m10s
移除本輪已修復(JSON/陣列處理、sanitize、failError 收斂、常數抽出)與
已存在測試覆蓋的 finding;保留 7 條設計取捨類(重試/TOCTOU/並行化/SRP)待人工評估。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:04:29 +08:00
Jeffery and Claude Opus 4.8
2b27da82c0
docs(release-cleanup): README 新增 failError 並更新行號
...
新增 failError 功能列表/使用範例,更新 validate/gitea-client 連結行號與更新時間。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:04:29 +08:00
Jeffery and Claude Opus 4.8
b9d7c4e970
test(release-cleanup): 補強逾時、非陣列、token 邊界與 failError 測試
...
新增 fetchAllPages 的 AbortError 逾時與非陣列回應測試、loadConfig 的
GITEA_TOKEN 邊界測試,以及 logger.failError 測試。測試共 47 項全數通過。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:04:29 +08:00
Jeffery and Claude Opus 4.8
f6d2ebeab2
refactor(release-cleanup): 收斂錯誤輸出並抽出驗證規則常數
...
- 新增 logger.failError 集中處理 Error/非 Error 的 stderr 輸出與堆疊,
index.js 改用之,移除重複的 reportFatal
- validate.js 將允許協定與 repository 格式抽為模組常數,便於維護擴充
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:04:29 +08:00
Jeffery and Claude Opus 4.8
0f4354bd01
fix(gitea-client): 強化分頁回應的 JSON 與錯誤內容處理
...
- res.json() 以 try-catch 包裹,解析失敗時補上 URL 上下文
- res.ok 為真時嚴格要求陣列,非陣列回應改為拋錯而非靜默結束
- 改用迴圈逐一 push 取代展開運算子,避免大量項目的堆疊風險
- 錯誤訊息中的回應內容經 sanitize(移除控制字元)防止 log 注入
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 11:04:29 +08:00
AI Review Bot
1623408d02
chore: update ai-review findings [ai-review-bot][failure]
2026-06-26 02:56:30 +00:00
Jeffery and Claude Opus 4.8
245f66de8f
chore(ai-review): 更新 findings.json 與 exclusions.json
...
CI / AI Code Review (pull_request) Failing after 36s
移除已修復的 13 條 finding;保留 4 條設計取捨類(重試/TOCTOU/並行化)
待人工評估;將 token log 排版建議登記為誤報於 exclusions.json。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 10:55:45 +08:00
Jeffery and Claude Opus 4.8
a95945262d
docs(release-cleanup): 更新 README 功能列表與 Dockerfile 註解排版
...
README 新增 requireUrl/requireRepository、修正原始碼連結行號與更新時間;
Dockerfile 調整註解冒號/括號前的空白(無邏輯變更)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 10:55:45 +08:00
Jeffery and Claude Opus 4.8
7c225d4122
test(release-cleanup): 補齊 cleanup/config/main 與新驗證函式測試
...
新增 cleanupReleases、cleanupOrphanTags 的失敗路徑與分類測試、
loadConfig 環境變數驗證測試、main 整合測試,以及 requireUrl/
requireRepository 與 content-type 檢查測試。測試共 41 項全數通過。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 10:55:45 +08:00
Jeffery and Claude Opus 4.8
154ab032bf
fix(release-cleanup): 強化輸入驗證、請求逾時與錯誤處理
...
解決 AI review 的安全性與健壯性問題:
- 驗證 GITEA_SERVER_URL 為合法 http/https URL(降低 SSRF 風險)
- 驗證 GITEA_REPOSITORY 為 owner/repo 形式並拒絕路徑穿越
- 為所有 fetch 請求加上 30 秒逾時(AbortSignal.timeout),避免卡死
- fetchAllPages 解析前檢查 content-type,非 JSON 時拋出明確錯誤
- selectReleasesToDelete 對無效 created_at 防呆,避免 NaN 排序
- index.js 匯出 main 並加上直接執行守衛,錯誤輸出含類型與堆疊
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 10:55:45 +08:00