Skip to content

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.

  1. Define the Forge/ForgePr/Activity/PrFacts types per simple-dispatch-interfaces.html’s Forge section, keeping drift (behind/ahead) computed locally via easy-git rather than as a forge field — GitHub’s mergeStateStatus needs branch protection to populate, and Forgejo has no equivalent field at all. Activity there now carries id and editedAt fields (added to close T-9Q4A’s signature-scheme gap) — bring those over too. ForgePr deliberately has no base-commit-SHA field: a pr-update conflict’s base head comes from pr-update’s own local git merge-tree measurement (T-4AQN’s AC-3), not from the Forge port.
  2. Implement the GitHub adapter over @sksizer/easy-gh, so pr-update and classify depend on the port, not on easy-gh directly.
  3. Keep entrySurvives-style filtering (bots, self-notes, self-posted comments) outside the forge, applied once to activity regardless of source.
  4. Promote one PR-reference parser (URL, number, owner/repo#N, or current-branch) from sdlc pr review onto the port, per simple-dispatch-interfaces.html’s PR references section.
AreaNote
packages/ts/pr-update/Likely home for the port, alongside T-4AQN
packages/ts/easy-ghConsumed by the GitHub adapter, not modified
  • AC-1: pr-update and pr classify both read PR state through the Forge interface, with no direct @sksizer/easy-gh call outside the GitHub adapter.
  • AC-2: PrFacts.behind/ahead come 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.
  • the Forgejo adapter itself (T-G1NZ)
  • T-4AQN (or proceeds in parallel, with T-4AQN switching to the port once merged)

← Back to Tasks