Commit Graph
38 Commits
Author SHA1 Message Date
JefferyandClaude Opus 4.8 a18802d465 test(calculate-version): 補回應片段截斷行為測試
新增超長無法解析回應的測試,斷言錯誤訊息中的片段截斷至 200 字元內。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:14:30 +08:00
JefferyandClaude Opus 4.8 4aa1393af2 refactor(calculate-version): 強化片段截斷記憶體安全與抽出區段驗證
- releases 在 Array.from 前先以長度上限截斷字串,避免將可能極大的回應整個陣列化
- config 將 repository 區段驗證抽為具名函式 isValidRepoSegment 提升可讀性

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:14:30 +08:00
AI Review Bot 876a7fb659 chore: update ai-review findings [ai-review-bot][failure] 2026-06-26 06:12:19 +00:00
JefferyandClaude Opus 4.8 fcb1dc4525 chore(ai-review 狀態): 更新 findings.json 與 exclusions.json
CI / AI Code Review (pull_request) Failing after 39s
已解決 5 條(critical x1、warning x2、info x2:抽常數、提升 regex、補邊界測試),5 條判定為誤報寫入 exclusions(過度收緊 regex、迴圈測試已帶訊息、總長度冗餘、片段建議互相衝突、mock 過早抽離),findings 清空。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:11:36 +08:00
JefferyandClaude Opus 4.8 5e8d58b5f9 test(calculate-version): 補 GITEA_REPOSITORY 非法字元與超長段測試
新增含空白/星號/冒號等非法字元,以及單段超過長度上限的拒絕測試。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:11:36 +08:00
JefferyandClaude Opus 4.8 d8a86e90ea refactor(calculate-version): 將驗證常數抽離為具名常數
- config 將每段長度上限與允許字元抽為 MAX_REPO_NAME_LENGTH / REPO_SEGMENT_PATTERN(regex 提升至模組層級,避免每次重編譯)
- releases 將片段截斷長度抽為 API_ERROR_SNIPPET_LENGTH

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:11:36 +08:00
AI Review Bot 8ee3638be5 chore: update ai-review findings [ai-review-bot][failure] 2026-06-26 06:08:59 +00:00
JefferyandClaude Opus 4.8 14c7ac4ed0 chore(ai-review 狀態): 更新 findings.json 與 exclusions.json
CI / AI Code Review (pull_request) Failing after 24s
已解決 5 條(critical x1、warning x2、info x2:多位元組截斷、repository 驗證與命名、邊界測試、串流攔截 DRY),1 條判定為誤報寫入 exclusions(warning:logger 改 DI 屬過度設計),findings 清空。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:05:08 +08:00
JefferyandClaude Opus 4.8 1e227328f2 test(calculate-version): 補 repository 邊界測試並合併串流攔截輔助
- 補上 GITEA_REPOSITORY 空段/缺斜線/多段等邊界格式的拋錯測試
- 將 logger 測試的 captureStdout/captureStderr 合併為單一 captureStream

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:05:08 +08:00
JefferyandClaude Opus 4.8 da83f4fc30 fix(calculate-version): 強化片段截斷與 repository 驗證健全性
- releases 改以 Array.from 依字元截斷回應片段,避免拆分多位元組字元造成亂碼,並標記片段內容
- config assertRepository 加入每段長度上限,並將 valid 更名為語義明確的 isRepoFormatValid

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:05:08 +08:00
AI Review Bot 32e528988b chore: update ai-review findings [ai-review-bot][failure] 2026-06-26 06:02:02 +00:00
JefferyandClaude Opus 4.8 dd8977ffa4 chore(ai-review 狀態): 更新 findings.json 與 exclusions.json
CI / AI Code Review (pull_request) Failing after 23s
已解決 6 條(warning x6:輸入驗證、錯誤訊息、logger 測試、測試拆分與補強),1 條判定為誤報寫入 exclusions(info:withFetch 抽離屬過度設計),findings 清空。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:01:30 +08:00
JefferyandClaude Opus 4.8 a9d137ac9e test(calculate-version): 補強測試覆蓋並拆分混合測試案例
- 新增 logger section/info/error 的輸出格式測試
- config 補上 GITEA_REPOSITORY 驗證測試,並拆分 isUnset/requireEnv 的正反例
- version 補回 compareVersionArrays 的 major 跨區段比較案例

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:01:30 +08:00
JefferyandClaude Opus 4.8 b8804c5218 fix(calculate-version): 強化輸入驗證與錯誤訊息
- config 對 GITEA_REPOSITORY 加入 owner/repo 格式驗證,拒絕路徑穿越與特殊字元
- releases JSON 解析失敗時,錯誤訊息納入截斷的回傳內容片段以利除錯

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:01:30 +08:00
AI Review Bot bde3719aad chore: update ai-review findings [ai-review-bot][success] 2026-06-26 03:19:49 +00:00
Jeffery 0977e66ff4 test(calculate-version): 整併單元測試至 app/test 並移除無法被執行的重複測試目錄
CI / AI Code Review (pull_request) Successful in 38s
app/package.json 的 npm test(node --test,cwd 為 app/)只會探索 app/test/,
repo 根目錄另一份 test/ 中的 main 整合測試(index.test.js)因此從未被執行。
將 config/index/releases/version 收斂至 app/test/(修正 require 路徑),
保留 output 測試,移除重複且無法執行的 repo 根 test/。現 app/test/ 共 34 筆測試皆可執行。
2026-06-26 11:18:53 +08:00
admin 8846b6d386 Merge pull request 'refactor: calculate-version 由 bash 改寫為 Node.js' (#5) from ai-review-resolve/develop-20260626-104052 into develop
Reviewed-on: docker-actions/calculate-version#5
2026-06-26 03:00:32 +00:00
AI Review Bot 1f878199da chore: update ai-review findings [ai-review-bot][success] 2026-06-26 03:00:16 +00:00
JefferyandClaude Opus 4.8 6f95a3fbe6 chore(ai-review 狀態): 更新 findings.json 與 exclusions.json
CI / AI Code Review (pull_request) Successful in 38s
已解決 1 條(warning:補 JSON 解析失敗測試),其餘 5 條判定為誤報寫入 exclusions(critical x2 重複項、warning x2、info x1),findings 清空。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:59:32 +08:00
JefferyandClaude Opus 4.8 e54805b241 test(calculate-version): 補上 release JSON 解析失敗路徑測試
新增 fetchReleases 收到無法解析 JSON 時拋出「回傳資料無法解析」的測試案例。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:59:32 +08:00
AI Review Bot 66d2c4b35f chore: update ai-review findings [ai-review-bot][failure] 2026-06-26 02:53:10 +00:00
JefferyandClaude Opus 4.8 43601350b0 chore(ai-review 狀態): 更新 findings.json 與 exclusions.json
CI / AI Code Review (pull_request) Failing after 44s
已解決 6 條(critical x4、warning x1、info x1),4 條判定為誤報寫入 exclusions(warning x3、info x1),findings 清空。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:52:19 +08:00
JefferyandClaude Opus 4.8 fb760004fd docs(calculate-version): 更新 README 對齊錯誤處理重構
logger.fail 改為 logger.error、新增 index.main 公開函式說明,並更新對應行號與使用範例。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:52:19 +08:00
JefferyandClaude Opus 4.8 3c8704d1a3 test(calculate-version): 補上 GITEA_SERVER_URL 驗證與 main 失敗路徑測試
新增 config 的 URL 格式/協定驗證測試,以及以相依注入覆蓋 main 成功與 loadConfig/fetchReleases 失敗路徑的整合測試。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:52:19 +08:00
JefferyandClaude Opus 4.8 fdf33b41d8 fix(calculate-version): 修復 AI 審查的安全與健全性問題
- Dockerfile 移除 --no-check-certificate,恢復 TLS 憑證檢查以防中間人攻擊
- config 對 GITEA_SERVER_URL 加入 http/https URL 格式驗證
- logger.fail 改為 logger.error(僅輸出不終止行程),退出移至 index 頂層處理
- index.main 改用相依注入並於頂層攔截錯誤後 exit 1,避免 library 內呼叫 process.exit
- releases 將 response.text() 包入 try-catch 並附帶頁碼

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:52:19 +08:00
AI Review Bot f71d2cc35c chore: update ai-review findings [ai-review-bot][failure] 2026-06-26 02:43:30 +00:00
JefferyandClaude Opus 4.8 6f9df6743c docs(calculate-version): 新增 README 並補上 entrypoint/CI/CD 註解
CI / AI Code Review (pull_request) Failing after 57s
依 doc-funcs 產生 README(專案列表、功能列表、使用範例),並為 CI/CD workflow 補上逐行註解。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:41:34 +08:00
JefferyandClaude Opus 4.8 923c94d198 test(calculate-version): 新增 version/config/releases 單元測試
以 node:test 為 app/ 模組補上 24 個單元測試,涵蓋版本計算、設定載入與 release 分頁抓取。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:41:34 +08:00
JefferyandClaude Opus 4.8 bd6b6017ab refactor(calculate-version): 將版本計算邏輯由 bash 改寫為 Node.js 並依功能分檔
保留 entrypoint.sh 作為容器進入點,改為啟動 app/ 下的 Node.js 程式;
依功能拆分為 logger/config/version/releases/output/index,並更新 Dockerfile 改用 node:lts-alpine。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:41:34 +08:00
admin 4983a72524 更新 .gitea/workflows/ci.yaml 2026-06-25 16:32:25 +00:00
jiantw83 762dfb5cf7 更新 .gitea/workflows/cd.yaml 2026-06-25 14:10:51 +00:00
jiantw83 c30b09ac4c 更新 .gitea/workflows/ci.yaml 2026-06-25 14:09:11 +00:00
jiantw83 827065bd14 更新 .gitea/workflows/ci.yaml 2026-06-25 14:04:31 +00:00
jiantw83 9d89de1558 更新 .gitea/workflows/cd.yaml 2026-06-25 14:00:10 +00:00
admin 10268a9c39 更新 action.yaml 2026-06-25 13:47:14 +00:00
jiantw83 e8fa3ab67e feat(calculate-version): 改為計算版本 Docker Action 2026-06-25 10:52:39 +00:00
jiantw83 3cf52a2302 feat: add role management and usage tracking modules
- Implemented role parsing and loading functionality in roles.js, allowing for structured role definitions with metadata.
- Added tests for role management to ensure correct parsing and loading of roles.
- Created usage.js to track API usage metrics, including token counts and rate limits.
- Developed tests for usage tracking to validate functionality and edge cases.
- Enhanced overall code structure and documentation for clarity and maintainability.
2026-06-25 09:13:15 +00:00
jiantw83 6cdbcff681 Initial commit 2026-06-25 08:51:03 +00:00