refactor(server): migrate webhook-ci to ForgePort #278
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!278
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/migrate-webhook-ci-to-forgeport"
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?
Fourth per-consumer Forgejo migration after pipeline (#275), board (#276), and deps (#277 parallel).
Scope
http/webhook-ci.ts— post-CI dispatch decisions (decidePostCiAction,prMergeable,findOpenPRForHead,fetchAggregateState,fetchFailingRunLogs).What changed
new ForgejoAdapter(token).<method>(parseRepo(repo), ...)decidePostCiActioniterates reviews with port shapes:r.reviewer/r.state === "approved" | "changes_requested" | "request_review"/r.commitSha/r.stalerequestedReviewers(string[]) andlabels(string[]) directly — no mappingrequestReviewers(returns status-code) →forge.requestReview(returns boolean); callers that checked>= 200 && < 300now check the booleandeleteReviewRequestsingle-reviewer →forge.removeReviewRequest([reviewer])array formfetchFailingRunLogsreuses one adapter instance across the probe loopWhat stays raw
handleStatusEvent/handleActionRunEventinputs,PrForCi,PrForFallback) — the port is only for outbound API calls, not for webhook event bodies Forgejo sends usfindOpenPRForHeadstill returns the legacyOpenPRForHeadshape internally to keepwebhook-handlers.tsconsumers stable (maps theForgePullRequestback toOpenPRForHeadat the call site)repoHasWorkflows— not used in this file; migration deferred towebhook-handlers.tsNo port extensions needed
Pipeline (#275) already shipped
ForgeReview.stale,ReviewState: "request_review",ForgeWorkflowRun.htmlUrl. Every call here maps cleanly.Tests
webhook-ci.test.tspass untouched — fetch-spy feeds raw Forgejo JSON that the adapter maps transparentlyapps/server/src/http/tests passIndependence
Disjoint from the sibling parallel migrations (deps #277, janitor #278). No shared files, no port extensions to reconcile.