Skip to content

feat(server): add the HTTP API and the client SDK - #121

Open
PiquelChips wants to merge 1 commit into
feat/server-eventsfrom
feat/server-http
Open

PiquelChips wants to merge 1 commit into
feat/server-eventsfrom
feat/server-http

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

OriginService answers in-process only. Agents, CI runners and other machines need to reach a repository over the network, and from any language.

HTTP API: each route only translates a request into a service call on the repository it names, on the blocking thread pool, and renders a ServiceError as an ApiError with the matching status. This first part lists the server's repositories, fetches and puts records as packs, and lists targets and a target's log. Repositories holds the repositories a server hosts, by name.

OpenAPI: every route is documented with utoipa. The server serves the document, docs/openapi.json keeps a copy, and a test fails while it's stale (just openapi rewrites it).

SDK: origin-client is a hand-written SDK: each endpoint is one line of its endpoints! macro, over the origin-shared types, and no reqwest type is exposed. The HTTP tests drive every SDK method against a real server.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 916309bd-bb1a-4fa0-a13f-521db1459e18
Commits

Reviewing files that changed from the base of the PR and between 36d95ad and 0686170.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 13

  • AGENTS.md
  • Cargo.toml
  • apps/origin-src/Cargo.toml
  • apps/origin-src/src/http.rs
  • apps/origin-src/src/lib.rs
  • apps/origin-src/src/server.rs
  • apps/origin-src/src/service.rs
  • apps/origin-src/tests/http.rs
  • crates/origin-client/Cargo.toml
  • crates/origin-client/src/lib.rs
  • deny.toml
  • docs/openapi.json
  • justfile
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips force-pushed the feat/server-http branch 2 times, most recently from e1efacb to 83a95db Compare November 22, 2026 16:40
`OriginService` only answered in-process. Agents, CI runners and other
machines need to reach a repository over the network, and from any
language.

The HTTP API, under `/api/v1`, is a thin layer: each route translates a
request into a service call on the repository it names, run on the
blocking thread pool since calls do synchronous file system work, and
renders a `ServiceError` as an `ApiError` with the matching status.
This first part lists the server's repositories, fetches and puts
records as packs, and lists targets and a target's log. `Repositories`
holds the repositories a server hosts, by name.

Every route is documented with utoipa. The server serves the OpenAPI
document, `docs/openapi.json` keeps a copy for other languages, and a
test fails while it's stale: `just openapi` rewrites it.

`origin-client` is the Rust SDK, written by hand: each endpoint is one
line of its `endpoints!` macro, over the `origin-shared` types the
server uses, so the two cannot disagree on a contract, and no reqwest
type is exposed. The HTTP tests drive every SDK method against a real
server.
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