Feature : Support GitLab Code Review - #48
Merged
contrueCT merged 63 commits intoMay 10, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an MVP GitLab code review integration to Nine1Bot/OpenCode, spanning the GitLab platform adapter, dedicated webhook routes, review-run persistence + runtime orchestration, and web UI surfaces to configure and monitor GitLab review runs.
Changes:
- Introduces
@nine1bot/platform-gitlab“review” domain (webhook parsing, diff manifest building, context blocks, subagent result compilation, and GitLab comment publishing). - Adds a dedicated
/webhooks/gitlab/...webhook entry plus/webhooks/gitlab/runsrun-listing and retry endpoints, backed by a local review-run store and runtime session monitor/publish flow. - Updates the web app settings/platform UI and client APIs/tests to support GitLab review run listing + retry and GitLab platform configuration.
Reviewed changes
Copilot reviewed 69 out of 69 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| web/test/config-api.test.ts | Adds tests for GitLab review run APIs. |
| web/src/components/SettingsPanel.vue | Passes provider list to platform settings; tab ordering tweak. |
| web/src/App.vue | Refactors useSettings() destructuring formatting. |
| web/src/api/client.ts | Adds gitLabReviewApi + GitLab review run types. |
| packages/platform-gitlab/tsconfig.json | Adds paths + includes scripts in TS config. |
| packages/platform-gitlab/test/gitlab-review.test.ts | Adds unit tests for GitLab review foundation/publisher. |
| packages/platform-gitlab/test/gitlab-platform.test.ts | Extends platform tests for GitLab review actions/assets. |
| packages/platform-gitlab/src/review/workflow.ts | Defines initial GitLab review subagent workflow/task specs. |
| packages/platform-gitlab/src/review/webhook.ts | Implements GitLab webhook token validation helper. |
| packages/platform-gitlab/src/review/types.ts | Adds GitLab review domain types (diff, findings, triggers). |
| packages/platform-gitlab/src/review/subagent-result-compiler.ts | Compiles/aggregates subagent outputs into deterministic findings. |
| packages/platform-gitlab/src/review/settings.ts | Adds GitLab review settings defaults + normalization. |
| packages/platform-gitlab/src/review/publisher.ts | Publishes summary + inline GitLab comments with fallbacks. |
| packages/platform-gitlab/src/review/output-schema.ts | Defines/parses structured review stage output schema. |
| packages/platform-gitlab/src/review/inline-position.ts | Validates inline positions and renders suggestions safely. |
| packages/platform-gitlab/src/review/index.ts | Exports the review module surface. |
| packages/platform-gitlab/src/review/idempotency.ts | Builds stable idempotency keys for GitLab review runs. |
| packages/platform-gitlab/src/review/finding-aggregator.ts | Aggregates duplicate findings deterministically. |
| packages/platform-gitlab/src/review/event-parser.ts | Parses GitLab webhook payloads into review triggers. |
| packages/platform-gitlab/src/review/diff-builder.ts | Builds filtered/budgeted diff manifests and blocked states. |
| packages/platform-gitlab/src/review/context-builder.ts | Builds runtime context blocks for GitLab review runs. |
| packages/platform-gitlab/src/review/comment-renderer.ts | Renders GitLab review summary Markdown. |
| packages/platform-gitlab/src/review/api-client.ts | Adds GitLab API client (diffs, notes, hooks, searches). |
| packages/platform-gitlab/src/index.ts | Re-exports review APIs + refresh helper from runtime. |
| packages/platform-gitlab/skills/review/verification-matrix/SKILL.md | Adds QA verification matrix skill. |
| packages/platform-gitlab/skills/review/subagent-prompts/tech-architect/SKILL.md | Adds tech-architect subagent prompt skill. |
| packages/platform-gitlab/skills/review/subagent-prompts/spec-writer/SKILL.md | Adds spec-writer subagent prompt skill. |
| packages/platform-gitlab/skills/review/subagent-prompts/security-agent/SKILL.md | Adds security subagent prompt skill. |
| packages/platform-gitlab/skills/review/subagent-prompts/risk-qa/SKILL.md | Adds QA/risk subagent prompt skill. |
| packages/platform-gitlab/skills/review/subagent-prompts/frontend-designer/SKILL.md | Adds frontend subagent prompt skill. |
| packages/platform-gitlab/skills/review/subagent-prompts/developer/SKILL.md | Adds developer fix-mode subagent prompt skill. |
| packages/platform-gitlab/skills/review/subagent-prompts/auto-fixer/SKILL.md | Adds auto-fixer fix-mode subagent prompt skill. |
| packages/platform-gitlab/skills/review/spec-gate-review/SKILL.md | Adds spec-gate skill for review readiness. |
| packages/platform-gitlab/skills/review/security-review-policy/SKILL.md | Adds security review policy skill. |
| packages/platform-gitlab/skills/review/review-finding-schema/SKILL.md | Adds finding schema + final output contract skill. |
| packages/platform-gitlab/skills/review/pm-risk-routing/SKILL.md | Adds PM risk routing skill. |
| packages/platform-gitlab/skills/review/gitlab-mr-review-workflow/SKILL.md | Adds MR review workflow skill. |
| packages/platform-gitlab/skills/review/gitlab-commit-review-workflow/SKILL.md | Adds commit review workflow skill. |
| packages/platform-gitlab/skills/review/gitlab-comment-rendering/SKILL.md | Adds comment rendering skill. |
| packages/platform-gitlab/scripts/review-dry-run.ts | Adds dry-run harness for fixtures/runtime/subagent outputs. |
| packages/platform-gitlab/README.md | Links to GitLab code review plugin design doc. |
| packages/platform-gitlab/package.json | Exports ./review and adds dry-run scripts. |
| packages/platform-gitlab/GITLAB_REVIEW_ENGINEERING_SUMMARY.md | Adds engineering summary documentation. |
| packages/platform-gitlab/fixtures/review/sample-webhook-mr-note.json | Adds webhook fixture with embedded changes. |
| packages/platform-gitlab/fixtures/review/sample-subagent-outputs.json | Adds subagent output fixture for compiler testing. |
| packages/platform-gitlab/fixtures/review/sample-runtime-output.md | Adds runtime-output fixture containing review payload. |
| packages/platform-gitlab/fixtures/review/sample-mr-overflow.json | Adds overflow diff fixture. |
| packages/platform-gitlab/fixtures/review/sample-mr-changes.json | Adds MR changes fixture. |
| packages/platform-gitlab/fixtures/review/sample-invalid-runtime-output.md | Adds invalid runtime output fixture. |
| packages/platform-gitlab/agents/review/tech-architect.agent.md | Adds GitLab tech-architect agent definition. |
| packages/platform-gitlab/agents/review/spec-writer.agent.md | Adds GitLab spec-writer agent definition. |
| packages/platform-gitlab/agents/review/security-agent.agent.md | Adds GitLab security agent definition. |
| packages/platform-gitlab/agents/review/risk-qa.agent.md | Adds GitLab QA/risk agent definition. |
| packages/platform-gitlab/agents/review/pm-coordinator.agent.md | Adds GitLab PM coordinator primary agent definition. |
| packages/platform-gitlab/agents/review/frontend-designer.agent.md | Adds GitLab frontend reviewer agent definition. |
| packages/platform-gitlab/agents/review/developer.agent.md | Adds GitLab developer subagent definition. |
| packages/nine1bot/src/review/run-store.ts | Persists GitLab review run records locally. |
| packages/nine1bot/src/review/gitlab-controller.ts | Handles GitLab webhook -> context -> runtime prompt -> publish flow. |
| packages/nine1bot/src/platform/manager.ts | Fixes runtime source error/status derivation. |
| packages/nine1bot/src/platform/manager.test.ts | Updates tests for runtime source error fields. |
| opencode/packages/opencode/test/server/webhooks-status.test.ts | Adds tests for local webhook URL selection. |
| opencode/packages/opencode/src/tool/task.ts | Allows resolving declared/recommendable subagents for task tool. |
| opencode/packages/opencode/src/server/routes/webhooks.ts | Adds GitLab webhook endpoints, run listing, retry/publish hooks. |
| opencode/packages/opencode/src/server/routes/nine1bot-platforms.ts | Syncs platform manager from config before listing/details. |
| opencode/packages/opencode/src/server/routes/automated-controller.ts | Adds runtime output callbacks and context passing support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…o feat/gitlab-review-workflow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
描述 / Summary
本次变更为 Nine1Bot 增加了 GitLab Code Review 的初步工程化能力,在
@nine1bot/platform-gitlab中实现了 GitLab 平台适配、专用 webhook 触发、@Nine1bot评论触发审查、MR diff 拉取、Review 结果回写以及平台配置页联调能力。目标是先打通 GitLab Review 的 MVP 闭环,为后续接入 CI 日志、质量扫描和自动修复能力打基础。
类型 / Type of change
关联的 issue(如果有)/ Related issues
/
变更点 / What changed
@Nine1bot触发代码审查,并将结果回写到 GitLab如何测试 / How to test
GitLab base URL、GitLab API token、模型等基础信息@Nine1bot review,或通过 webhook 自动触发 review本地验证命令:
bun test packages/platform-gitlab/test/gitlab-platform.test.ts packages/platform-gitlab/test/gitlab-review.test.ts
bun run --cwd packages/platform-gitlab typecheck
截图(UI 变更时提供)/ Screenshots for UI changed
Checklist(合并前请确认) / Checklist
备注 / Notes for reviewers