Skip to content

feat: github rest client for dataset proposals - #383

Merged
Scr4tch587 merged 21 commits into
kai/react-specfrom
kai/github-client
Jul 28, 2026
Merged

feat: github rest client for dataset proposals#383
Scr4tch587 merged 21 commits into
kai/react-specfrom
kai/github-client

Conversation

@Scr4tch587

Copy link
Copy Markdown
Collaborator

What changed

New `core/github/` package: a minimal GitHub REST client (`GitHubClient`) used by the upcoming dataset-proposal endpoint to open PRs with a bot token. Methods:

  • `get_branch_sha` / `commit_files_to_new_branch`: commits a set of files as a single commit on a new branch via the git data API (tree → commit → ref)
  • `create_pull` + `request_reviewers`: opens the PR and requests reviewers best-effort — the PR author is filtered out (GitHub refuses author-as-reviewer), and if a batch request fails (e.g. one login isn't a collaborator) each reviewer is retried individually so one bad entry can't drop the rest; failures log warnings and never fail the flow
  • `open_pr_with_files`: the one-call orchestration the service layer uses
  • errors surface as `GitHubError` (carries HTTP status); an existing proposal branch raises the `BranchAlreadyExistsError` subclass (422 "already exists")
  • config from env: `GITHUB_TOKEN` (required), `GITHUB_REPO`, `GITHUB_API_URL` (override used to e2e-test against a local fake GitHub)

Built on `requests` (already a production dependency). Tests mock at the transport-adapter layer — no network.

Why

Dataset creation is being added as a PR-based flow: submissions become pull requests so code review stays the gate for anything that executes on the server (per the trust model in SPEC-backend). This client is the transport for that. First PR of the dataset-creation stack (on top of the react migration stack).

Benefit

One clean commit per proposal, reviewer auto-assignment that degrades gracefully, and a client that's fully testable offline.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
docs: document dataset proposal flow in specs
Scr4tch587 and others added 5 commits July 27, 2026 22:11
…ordances

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
feat: api client support for dataset proposals
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
feat: dataset proposal service and endpoint
@Scr4tch587
Scr4tch587 merged commit 2f66f42 into kai/react-spec Jul 28, 2026
5 checks passed
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.

2 participants