4.2 KiB
4.2 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | ||
|---|---|---|---|---|---|---|---|---|
| 07-mr-creation-runtime | GitLab merge request creation runtime | done | 4 |
|
plan.md | ../../specs/integrations/requirements/gitlab-integration.md |
Task 07: GitLab Merge Request Creation Runtime
Acceptance
worktree.create_prdetects GitLab HTTPS, SSH, and self-managed remotes, pushes the current branch, and creates a ready/draft MR throughglabor the token-authenticated REST fallback using the explicit or project-default base.- A successful response identifies
provider: "gitlab", uses MR terminology in desktop/mobile UI, and asynchronously links the returned URL to the originating task repository; retries are idempotent after partial push/MR failure. - Workspace host/token injection and clone URL construction are isolated by
workspace, redacted in errors/logs, and never fall back to
gitlab.comfor a self-managed connection.
Verification
cd apps/backend && rtk go test -run 'Test.*(GitLab|CreatePR|PRProvider|PRCreated)' ./internal/agentctl/server/process/... ./internal/agent/handlers/... ./internal/backendapp/... ./internal/repoclone/... ./internal/orchestrator/executor/...
cd apps/backend && rtk go test ./internal/agentctl/server/process/... ./internal/agent/handlers/... ./internal/backendapp/... ./internal/repoclone/... ./internal/orchestrator/executor/...
cd apps && rtk pnpm --filter @kandev/web test -- --run hooks/use-git-operations.test.ts components/vcs/vcs-dialogs.test.tsx components/task/mobile/session-mobile-top-bar-git-controls.test.tsx components/task/changes-panel-data.test.tsx
Files Likely Touched
apps/backend/internal/agentctl/server/process/git.goapps/backend/internal/agentctl/server/process/git_test.goapps/backend/internal/agentctl/server/process/git_pr_providers.goapps/backend/internal/agentctl/server/process/git_pr_providers_test.goapps/backend/internal/agent/runtime/agentctl/git.goapps/backend/internal/agent/handlers/git_handlers.goapps/backend/internal/agent/handlers/git_handlers_test.goapps/backend/internal/backendapp/gateway.goapps/backend/internal/backendapp/gateway_test.go(new)apps/backend/internal/backendapp/main.goapps/backend/internal/backendapp/services.goapps/backend/internal/orchestrator/executor/executor_execute.goapps/backend/internal/orchestrator/executor/executor_test.goapps/backend/internal/repoclone/protocol.goapps/backend/internal/repoclone/protocol_test.goapps/backend/internal/agent/credentials/env_provider.goapps/backend/internal/agentctl/AGENTS.mdapps/web/hooks/use-git-operations.tsapps/web/hooks/use-git-operations.test.ts(new)apps/web/components/vcs/vcs-dialogs.tsxapps/web/components/vcs/vcs-dialogs.test.tsx(new)apps/web/components/task/mobile/session-mobile-top-bar-git-controls.tsxapps/web/components/task/mobile/session-mobile-top-bar-git-controls.test.tsx(new)apps/web/components/task/changes-panel-data.tsxapps/web/components/task/changes-panel-data.test.tsx(new)apps/web/components/task/changes-panel-helpers.tsapps/web/lib/state/slices/gitlab/gitlab-slice.ts
Dependencies
Task 01 supplies workspace connection resolution/token ownership. Task 03 supplies the explicit association service used by the create callback.
Inputs
- Spec: first-class MR creation
What, creation protocol response, action failure modes, persistence, and draft-MR scenario. - Scoped guidance:
apps/backend/internal/agentctl/AGENTS.md. - Patterns: GitHub and Azure creators in
apps/backend/internal/agentctl/server/process/git_pr_providers.goand current GitHub callback inapps/backend/internal/backendapp/gateway.go. - Constraint: JSON bodies must use structured encoding; command/log sanitization must cover title, description, token, and credential-bearing remotes.
Output Contract
Report provider detection/remote parsing, glab/REST selection, target-branch
resolution, callback association, environment/clone resolution, UI terminology,
files changed, tests run, blockers, and security risks. Mark this task done and
update plan.md after verification.