2.1 KiB
2.1 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 03-gitlab-workspace-repo-contents | GitLab workspace-routed repository content reads | done | 2 |
|
plan.md | ../../specs/integrations/requirements/gitlab-workflow-sync.md |
Task 03: GitLab Workspace-Routed Repository Content Reads
Acceptance
gitlab.ServiceexposesListRepoTreeForWorkspace(ctx, workspaceID, projectPath, path, ref string)andGetRepoFileContentForWorkspace(ctx, workspaceID, projectPath, path, ref string), each resolving the client through the existingClientForWorkspaceand delegating to the task-01 client methods.- A workspace with no GitLab connection produces an actionable error naming
GitLab (not a nil-pointer panic and not a generic failure), propagated from
the existing
ClientForWorkspaceerror path. - No new credential, host, or token handling is introduced — host and auth
resolution stay entirely inside
ClientForWorkspace, so self-managed GitLab works without additional configuration.
Verification
cd apps/backend && go test ./internal/gitlab/... -race
Files Likely Touched
apps/backend/internal/gitlab/service_repo_contents.go(new).apps/backend/internal/gitlab/service_repo_contents_test.go(new).
Inputs
- Spec
## API Surface→### gitlab.Client, and## Permissions. apps/backend/internal/github/service_repo_contents.go:5-29is the shape to mirror, minusensureRepositoryInWorkspaceScopeandresolveAutomationClient— GitLab has no App-installation or repo-scope-mode concept, so the workspace token is itself the scope boundary (spec## Permissions).service_config.go:432-458—ClientForWorkspace/ClientForWorkspaceHost.
Risks
- Reaching for
ClientForWorkspaceHostwith an explicit host would reintroduce a host field the spec deliberately excludes. Use the plainClientForWorkspace.
Output Contract
Two workspace-routed methods on gitlab.Service that structurally satisfy the
GitLabClientProvider interface defined in task 04, with a test covering the
missing-connection error. Nothing imports them yet.