GitLab

核心優勢

跨檔案脈絡分析從 MR diff 追溯相關程式、定義與既有討論。
外部規格查證啟用 Context7 後,依專案版本核對第三方 library 的官方文件。
專案規範整合遵循 AGENTS.md 與 SKILL.md,於 diff 對應行提供具體修正建議。
example-team/sample-service/Merge Requests/!42

升級 Next.js 16 並調整登入頁

Draft

Opened by @developer · Merge Request !42 · 範例專案

Description

將專案升級至 Next.js 16,並更新登入頁的 session 讀取流程。

Pipeline #128Waiting for manual action
ai-code-reviewstage: review · Manualgpt-6-luna · max

Activity

History · 5 events
  1. @developer opened this merge request · 3 小時前
  2. AI Review Bot started a thread on the diff · 2 小時前
    AI Review Bot @ai-review started a thread on the diff✓ Resolved
    app/account/page.tsx
    27+const session = cookies().get('session')
    AI Review Bot @ai-review · Maintainer

    🟠 MUST · Bug: Next.js 16 要先 await cookies()

    repo 已升級到 Next.js 16,這行仍同步讀取 cookie,登入頁可能無法取得 session。

    如何修正:先用 const cookieStore = await cookies(),再呼叫 cookieStore.get('session')。

    📖 依據:已讀 package.json 與登入頁;透過 Context7 核對 Next.js 16 官方升級文件,同步存取已移除。

  3. AI Review Bot started a thread on the diff · 2 小時前
    AI Review Bot @ai-review started a thread on the diffOpen
    package.json
    12+"next": "^16.0.0"
    AI Review Bot @ai-review · Maintainer

    🟠 MUST · Bug: Next.js 16 已移除 next lint

    升級了 next,但 repo 的 lint script 仍是 next lint;CI 執行 lint 時會失敗。

    如何修正:把 lint script 改成 eslint .,並確認 ESLint 設定可用。

    📖 依據:已讀 package.json 的依賴與 script;透過 Context7 核對 Next.js 16 官方升級文件,確認 next lint 已移除。

  4. AI Review Bot commented · review summary

    AI Code Review — 8f3a21c4

    本 MR 升級 Next.js 16,並調整登入頁。

    Overall Risk: 🟠 High
    Spec Check

    Context7 核對 Next.js 16 官方文件:cookies() 與 next lint 的用法需要更新。

    Key Findings

    登入頁仍同步讀取 cookie;CI lint script 仍呼叫已移除的指令。

    Recommended Tests

    登入後重整頁面,並執行 npm run lint。

  5. @developer replied to the cookie thread · 1 小時前

    作者回覆 · 已修正
    改用 await cookies(),並補上登入測試。

用 ChatGPT 方案執行

Codex OAuth 不需 OpenAI API key。Manual job 控制執行時機;用量仍依 ChatGPT 方案或工作空間額度。

預設 gpt-6-luna · max Fast mode 預設開啟;設 AI_REVIEW_FAST=0 可改用一般模式。

查看 Codex 方案額度

無縫整合到專案 Repository

在現有 .gitlab-ci.yml 加入 include,並將 review 放進 stages。

.gitlab-ci.yml
include:
  - project: 'mpqa-team/research/ai-code-review'
    ref: latest
    file: 'templates/ai-review.yml'

stages:
  - review
CODEX_AUTH_JSON
自己的 Codex OAuth 登入資料,設成 Masked、Protected CI/CD variable;請主動定期更新。
GITLAB_TOKEN
自己的 GitLab project access token,需有 api scope,供 job 回寫 MR。
CONTEXT7_API_KEY(選用)
啟用 Context7,讓 reviewer 核對第三方 library 的現行官方文件。
模型
預設 gpt-6-luna、effort max;可用 CODEX_MODEL 覆蓋模型。
如何準備 OAuth 與定期更新?

先用 ChatGPT 帳號登入 Codex,再將 ~/.codex/auth.json 編碼後存為 CODEX_AUTH_JSON:

base64 < ~/.codex/auth.json | tr -d '\n'

請主動定期用最新的 auth.json 更新 CODEX_AUTH_JSON。Base64 不是加密。