9e6c2098b1
Co-authored-by: nova28 <17953305+nova28@users.noreply.github.com> Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
2.2 KiB
2.2 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | ||
|---|---|---|---|---|---|---|---|---|
| 05-wire-gitlab-provider | Wire the GitLab provider into workflow sync | done | 3 |
|
plan.md | ../../specs/gitlab-workflow-sync/spec.md |
Task 05: Wire The GitLab Provider Into Workflow Sync
Acceptance
initWorkflowSyncServiceaccepts and forwardsgitlabSvcalongsidegithubSvc, andgitlab.ServicesatisfiesGitLabClientProviderat compile time. Backend boot succeeds with either integration unconfigured.- The HTTP config GET/POST payloads carry
providerandproject_path; a POST omittingprovideris still accepted asgithub, so existing API clients are unaffected. Routes, methods, and status codes are unchanged, and an invalid provider returns HTTP 400 viaErrInvalidConfig. - An end-to-end backend test configures a GitLab sync against a mock GitLab
client and asserts the fetched definitions are applied — covering spec
scenarios 1 and 7 (nested subgroup
project_path).
Verification
cd apps/backend && go test ./internal/workflowsync/... ./internal/backendapp/... -race
Files Likely Touched
apps/backend/internal/backendapp/services.go—initWorkflowSyncServicesignature and its call site.apps/backend/internal/workflowsync/handlers.go— only if payload binding needs adjustment; the struct-driven bind may already suffice.apps/backend/internal/workflowsync/service_test.goor a new integration test.
Inputs
- Spec
## API Surface→### HTTP, and## Scenarios1, 5, 7. services.go:571-578— current wiring,githubSvconly.mock_client.gofrom task 01 provides the seedable GitLab fixture.
Risks
- A hard dependency on a configured GitLab service would break boot for GitHub-only installs. Both providers must be optional/nil-tolerant.
- Adding a required
providerfield to the POST contract would break existing clients. It must remain optional with agithubdefault.
Output Contract
GitLab workflow sync works end-to-end at the service and HTTP layers, verified against a mock GitLab client including a nested subgroup path. Frontend is task 06.