← all adapters

github-style

simulates GitHub REST + GraphQL API 2022-11-28

restadapter v0.2.026 routes

verification

SDKverified with go-github/v89 v89.0.0verified with octokit 5.0.5 (floor)· surface 26 · not implemented 7 · differs 4

use it

# add to stunt.yaml
services:
  github:
    adapter: embedded:github-style

# then
$ stunt up

The embedded: source extracts this adapter from the binary — no git clone, fully offline.

how to mock the GitHub REST + GraphQL API locally

Install stunt, paste the service block above into stunt.yaml, run stunt up — then point your client at localhost instead of GitHub REST + GraphQL API. It works offline, keeps state across requests and restarts, and every response is synthetic: the route shapes, status codes, pagination, and webhook delivery follow the real GitHub REST + GraphQL API 2022-11-28 surface — the data is fake, the behavior is real.

backing stores

issuespullshooksrunsreviewsinstallation_tokens

api surface (26)

generated from the adapter manifest — exactly what boots, nothing more · covers 2% of the real API's 998 routes (derived from sdk octokit @ 5.0.5 (floor))

26 routes · graphql
GET/app
GET/app/installations
POST/app/installations/{installation_id}/access_tokens
GET/installation
GET/repos/{owner}/{repo}
GET/repos/{owner}/{repo}/issues
POST/repos/{owner}/{repo}/issues
GET/repos/{owner}/{repo}/issues/{issue_number}
PATCH/repos/{owner}/{repo}/issues/{issue_number}
GET/repos/{owner}/{repo}/issues/{issue_number}/comments
POST/repos/{owner}/{repo}/issues/{issue_number}/comments
POST/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}
DELETE/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}
GET/repos/{owner}/{repo}/issues/{issue_number}/events
GET/repos/{owner}/{repo}/pulls
POST/repos/{owner}/{repo}/pulls
GET/repos/{owner}/{repo}/pulls/{pull_number}
PATCH/repos/{owner}/{repo}/pulls/{pull_number}
PUT/repos/{owner}/{repo}/pulls/{pull_number}/merge
GET/repos/{owner}/{repo}/pulls/{pull_number}/reviews
POST/repos/{owner}/{repo}/pulls/{pull_number}/reviews
POST/repos/{owner}/{repo}/dispatches
GET/repos/{owner}/{repo}/actions/runs
GET/repos/{owner}/{repo}/actions/runs/{run_id}
POST/repos/{owner}/{repo}/hooks
POST/webhooks/receive

SDK-verified behaviors (6)

  • Issues.Create x5 (number assignment)
  • Issues.ListByRepo walks Link headers across pages
  • Issues.CreateComment
  • Issues.ListComments round-trip
  • Issues.Edit state transition
  • issue CRUD + paginate over Link headers

Not implemented (7)

  • No X-Hub-Signature (SHA-1) or X-GitHub-Delivery UUID webhook headers
  • No users, orgs, teams, or search endpoints
  • No git data, contents, branches, or releases endpoints
  • No PR review comments, files, or requested_reviewers endpoints
  • No actions workflows, jobs, artifacts, or logs endpoints
  • No webhook list/patch/delete or deliveries endpoints
  • No GraphQL nodes or mutations beyond viewer, repository, issues, pulls

Differs from the real API (4)

  • POST /graphql served without the REST Bearer/PAT check (transport lacks auth hook)
  • App JWT RS256 signature not verified; the credential store is the check
  • Webhook body is a stunt {type, payload} envelope, not GitHub's bare event body
  • Runs advance on fixed clock (queued+1s, in_progress+3s); dispatch takes simulate_fail
want more of the GitHub REST + GraphQL API surface? adapters are YAML + Starlark — the authoring guide covers adding routes, fixtures, and state machines. Open an issue for anything big first, or just file a PR — merged routes ship in the next release.

case study