Compare commits

...

17 Commits

Author SHA1 Message Date
jiantw83 8a8612b46d fix: update findings.json to remove redundant warnings and ensure consistency with exclusions.json 2026-05-12 06:46:51 +00:00
AI Review Bot e3b4c7f8d4 chore: update ai-review findings [skip ci] 2026-05-12 06:32:21 +00:00
jiantw83 fdcb9f04de fix: update suggestions in exclusions.json to clarify handling of findings and LLM service provider maintenance 2026-05-12 06:29:43 +00:00
jiantw83 e3596eb710 fix: add duplicate suggestion for LLM integration tests in exclusions.json 2026-05-12 06:28:34 +00:00
AI Review Bot 83943b8dda chore: update ai-review findings [skip ci] 2026-05-12 06:24:11 +00:00
jiantw83 234a8a829f fix: update suggestion in exclusions.json for LLM integration tests to clarify API key requirements 2026-05-12 06:21:24 +00:00
AI Review Bot b164fe855e chore: update ai-review findings [skip ci] 2026-05-12 06:15:35 +00:00
jiantw83 16cb1966f0 fix: update GEMINI_API_KEY in review.yaml to use the correct secret 2026-05-12 06:11:12 +00:00
jiantw83 8d3f5e3a45 fix: update GEMINI_API_KEY in review.yaml to use the correct secret 2026-05-12 06:06:30 +00:00
AI Review Bot 85ff61e98f chore: update ai-review findings [skip ci] 2026-05-12 06:03:48 +00:00
jiantw83 4bace91d3d fix: add suggestions for LLM integration tests and code structure improvements in exclusions.json; ensure findings.json is saved with a newline 2026-05-12 06:03:30 +00:00
AI Review Bot e541cee83f chore: update ai-review findings [skip ci] 2026-05-12 05:54:43 +00:00
jiantw83 95802c422b fix: update suggestions in exclusions.json and findings.json for clarity and consistency with GEMINI API 2026-05-12 05:54:25 +00:00
jiantw83 bf7b8f843b fix: add suggestion for GEMINI API parameter consistency in review.yaml 2026-05-12 05:50:46 +00:00
AI Review Bot e88e586ac6 chore: update ai-review findings [skip ci] 2026-05-12 05:48:20 +00:00
jiantw83 6921ca05ec fix: update AI Code Review step to use GEMINI API instead of OpenRouter 2026-05-12 05:47:09 +00:00
AI Review Bot 8046708f00 chore: update ai-review findings [skip ci] 2026-05-12 05:37:32 +00:00
4 changed files with 58 additions and 130 deletions
+54
View File
@@ -39,5 +39,59 @@
"role": "Aria", "role": "Aria",
"location": "README.md", "location": "README.md",
"suggestion": "章節編號連續且正確,無需調整" "suggestion": "章節編號連續且正確,無需調整"
},
{
"role": "Maya",
"location": ".gitea/workflows/review.yaml",
"suggestion": "action.yaml 定義的參數名稱為 GEMINI_API_KEY、GEMINI_BASE_URL、GEMINI_MODEL,與 review.yaml 完全一致,無不匹配問題"
},
{
"role": "Aria",
"location": ".gitea/workflows/review.yaml",
"suggestion": "review.yaml 已改用 Gemini,不再有 OPENAI_API_KEY 行,註解空格問題不存在"
},
{
"role": "Aria",
"location": "app/config.test.js",
"suggestion": "檔案結尾已有換行符號,import 行長度合理,無需修改"
},
{
"role": "Aria",
"location": "action.yaml",
"suggestion": "action.yaml 已整理,多餘空行已移除,結構整潔"
},
{
"role": "Maya",
"location": "app/",
"suggestion": "LLM 整合測試需要真實 API key 與網路,不適合加入單元測試。llm.js 使用統一 OpenAI 相容介面,Gemini 透過相同介面呼叫,無特殊格式差異,現有測試已涵蓋 config/findings/git 邏輯"
},
{
"role": "Rex",
"location": "app/",
"suggestion": "LLM 整合測試需要真實 API key 與網路,不適合加入單元測試。llm.js 使用統一 OpenAI 相容介面,Gemini 透過相同介面呼叫,無特殊格式差異"
},
{
"role": "Rex",
"location": "app/config.test.js",
"suggestion": "import 語句長度合理,無需拆分為多行"
},
{
"role": "Rex",
"location": ".gitea/ai-review/findings.json",
"suggestion": "findings.json 重複問題由 AI 去重與排除機制處理,不是程式碼問題"
},
{
"role": "Rex",
"location": "app/comments.js",
"suggestion": "JSON 結尾換行符號為標準做法,不影響任何 JSON 解析器,無相容性問題"
},
{
"location": ".gitea/ai-review/findings.json",
"suggestion": "findings.json 是自動產生的問題記錄檔,不應對其內容提出審查問題"
},
{
"role": "Rex",
"location": ".gitea/workflows/review.yaml",
"suggestion": "切換 LLM 服務提供商的維護建議屬過度謹慎,不是實際程式碼問題"
} }
] ]
-126
View File
@@ -1,128 +1,2 @@
[ [
{
"level": "warning",
"role": "Rex",
"location": ".gitea/workflows/review.yaml:33",
"suggestion": "工作流程目前授予 contents、pullrequests、issues 三項 write 權限,過於寬鬆。建議依實際需求僅授予 read 或最小必要的 write 權限,以降低被濫用的風險。",
"is_new": false
},
{
"level": "warning",
"role": "Rex",
"location": ".gitea/workflows/review.yaml:35",
"suggestion": "將 OPENAI_API_KEY 參數改為使用正確的 secret 名稱(如 OPENROUTER_API_KEY)時,請確保工作流程文件中不會同時暴露兩個不同的 secret 名稱,以免因名稱錯誤導致金鑰未傳入或意外洩漏。",
"is_new": false
},
{
"level": "warning",
"role": "Aria",
"location": ".gitea/workflows/review.yaml:33",
"suggestion": "在 `OPENAI_API_KEY` 後的註解前應保留一個空格,以符合常見的 YAML 註解風格:`... ${{ secrets.OPENROUTER_API_KEY }} # OpenRouter 使用 OpenAI 相容介面,以 OPENAI_API_KEY 傳入`。",
"is_new": false
},
{
"level": "warning",
"role": "Aria",
"location": "README.md",
"suggestion": "文件中章節編號不連續(例如 `### 2. OpenRouter` 後直接跳到 `### 3. Anthropic Claude`),建議重新編號或使用一致的標題層級,以提升可讀性與維護性。",
"is_new": false
},
{
"level": "warning",
"role": "Rex",
"location": ".gitea/workflows/review.yaml:33-35",
"suggestion": "工作流程目前授予 contents、pullrequests、issues 三項 write 權限過於寬鬆。建議依實際需求僅授予 read 或最小必要的 write 權限,降低被濫用的風險。",
"is_new": false
},
{
"level": "warning",
"role": "Rex",
"location": ".gitea/workflows/review.yaml:33",
"suggestion": "將 OPENAI_API_KEY 參數改為使用正確的 secret 名稱(如 OPENROUTER_API_KEY)時,請確保工作流程檔案中不會同時暴露兩個不同的 secret 名稱,以免因名稱錯誤導致金鑰未傳入或意外洩漏。",
"is_new": false
},
{
"level": "warning",
"role": "Aria",
"location": ".gitea/ai-review/findings.json",
"suggestion": "檔案最後缺少換行符號,請在檔案結尾加入一個空白換行。",
"is_new": false
},
{
"level": "warning",
"role": "Aria",
"location": "app/config.test.js",
"suggestion": "檔案最後缺少換行符號,請在檔案結尾加入空白換行。",
"is_new": false
},
{
"level": "warning",
"role": "Aria",
"location": "README.md:28",
"suggestion": "文件中章節編號不連續(例如 `### 2. OpenRouter` 後直接跳到 `### 3. Anthropic Claude`),請重新編號或使用自動編號方式,保持編號連續。",
"is_new": false
},
{
"level": "warning",
"role": "Aria",
"location": "README.md:42",
"suggestion": "標題層級使用不一致,部分章節使用 `### 1.`、`### 2.`,而後面的章節直接跳到 `### 3.`,建議統一使用相同層級的 Markdown 標題,並在每個標題後留一個空行以提升可讀性。",
"is_new": false
},
{
"level": "warning",
"role": "Aria",
"location": "action.yaml:72-99",
"suggestion": "大量移除的輸入欄位留下多行空白與註解,請整理檔案結構,移除不必要的空行與註解,保持檔案整潔。",
"is_new": false
},
{
"level": "info",
"role": "Aria",
"location": "app/config.test.js",
"suggestion": "匯入語句過長,建議改寫為多行匯入,例如:\n```js\nimport {\n describe,\n it,\n beforeEach,\n afterEach\n} from 'node:test';\n```",
"is_new": false
},
{
"level": "info",
"role": "Aria",
"location": "app/config.test.js",
"suggestion": "`ENV_KEYS` 陣列過長,建議分行列舉,每行放置一個環境變數,以提升可讀性。",
"is_new": false
},
{
"level": "info",
"role": "Leo",
"location": "app/config.test.js:1",
"suggestion": "匯入語句過長,建議改寫為多行匯入,以提升可讀性,例如:\n```js\nimport {\n describe,\n it,\n beforeEach,\n afterEach\n} from 'node:test';\n```",
"is_new": false
},
{
"level": "info",
"role": "Leo",
"location": "app/config.test.js:9",
"suggestion": "`ENV_KEYS` 陣列過長,建議分行列舉,每行放置一個環境變數,以提升可讀性與維護性。",
"is_new": false
},
{
"level": "info",
"role": "Aria",
"location": "app/config.test.js:1",
"suggestion": "匯入語句過長,建議改寫為多行匯入,例如:\n```js\nimport {\n describe,\n it,\n beforeEach,\n afterEach\n} from 'node:test';\n```",
"is_new": false
},
{
"level": "info",
"role": "Aria",
"location": "app/config.test.js:7",
"suggestion": "`ENV_KEYS` 陣列過長,建議每行放置一個環境變數,分行列舉以提升可讀性。",
"is_new": false
},
{
"level": "info",
"role": "Aria",
"location": ".gitea/workflows/review.yaml:33",
"suggestion": "在 `OPENAI_API_KEY` 後的註解前保留一個空格,以符合常見的 YAML 註解風格:`... ${{ secrets.OPENROUTER_API_KEY }} # OpenRouter 使用 OpenAI 相容介面,以 OPENAI_API_KEY 傳入`。",
"is_new": false
}
] ]
+3 -3
View File
@@ -33,9 +33,9 @@ jobs:
- name: AI Code Review - name: AI Code Review
uses: https://gitea.jsc.idv.tw/jiantw83/code-review@v${{ needs.version.outputs.version }} uses: https://gitea.jsc.idv.tw/jiantw83/code-review@v${{ needs.version.outputs.version }}
with: with:
OPENAI_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} # OpenRouter 使用 OpenAI 相容介面,以 OPENAI_API_KEY 傳入 GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY_1 }}
OPENAI_BASE_URL: https://openrouter.ai/api/v1 GEMINI_BASE_URL: https://generativelanguage.googleapis.com/v1beta
OPENAI_MODEL: ${{ vars.OPENROUTER_MODEL }} GEMINI_MODEL: ${{ vars.GEMINI_MODEL }}
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write
+1 -1
View File
@@ -21,7 +21,7 @@ function buildTable(findings) {
export function saveFindings(workspace, findings) { export function saveFindings(workspace, findings) {
const fullPath = path.join(workspace, FINDINGS_PATH); const fullPath = path.join(workspace, FINDINGS_PATH);
fs.mkdirSync(path.dirname(fullPath), { recursive: true }); fs.mkdirSync(path.dirname(fullPath), { recursive: true });
fs.writeFileSync(fullPath, JSON.stringify(findings, null, 2), 'utf8'); fs.writeFileSync(fullPath, JSON.stringify(findings, null, 2) + '\n', 'utf8');
console.log(` ✅ findings 寫入: ${fullPath} (${findings.length} 筆)`); console.log(` ✅ findings 寫入: ${fullPath} (${findings.length} 筆)`);
} }