T-DVLT-forge-port-interface-with-a-github-adapter
State: closed/done · Impact: high · Complexity: medium
pr-update and the prs tick both talk to GitHub directly today; the campaign is
GitHub-only. simple-dispatch-interfaces.html’s Forge section designs one pluggable
port (listPrs/getPr/postComment/updateBranch/parsePrUrl/prForBranch) so
a second forge is a new adapter, not a rewrite. This task builds the port and its
first (GitHub) adapter.
Approach
Section titled “Approach”- Define the
Forge/ForgePr/Activity/PrFactstypes per simple-dispatch-interfaces.html’s Forge section, keeping drift (behind/ahead) computed locally via easy-git rather than as a forge field — GitHub’smergeStateStatusneeds branch protection to populate, and Forgejo has no equivalent field at all.Activitythere now carriesidandeditedAtfields (added to close T-9Q4A’s signature-scheme gap) — bring those over too.ForgePrdeliberately has no base-commit-SHA field: a pr-update conflict’s base head comes from pr-update’s own localgit merge-treemeasurement (T-4AQN’s AC-3), not from the Forge port. - Implement the GitHub adapter over
@sksizer/easy-gh, so pr-update and classify depend on the port, not on easy-gh directly. - Keep
entrySurvives-style filtering (bots, self-notes, self-posted comments) outside the forge, applied once toactivityregardless of source. - Promote one PR-reference parser (URL, number,
owner/repo#N, or current-branch) fromsdlc pr reviewonto the port, per simple-dispatch-interfaces.html’s PR references section.
| Area | Note |
|---|---|
packages/ts/pr-update/ | Likely home for the port, alongside T-4AQN |
packages/ts/easy-gh | Consumed by the GitHub adapter, not modified |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: pr-update and
pr classifyboth read PR state through the Forge interface, with no direct@sksizer/easy-ghcall outside the GitHub adapter. - AC-2:
PrFacts.behind/aheadcome from local git, identically for a fixture GitHub PR. - AC-3: One PR-reference parser handles a URL, a bare number,
owner/repo#N, and “current branch” for every command that accepts a PR argument.
Out of scope
Section titled “Out of scope”- the Forgejo adapter itself (
T-G1NZ)
Dependencies
Section titled “Dependencies”T-4AQN(or proceeds in parallel, with T-4AQN switching to the port once merged)