Skip to content
Source
Sign inSign up
pingdotgg/t3code

refactor(server): GitHub services are named for the API they call, not gh #16967

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/16967/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

GitHubPullRequestCli 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 GitHubPullRequestCli to GitHubPullRequestApi and GitHubCli to GitHubRepositoryApi. This covers the files, services, layers and service keys, plus the repository errors: GitHubRepository{Unavailable,Authentication,RateLimit,Command}Error and GitHubRepositoryApiError.
  • Removed command: "gh" from those errors. SourceControlProviderError.command is optional in contracts, so GitHub errors now leave it out. GitManager only logs providerCommand when a command is set, instead of logging "unknown".
  • Kept GitLabPullRequestCli and AzureDevOpsPullRequestCli: they really do run glab and az. Also kept GitHubCliMissingError and GitHubCliFailedError, which are about the real gh auth token call.

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

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. juliusmarminge added labelsmacroscope-review

    4. Approvability

      Verdict: Approved at 1c8a6c8

      Macroscope'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).
    5. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages110 (0.0%)8✅

      Baseline: 7ac5ec6 · PR result: 1c8a6c8 · Source CI: success

      Scenario 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.

    6. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      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.ts
      • apps/server/scripts/measure-pr-preview.ts
      • apps/server/src/git/GitManager.test.ts
      • apps/server/src/git/GitManager.ts
      • apps/server/src/orchestration-v2/ThreadPullRequestService.ts
      • apps/server/src/pullRequest/GitHubPullRequestApi.test.ts
      • apps/server/src/pullRequest/GitHubPullRequestApi.ts
      • apps/server/src/pullRequest/GitHubPullRequestProvider.test.ts
      • apps/server/src/pullRequest/GitHubPullRequestProvider.ts
      • apps/server/src/pullRequest/PullRequestProviderRegistry.ts
      • apps/server/src/pullRequest/PullRequestService.ts
      • apps/server/src/pullRequest/gitHubConditionalChecks.ts
      • apps/server/src/server.ts
      • apps/server/src/sourceControl/GitHubRepositoryApi.test.ts
      • apps/server/src/sourceControl/GitHubRepositoryApi.ts
      • apps/server/src/sourceControl/GitHubSourceControlProvider.test.ts
      • apps/server/src/sourceControl/GitHubSourceControlProvider.ts
      • apps/server/src/sourceControl/SourceControlDiscovery.test.ts
      • apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts
      • apps/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 gh command 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.ts
      The repository service and error types use API names. Error schemas omit the gh command 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.ts
      The pull-request service and error union use API names. Error schemas omit the gh command 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.ts
      Test fakes and scenarios use repository API types and errors. Error logging omits providerCommand when no command is defined.

      Priority: ⬇️ Low

      Estimated code review effort: 3 (Moderate) | ~25 minutes

      Change: Refactor

      Suggested reviewers: maria-rcks

      Merge Risk: ⚪ Minimal · up to 1c8a6

      This 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 nameStatusExplanation
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Title check✅ PassedThe title clearly summarizes the main change: renaming GitHub services to reflect their HTTP API usage instead of the gh CLI.
      Description check✅ PassedThe 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.
    7. juliusmarminge merged this08b1222

    8. juliusmarminge closed this

Sign in to join this conversation.