Skip to content

runners: Octokit JS (OCT-1–11), Python (PY-1–15), Octokit.rb (RB-1–8) - #3

Open
tamnd wants to merge 1 commit into
mainfrom
feat/runners-scripted
Open

runners: Octokit JS (OCT-1–11), Python (PY-1–15), Octokit.rb (RB-1–8)#3
tamnd wants to merge 1 commit into
mainfrom
feat/runners-scripted

Conversation

@tamnd

@tamnd tamnd commented Jun 10, 2026

Copy link
Copy Markdown
Owner

What

Three scripted-language runners covering 34 gates across the JS, Python, and Ruby ecosystems.

Octokit JS (runners/js/octokit_test.mjs)

ES module, Node.js 22. Pinned: @octokit/rest 21.1.0, @octokit/graphql, @octokit/auth-app, @octokit/webhooks.

Key quirks handled:

  • baseUrl: "https://HOST/api/v3" (no trailing slash — @octokit/rest)
  • baseUrl: "https://HOST/api" for graphql (it appends /graphql)
  • 304 detection: @octokit/rest throws on 304, catch checks e.status === 304
  • GITHUB_API_URL / GITHUB_GRAPHQL_URL env vars for @actions/github compat
  • App installation token via @octokit/auth-app + createAppAuth

Python (runners/python/pygithub_test.py)

Python 3.13. Pinned via requirements.txt.

Key quirks handled:

  • PyGitHub: base_url="https://HOST/api/v3" (no trailing slash)
  • gidgethub: base_url requires trailing slash (https://HOST/api/v3/)
  • github3.py: GitHubEnterprise(url="https://HOST") (host root, no /api/v3)
  • GitPython: injects token into clone URL as https://x-token:TOKEN@HOST/...
  • ghapi: GhApi(token=TOKEN, gh_host=HOST)

Octokit.rb (runners/ruby/octokit_rb_test.rb)

Ruby 3.4, bundler. Pinned: octokit 9.2.0.

Key quirks handled:

  • api_endpoint: "https://HOST/api/v3/"trailing slash required
    (Octokit.rb uses URI.join, omitting the slash mangles the URL)
  • auto_paginate: true creates a second client to avoid polluting the fixture
  • Webhook + hook cleanup in RB-7

Running locally

make run-js      # OCT-1 through OCT-11
make run-python  # PY-1 through PY-15
make run-ruby    # RB-1 through RB-8

runners/js/octokit_test.mjs:
  - @octokit/rest 21.1.0 — users, repos, paginate, issues, rate-limit, ETag/304
  - @octokit/graphql — viewer, repository queries
  - @octokit/webhooks — HMAC signature verification
  - @octokit/auth-app — GitHub App installation token (skipped if no app creds)
  - GITHUB_API_URL / GITHUB_GRAPHQL_URL env var recognition
  baseUrl: "https://HOST/api/v3" (no trailing slash)
  graphql baseUrl: "https://HOST/api" (appends /graphql internally)

runners/python/pygithub_test.py:
  - PyGitHub 2.5.0 — base_url="https://HOST/api/v3"
  - All repo/issue/label/PR/rate-limit operations
  - ghapi — GhApi(gh_host=HOST)
  - gidgethub — base_url requires trailing slash
  - GitPython — Repo.clone_from() via HTTPS with token in URL
  - github3.py — GitHubEnterprise(url="https://HOST")

runners/ruby/octokit_rb_test.rb:
  - octokit.rb 9.2.0 — api_endpoint "https://HOST/api/v3/" (trailing slash)
  - user, repo, issues, create/close issue, rate_limit, pull_requests
  - create_hook + delete (cleanup)
  - auto_paginate: true round-trip
@tamnd
tamnd force-pushed the feat/runners-scripted branch from 132f8a0 to 1943462 Compare June 10, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant