3.6 KiB
3.6 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 26-watcher-dispatch | Azure watcher dispatch | completed | 12 |
|
plan.md | ../../specs/azure-devops-integration/spec.md |
Task 26: Azure Watcher Dispatch
Acceptance
- Provider-specific work-item and PR watcher sources build Kandev task requests with Azure URL/identity metadata, repository/base branch, workflow context, selected profiles, and interpolated prompt.
- Work-item tasks write
azure_devops_work_item_watch_id,azure_devops_project_id,azure_devops_work_item_id, andazure_devops_work_item_url. PR tasks writeazure_devops_pr_watch_id,azure_devops_project_id,azure_devops_repository_id,azure_devops_pull_request_id, andazure_devops_pull_request_url. Each source'sWatchMetadataKeyreturns its exact watch ID key. - Shared dispatch reserves before creation, enforces
max_inflight_tasks, attaches task ID generation-safely, releases retryable failures, and treats generation ownership loss as terminal. - Missing workflow, workflow step, Kandev repository, agent profile, or executor profile self-disables the owning watch with the dependency error. Other retryable task-creation failures release the reservation for the same generation.
- Backend startup registers the sources, event handlers, poller lifecycle, task dependency checks, workspace cleanup, and watcher metadata keys used by open-task counting. Azure initialization remains non-fatal.
TDD Sequence
- Add source unit tests for request mapping, prompt interpolation, exact metadata, reserve/release/attach calls, max in-flight value, and terminal ownership loss; run red before implementing sources.
- Add event-handler/shared-dispatch tests for both event kinds, throttle counting, retry release, and every self-heal dependency.
- Add backend wiring/lifecycle tests, then register sources, handlers, poller, and cleanup. Refactor provider-common mapping only after focused tests pass.
Verification
go test ./internal/azuredevops ./internal/orchestratorfromapps/backend— passed (1,455 tests).- Coverage includes exact Azure metadata keys, prompt interpolation, throttling, reservation attach/release, dependency self-healing, and startup wiring.
Files Likely Touched
apps/backend/internal/orchestrator/source_azuredevops.goapps/backend/internal/orchestrator/source_azuredevops_test.goapps/backend/internal/orchestrator/event_handlers_azuredevops.goapps/backend/internal/orchestrator/event_handlers_azuredevops_test.goapps/backend/internal/orchestrator/watcher_dispatch_wiring.goapps/backend/internal/backendapp/services.goapps/backend/internal/backendapp/helpers.goapps/backend/internal/backendapp/main.goapps/backend/internal/task/repository/count_open_watcher_tasks_test.goapps/backend/internal/events/types.go
Dependencies
Task 25.
Parallelism
Sequential. Registration and shared dispatch wiring are package-wide seams.
Inputs
- Spec: watcher task-creation, dedup, self-heal, and reset scenarios.
source_gitlab.gofor separate review/issue sources.- Shared
watcher_dispatch.goand throttle contract.
Risks
- The metadata key written by each source must exactly match
WatchMetadataKey; otherwise the configured in-flight cap silently does nothing. - The provider's Azure repository filter is event metadata, while the Kandev repository ID selects task materialization; never substitute one for the other.
Output Contract
Report dispatch lifecycle, metadata keys, RED/GREEN commands, files changed, self-heal evidence, risks, and update task/plan status.