Add VCS abstraction layer for GitHub support #76

Closed
opened 2026-05-11 15:52:03 +00:00 by rodin · 1 comment
Owner

Summary

Abstract VCS operations behind an interface to support both Gitea and GitHub APIs.

Context

PR #75 adds .github/ workflows and env var fallbacks, but the gitea/ package is hardcoded to Gitea API endpoints.

Proposed Design

  • vcs.Client interface with common operations (GetPullRequest, PostReview, etc.)
  • vcs/gitea.go adapter wrapping existing gitea.Client
  • vcs/github.go adapter for GitHub REST API
  • Runtime detection via URL (github.com/GHE → GitHub, else Gitea)

API Differences to Handle

Feature Gitea GitHub
API prefix /api/v1/ /api/v3/ or api.github.com
Get diff /pulls/{n}.diff Accept: application/vnd.github.diff
Timeline /issues/{n}/timeline events API
Resolve comment /pulls/comments/{id}/resolve Different mechanism

Iteration

  1. PR #75 — .github/ + env vars (done)
  2. This issue — vcs/ abstraction
  3. Implement GitHub adapter methods
## Summary Abstract VCS operations behind an interface to support both Gitea and GitHub APIs. ## Context PR #75 adds `.github/` workflows and env var fallbacks, but the `gitea/` package is hardcoded to Gitea API endpoints. ## Proposed Design - `vcs.Client` interface with common operations (GetPullRequest, PostReview, etc.) - `vcs/gitea.go` adapter wrapping existing `gitea.Client` - `vcs/github.go` adapter for GitHub REST API - Runtime detection via URL (github.com/GHE → GitHub, else Gitea) ## API Differences to Handle | Feature | Gitea | GitHub | |---------|-------|--------| | API prefix | `/api/v1/` | `/api/v3/` or api.github.com | | Get diff | `/pulls/{n}.diff` | Accept: application/vnd.github.diff | | Timeline | `/issues/{n}/timeline` | events API | | Resolve comment | `/pulls/comments/{id}/resolve` | Different mechanism | ## Iteration 1. PR #75 — .github/ + env vars (done) 2. This issue — vcs/ abstraction 3. Implement GitHub adapter methods
Author
Owner

Superseded by a more detailed execution plan with a canonical architecture document:

  • #78 — Phase 1: extract interfaces + types from gitea/
  • #79 — Phase 2: Gitea adapter with diff-position translation
  • #80 — Phase 3: GitHub PRReader + FileReader
  • #81 — Phase 4: GitHub Reviewer + Identity
  • #82 — Phase 5: wire --provider and --base-url into CLI

Note: runtime URL detection (proposed here) was replaced by an explicit --provider github|gitea flag.

Architecture reference: docs/DESIGN-vcs-abstraction.md on feature/github-support.

Superseded by a more detailed execution plan with a canonical architecture document: - #78 — Phase 1: extract interfaces + types from gitea/ - #79 — Phase 2: Gitea adapter with diff-position translation - #80 — Phase 3: GitHub PRReader + FileReader - #81 — Phase 4: GitHub Reviewer + Identity - #82 — Phase 5: wire --provider and --base-url into CLI Note: runtime URL detection (proposed here) was replaced by an explicit `--provider github|gitea` flag. Architecture reference: `docs/DESIGN-vcs-abstraction.md` on `feature/github-support`.
rodin closed this issue 2026-05-12 17:16:29 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rodin/review-bot#76