Extract Forgejo work-item + SCM operations behind a provider boundary (from #508 scope 4) #553

Closed
opened 2026-07-03 07:01:27 +00:00 by coilysiren · 0 comments
Owner

Follow-up from #508 (scope 4), split out so #508 could land its concrete slices (workflow modes + the docs reframe).

Goal

Progressively isolate Forgejo-specific work-item and SCM behavior behind provider-shaped seams, so future GitHub/GitLab support is architecturally plausible without rewriting the driver. Interfaces should evolve from the current code, not be imposed wholesale (per #508).

Why deferred from #508

This is a broad, cross-cutting refactor of the dispatch/reserve/comment/close and clone/push paths (cmd/ward/agent.go, forgejo_ops.go, git*.go, the reaper). #508 explicitly listed it as its own breakout; landing it alongside workflow modes would have made #508 unreviewably large. Note the GitHub lane (ward#489) already splits some landing behavior by forge, which is a natural starting seam.

Sketch (from #508, to evolve from real code)

  • WorkItemProvider: ParseRef, Read, ReadThread, Reserve, Release, Comment, Close.
  • SCMProvider: CloneURL, PushURL, OpenPR, ReadCI, Merge.

Acceptance (from #508)

  • Forgejo-specific parse/comment/list behavior progressively isolated behind provider-shaped functions/interfaces.
  • Existing Forgejo behavior unchanged.
  • New workflow-mode work (the #508 --workflow slice) does not deepen Forgejo coupling.
  • Public docs say "work items"/"issues" where generic, "Forgejo issues" only where implementation-specific.
  • Future GitHub/GitLab support plausible without rewriting the driver.
Follow-up from #508 (scope 4), split out so #508 could land its concrete slices (workflow modes + the docs reframe). ## Goal Progressively isolate Forgejo-specific work-item and SCM behavior behind provider-shaped seams, so future GitHub/GitLab support is architecturally plausible without rewriting the driver. Interfaces should **evolve from the current code**, not be imposed wholesale (per #508). ## Why deferred from #508 This is a broad, cross-cutting refactor of the dispatch/reserve/comment/close and clone/push paths (`cmd/ward/agent.go`, `forgejo_ops.go`, `git*.go`, the reaper). #508 explicitly listed it as its own breakout; landing it alongside workflow modes would have made #508 unreviewably large. Note the GitHub lane (ward#489) already splits some landing behavior by `forge`, which is a natural starting seam. ## Sketch (from #508, to evolve from real code) - `WorkItemProvider`: `ParseRef`, `Read`, `ReadThread`, `Reserve`, `Release`, `Comment`, `Close`. - `SCMProvider`: `CloneURL`, `PushURL`, `OpenPR`, `ReadCI`, `Merge`. ## Acceptance (from #508) - Forgejo-specific parse/comment/list behavior progressively isolated behind provider-shaped functions/interfaces. - Existing Forgejo behavior unchanged. - New workflow-mode work (the #508 `--workflow` slice) does not deepen Forgejo coupling. - Public docs say "work items"/"issues" where generic, "Forgejo issues" only where implementation-specific. - Future GitHub/GitLab support plausible without rewriting the driver.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/ward#553
No description provided.