refactor(foreman-handler): migrate to adapter factory (MF-10) #314
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!314
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/mf10-migrate-foreman"
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?
Summary
new ForgejoAdapter(token)callsites inapps/server/src/http/handlers/foreman.tstocreateForgeAdapterForRepo(repo, token)fromadapter-factory.ts, so the foreman's multi-repo edits (spec reads/writes, breakdown preview, batch issue creation, tracking-issue comments) route through each repo'sforge:binding instead of silently hitting Forgejo.ForgejoAdapterinhandleForemanRepos(listAccessibleRepos()): it's the operator-hosted account-discovery path, has no repo scope to feed the factory, and is intentionally Forgejo-specific. Marked inline as an intentional exception.Test plan
just qa— typecheck clean, biome check/format cleanbun test src/http/handlers/foreman.test.ts— 36/37 pass; the one remaining failure (listSessions returns newest-first) is a pre-existingDate.now()ordering flake onorigin/mainunrelated to this change/foreman/breakdown-previewon a GitHub-bound repo should route throughGitHubAdapterrather than silently 404ing againstforge.jacquin.appCallsites migrated (line numbers post-patch):
listDir(handleForemanFilesList)readFile(handleForemanFileContent)writeFilesetup (handleForemanSpecSave)readFile(handleForemanBreakdownPreview — remote spec fetch)listIssues(handleForemanBreakdownPreview — dedup)createIssue(handleForemanCreateIssues)createComment(handleForemanCreateIssues — tracking summary)Exception kept: 205
listAccessibleRepos(handleForemanRepos).