Skip to content

Move interactive PR/issue ops from gh CLI onto electron/github.js (#1528 follow-up) #1534

Closed

Description

@currentbits

Part 3 of #1528. So far only the background refresher (refreshPrStates in electron/worktrees.js) uses the API transport. It sends one GraphQL query per repo and falls back to gh per thread.

Still on gh (roughly 40 call sites):

  • worktrees.js: pr create/view/list/checks/merge/checkout
  • prWorkspace.js: view/edit/comment/close/ready/merge
  • issues.js: issue view/list/edit/reopen/close/comment/create

Rules for the migration:

  • Keep gh as the fallback when fetchPrStates/graphql throws, the way the refresher does.
  • Every write that sends text (PR title/body, comments, issue bodies) must go through assertNoOutboundSecrets before the request, as the gh path does today.
  • GHE: github.parseRemote accepts any host and graphqlUrl maps non-github.com hosts to https://<host>/api/graphql. isGitHubRemote (github.com only) still gates the gh paths.
  • Tests: inject fetchFn/fetchPrStatesFn. When CODER_GH_BIN is set, the refresher turns the API path off so gh-fake suites never touch the network. Keep that guarantee.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions