refactor: split internal/workflows/service.go (2673 lines) #449
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman#449
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Code-quality audit (P2).
internal/workflows/service.gois 2673 lines and holds the wire types, a 50-methodStoreinterface, publishing, triggers, the scheduler, agent driving, budget accounting, and all validation in one file.Why it matters
Every workflow change touches the same file, so concurrent work conflicts constantly. Reviewers cannot see which layer a diff belongs to. It is also the umbrella for #446 (
dispatchLocked), #447 (Storeinterface), and #448 (validateDefinition) — do those first, then this becomes mostly file moves.Suggested split
Along seams that already exist — no behaviour change, pure file moves:
types.go— wire types (Definition,Node,Run,Attempt, ...).store.go— theStoreinterface (see the split ticket).triggers.go— already exists; moveshouldFire/nextCheck/fire*/drainQueuedinto it.dispatch.go—dispatchLockedand the agent-driving helpers.validate.go—validateDefinitionand thevalidate*siblings.service.gokeeps theServicestruct, construction, and the public API surface.Acceptance criteria
internal/workflowsexceeds ~800 lines.go test ./internal/workflows/...passes unchanged, no signature changes.triggers.go.Effort: L.
Blocked by
Best done after #446, #447, #448.