Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

openbootdotdev/openboot-contract

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openboot-contract

Shared API contracts between openboot (Go CLI) and openboot.dev (SvelteKit server).

Why

The CLI is a binary on users' machines — it can't be updated instantly when the server changes. This repo defines the data shapes both sides agree on, and CI enforces they stay in sync.

Structure

schemas/          JSON Schema definitions (source of truth)
  remote-config.json    GET /:user/:slug/config response
  snapshot.json         POST /api/configs/from-snapshot body
  packages.json         GET /api/packages response
  auth.json             CLI device auth flow

fixtures/         Example payloads that match the schemas
  config-v1.json
  snapshot-v1.json

golden-path/      End-to-end validation scripts
  test.sh               Full golden path: curl|bash + CLI dry-run + doctor (5 steps)
  contract-smoke.sh     Schema validation + live API format checks only

How it works

  1. Contract changes → PR to this repo → CI validates schemas + fixtures
  2. On merge → CI triggers both consumer repos via repository_dispatch
  3. Consumer CI → clones this repo, validates their responses against schemas
  4. Any mismatch → CI fails → change must be coordinated across repos

Local usage

# Prerequisites
pip install jsonschema          # for schema validation
cd ../openboot && make build    # build the CLI binary

# Full golden path (curl|bash + CLI dry-run + doctor)
# Spins up a mock server automatically
./golden-path/test.sh

# Schema + API format checks only
./golden-path/contract-smoke.sh

# Against a running local server
SERVER_URL=http://localhost:5173 ./golden-path/test.sh

# Against production
SERVER_URL=https://openboot.dev ./golden-path/contract-smoke.sh

Rules

  • Only add fields, never remove — CLI binaries in the wild depend on existing fields
  • Schema changes require a PR — no direct pushes to main
  • Fixtures must always pass — if you change a schema, update fixtures to match

About

Shared API contracts between openboot CLI and openboot.dev

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.