3.3 KiB
3.3 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 02-watcher-dispatch | GitLab watcher task dispatch | done | 2 |
|
plan.md | ../../specs/integrations/requirements/gitlab-integration.md |
Task 02: GitLab Watcher Task Dispatch
Acceptance
- Review and issue matches flow through
WatcherDispatchCoordinatorand create exactly one task with the selected workflow step, profiles, prompt, optional repository/base branch, and auto-start parameters. - Dispatch failure releases the reservation; deleted profiles/repositories and max-inflight violations disable or defer the watch using shared coordinator semantics instead of creating an orphan/duplicate task.
- Workspace-scoped create/edit/pause/run/reset/delete APIs validate watch dependencies. Reset preview drives the shared best-effort delete/clear/rerun contract; delete best-effort removes owned tasks and never reruns the watch.
Verification
cd apps/backend && rtk go test ./internal/orchestrator/... ./internal/gitlab/...
cd apps/backend && rtk go test -run 'Test.*GitLab.*(Dispatch|Watch|Reset|SelfHeal)' ./internal/orchestrator/... ./internal/gitlab/...
Files Likely Touched
apps/backend/internal/orchestrator/source_gitlab.go(new)apps/backend/internal/orchestrator/source_gitlab_test.go(new)apps/backend/internal/orchestrator/event_handlers_gitlab.goapps/backend/internal/orchestrator/event_handlers_gitlab_test.goapps/backend/internal/orchestrator/watcher_dispatch_wiring.goapps/backend/internal/orchestrator/service.goapps/backend/internal/gitlab/watch_models.goapps/backend/internal/gitlab/store.goapps/backend/internal/gitlab/store_watches.goapps/backend/internal/gitlab/store_watches_test.goapps/backend/internal/gitlab/service_reservations.goapps/backend/internal/gitlab/service_watches.goapps/backend/internal/gitlab/service_watches_test.goapps/backend/internal/gitlab/service_issue_watches.goapps/backend/internal/gitlab/service_cleanup.goapps/backend/internal/gitlab/controller_watches.goapps/backend/internal/gitlab/controller_watch_reset.go(new)apps/backend/internal/gitlab/controller_test.goapps/backend/internal/backendapp/main.goapps/backend/internal/backendapp/adapters.go
Dependencies
Task 01 must provide workspace client resolution before a poll can dispatch against the correct host/account.
Inputs
- Spec: automation-watch
What, Task and watch records, Automation watch state machine, watch failure modes, and watch scenarios. - Pattern:
apps/backend/internal/orchestrator/source_jira.go,source_linear.go,source_sentry.go, andwatcher_dispatch.go. - Pattern: GitHub/Jira reset preview and reset controller/service tests.
- Lifecycle contract: mirror GitHub code-host watches exactly for reset/delete; cleanup policy only governs terminal-item cleanup, not explicit reset/delete.
- Constraint: do not add another integration-specific task-creation pipeline or
keep the nullable
GitLabIssueTaskCreator/GitLabReviewTaskCreatorseam.
Output Contract
Report both WatcherSource mappings, dedup lifecycle, validation/self-heal
behavior, reset policy, files changed, tests run, blockers, and poller risks.
Mark this task done and update plan.md after verification.