feat(forge): GitHub adapter for ForgePort (MF-1) #303

Merged
code-lead merged 4 commits from dev/292 into main 2026-04-24 09:11:36 +00:00
Collaborator

GitHub REST API v3 implementation of every ForgePort method, pairing with Forgejo adapter behind the same hex boundary.

Key divergences from ForgejoAdapter documented in the adapter header:

  • Dependencies: no native GitHub dep API — getBlockers/getBlocked parse Depends on #N / Blocks #N body-text markers; addBlocker appends the line. On Forgejo the native /dependencies + /blocks API is used instead.
  • Labels: GitHub accepts names directly on mutation endpoints (no numeric-ID lookup).
  • Auth: Bearer scheme vs. Forgejo's token scheme.
  • Rate limits: backs off on X-RateLimit-Remaining: 0, waits until X-RateLimit-Reset, retries once (max 70 s wait).

Test plan

  • just qa passes (Biome lint/format + typecheck all clean)
  • 51 adapter tests pass (github-adapter.test.ts) — covers all ForgePort methods, CI status aggregation, dependency body parsing, rate-limit retry with fixture scenarios
  • No live GitHub API calls in tests (all fetch-spy intercepted)

Closes #292

GitHub REST API v3 implementation of every `ForgePort` method, pairing with Forgejo adapter behind the same hex boundary. Key divergences from `ForgejoAdapter` documented in the adapter header: - **Dependencies**: no native GitHub dep API — `getBlockers`/`getBlocked` parse `Depends on #N` / `Blocks #N` body-text markers; `addBlocker` appends the line. On Forgejo the native `/dependencies` + `/blocks` API is used instead. - **Labels**: GitHub accepts names directly on mutation endpoints (no numeric-ID lookup). - **Auth**: `Bearer` scheme vs. Forgejo's `token` scheme. - **Rate limits**: backs off on `X-RateLimit-Remaining: 0`, waits until `X-RateLimit-Reset`, retries once (max 70 s wait). ## Test plan - [ ] `just qa` passes (Biome lint/format + typecheck all clean) - [ ] 51 adapter tests pass (`github-adapter.test.ts`) — covers all ForgePort methods, CI status aggregation, dependency body parsing, rate-limit retry with fixture scenarios - [ ] No live GitHub API calls in tests (all fetch-spy intercepted) Closes #292
feat(forge): add GitHub adapter for ForgePort (MF-1)
Some checks failed
qa / qa (pull_request) Failing after 3m1s
qa / dockerfile (pull_request) Successful in 10s
772b709897
Implements every ForgePort method against GitHub REST API v3.
Auth via PAT (`Bearer` scheme), rate-limit backoff on X-RateLimit-Remaining=0.
Dependencies use body-text parsing (no native GitHub dep API);
divergence documented in adapter header. Includes MF-6 conformance scaffold
(51 tests covering all methods, rate-limit retry, and CI status aggregation).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(forge): align github-adapter blocker parser with deps.ts
Some checks are pending
qa / qa (pull_request) Waiting to run
qa / dockerfile (pull_request) Waiting to run
79092c3ada
The adapter's body-text fallback only matched "Depends on" / "Blocked by",
missing "Blocks on", "Dependency:", "Dependencies:" — the full phrasing
set domain/workflow/deps.ts::parseBlockersFromBody accepts on Forgejo.
Operators authoring issues that work on Forgejo would silently lose deps
on GitHub. Adds the missing patterns + continuation-list support,
annotates ForgeComment return on listComments, and applies Biome format.
Covers both new phrasings with tests (53 pass).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix(forge): address review for GitHub adapter (#303 follow-up)
All checks were successful
qa / qa (pull_request) Successful in 4m6s
qa / dockerfile (pull_request) Successful in 6s
d53b3e5f81
Document two behavioural divergences from the Forgejo adapter so callers
treat the GitHub path as best-effort where it genuinely differs:

  - getAggregateStatus rolls up Check Runs only, not legacy /statuses —
    fine for Actions-based CI (the production case) but worth calling
    out vs. Forgejo's /combined surface.
  - listAccessibleRepos caps at 4×50 = 200 repos; noted so the next
    operator who hits the ceiling knows where to bump it.

Header-comment only; no runtime change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
charles force-pushed dev/292 from d53b3e5f81
All checks were successful
qa / qa (pull_request) Successful in 4m6s
qa / dockerfile (pull_request) Successful in 6s
to b84a0ffe99
All checks were successful
qa / qa (pull_request) Successful in 4m14s
qa / dockerfile (pull_request) Successful in 11s
2026-04-24 08:52:08 +00:00
Compare
code-lead deleted branch dev/292 2026-04-24 09:11:36 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
charles/claude-hooks!303
No description provided.