CopilotKit / CopilotKit/outpost

Extract shared buildAppOctokit() helper (dedupe 3 copies of App-auth Octokit construction)

Open
#114 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: integrations roadmap roadmap: later
Dominant language
TypeScript
Stars
7
Forks
3
Avg merge
7d 16h
Merged PRs (30d)
15

Description

Follow-up from PR #113 review (nit #2).

The App-authenticated Octokit construction now exists in three places:

  • packages/outpost/shared/src/platforms/github.ts (GitHubAdapter.getOctokit, added in #113)
  • packages/outpost/shared/src/integrations/github-client.ts
  • apps/github-app/src/lib/github-client.ts

All three do essentially:

new Octokit({ authStrategy: createAppAuth, auth: { appId, privateKey, installationId } })

Proposed

Extract a shared buildAppOctokit(creds) helper (e.g. in packages/outpost/shared) and have all three call sites use it. Normalize the installationId type while doing so — it's number in the platform adapter vs string in the other two builders (nit #3; createAppAuth tolerates both, but a single helper should pick one).

Not urgent

Each copy uses a slightly different minimal Octokit interface, so this is a cleanup/DRY task, not a bug. Defer-friendly.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the three construction sites in packages/outpost/shared/src/platforms/github.ts, packages/outpost/shared/src/integrations/github-client.ts, and apps/github-app/src/lib/github-client.ts, then inspect how shared code is organized. Done means the three sites use one shared buildAppOctokit helper and the installationId type is consistent across them.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, typescript
Domain
api, backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.