refactor(server): GitHub services are named for the API they call, not gh #16967
main fromrefs/pull/16967/head·merged by juliusmarminge View on GitHubGitHubPullRequestCli and GitHubCli haven't run the gh CLI since #16319–#16321 moved them onto GitHub's HTTP API. gh now only hands over a token, but the names, and a command: "gh" field on every error, still pointed at a CLI that never ran.
- Renamed
GitHubPullRequestClitoGitHubPullRequestApiandGitHubClitoGitHubRepositoryApi. This covers the files, services, layers and service keys, plus the repository errors:GitHubRepository{Unavailable,Authentication,RateLimit,Command}ErrorandGitHubRepositoryApiError. - Removed
command: "gh"from those errors.SourceControlProviderError.commandis optional in contracts, so GitHub errors now leave it out.GitManageronly logsproviderCommandwhen a command is set, instead of logging"unknown". - Kept
GitLabPullRequestCliandAzureDevOpsPullRequestCli: they really do runglabandaz. Also keptGitHubCliMissingErrorandGitHubCliFailedError, which are about the realgh auth tokencall.
Only names change; behaviour is the same. apps/server typecheck is clean, and the 1,242 tests across src/pullRequest, src/sourceControl, src/git and VcsProcess pass.
Bottom of a stack; #16960 builds on it.
🤖 Generated with Claude Code (Claude Opus 5.5, in T3 Code)
- 1
juliusmarminge changed the title
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
juliusmarminge added labelsmacroscope-review
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
Approvability#
Verdict: Approved at
1c8a6c8Macroscope's review found this PR approvable — This PR consistently renames GitHub services to reflect their REST/GraphQL API implementation while preserving their runtime behavior and updating all wiring and tests. The only behavioral difference is a narrow cleanup of misleading optional error/log metadata.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 0 (0.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅ Claude Live turn messages 1 1 0 (0.0%) 8 ✅ Baseline:
7ac5ec6· PR result:1c8a6c8· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
5844f6d3-73fb-4280-abb6-6b813b06e3d9
📥 Commits
Reviewing files that changed from the base of the PR and between 7ac5ec6b15593f5b682fe73b483bc8e24de76665 and 1c8a6c888cc17c9a85e6c9de8d0e19db05c94cef.
📒 Files selected for processing (20)
apps/server/scripts/evaluate-thread-titles.tsapps/server/scripts/measure-pr-preview.tsapps/server/src/git/GitManager.test.tsapps/server/src/git/GitManager.tsapps/server/src/orchestration-v2/ThreadPullRequestService.tsapps/server/src/pullRequest/GitHubPullRequestApi.test.tsapps/server/src/pullRequest/GitHubPullRequestApi.tsapps/server/src/pullRequest/GitHubPullRequestProvider.test.tsapps/server/src/pullRequest/GitHubPullRequestProvider.tsapps/server/src/pullRequest/PullRequestProviderRegistry.tsapps/server/src/pullRequest/PullRequestService.tsapps/server/src/pullRequest/gitHubConditionalChecks.tsapps/server/src/server.tsapps/server/src/sourceControl/GitHubRepositoryApi.test.tsapps/server/src/sourceControl/GitHubRepositoryApi.tsapps/server/src/sourceControl/GitHubSourceControlProvider.test.tsapps/server/src/sourceControl/GitHubSourceControlProvider.tsapps/server/src/sourceControl/SourceControlDiscovery.test.tsapps/server/src/sourceControl/SourceControlProviderRegistry.test.tsapps/server/src/ws.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
📝 Walkthrough
Walkthrough#
This change renames GitHub repository and pull-request services and errors from CLI terminology to API terminology. It updates provider wiring, runtime layers, scripts, and tests to use the renamed services. Error schemas and provider mappings no longer include the
ghcommand field.Changes#
GitHub API service migration
Layer / File(s) Summary Repository API service and errors
apps/server/src/sourceControl/GitHubRepositoryApi.ts,apps/server/src/sourceControl/GitHubRepositoryApi.test.tsThe repository service and error types use API names. Error schemas omit the ghcommand field. Repository operation mappings and behavior remain unchanged.Pull-request API service and errors
apps/server/src/pullRequest/GitHubPullRequestApi.ts,apps/server/src/pullRequest/GitHubPullRequestApi.test.tsThe pull-request service and error union use API names. Error schemas omit the ghcommand field. Existing operation logic and test scenarios remain in place.Provider, runtime, and script wiring
apps/server/src/sourceControl/*,apps/server/src/pullRequest/*,apps/server/src/server.ts,apps/server/src/ws.ts,apps/server/scripts/*Providers, registries, runtime layers, and scripts use the renamed API services. Provider error mappings no longer copy the command field. GitManager consumer and logging
apps/server/src/git/GitManager.ts,apps/server/src/git/GitManager.test.tsTest fakes and scenarios use repository API types and errors. Error logging omits providerCommandwhen no command is defined.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Refactor
Suggested reviewers:
maria-rcksMerge Risk: ⚪ Minimal · up to
1c8a6This refactor renames GitHub services and errors to match the HTTP API they call. Behavior is unchanged, and no merge-blocking risk was identified.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. Title check ✅ Passed The title clearly summarizes the main change: renaming GitHub services to reflect their HTTP API usage instead of the gh CLI. Description check ✅ Passed The description explains the problem, the refactoring changes, preserved behavior, verification results, retained CLI-specific names, and stack context. It does not use the template headings or provid… ✨ Finishing Touches
📝 Generate docstrings
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
- Commit to this branch
- Create a new PR
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.juliusmarminge merged this08b1222
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes