Expose tracked repos over the API so the dashboard can manage them. tireless-api
currently serves only /v1/health and /v1/ready.
Stage 1's done-when requires that a repo's schedule can be changed from the
dashboard without a redeploy, so this is not optional plumbing — it is the
reason the dashboard exists (design.md §7, stage 1).
Files
crates/tireless-api/src/main.rs — router wiring, state carrying the store
crates/tireless-api/src/routes/repo.rs — new; the handlers
crates/tireless-api/src/error.rs — new; map tireless_entities::Error to
status codes in one place rather than per handler
crates/tireless-api/Cargo.toml — add sqlx/pool wiring if needed
Steps
Build the Postgres pool at startup from Config::database_url() and put the
store in router state.
GET /v1/repos — list tracked repos.
POST /v1/repos — add one, taking forge, owner, repo, clone URL and default
branch. Reject a duplicate with 409 rather than a 500.
PATCH /v1/repos/:id — edit the schedule: interval, quiet window, enabled.
Clamp the interval with Poll::clamp server-side; a client must not be able
to poll faster than the floor.
DELETE /v1/repos/:id.
Make /v1/ready report the database as ok once a real round-trip succeeds,
replacing the not_implemented placeholder that is there now.
Return errors as JSON with a stable shape, not as bare strings.
A test shows PATCH with an interval below the floor stores the floor, not
the requested value.
A test shows adding the same repo twice yields 409.
curl -fsS localhost:23296/v1/ready reports database: "ok" against a live
database.
Out of scope
Job or run endpoints. Jobs arrive in stage 2, runs in stage 3.
Lane pause/resume and budget display. Stage 7.
Authentication. The dashboard is mesh-only with no multi-user model by design
(design.md §3.4); adding auth here would imply a second user, which is the
thing that must not exist.
The dashboard UI itself — a separate child.
Part of #1. Depends on: PgStore JobStore impl
## Goal
Expose tracked repos over the API so the dashboard can manage them. `tireless-api`
currently serves only `/v1/health` and `/v1/ready`.
Stage 1's done-when requires that a repo's schedule can be changed *from the
dashboard without a redeploy*, so this is not optional plumbing — it is the
reason the dashboard exists (design.md §7, stage 1).
## Files
- `crates/tireless-api/src/main.rs` — router wiring, state carrying the store
- `crates/tireless-api/src/routes/repo.rs` — new; the handlers
- `crates/tireless-api/src/error.rs` — new; map `tireless_entities::Error` to
status codes in one place rather than per handler
- `crates/tireless-api/Cargo.toml` — add sqlx/pool wiring if needed
## Steps
1. Build the Postgres pool at startup from `Config::database_url()` and put the
store in router state.
2. `GET /v1/repos` — list tracked repos.
3. `POST /v1/repos` — add one, taking forge, owner, repo, clone URL and default
branch. Reject a duplicate with `409` rather than a `500`.
4. `PATCH /v1/repos/:id` — edit the schedule: interval, quiet window, enabled.
Clamp the interval with `Poll::clamp` server-side; a client must not be able
to poll faster than the floor.
5. `DELETE /v1/repos/:id`.
6. Make `/v1/ready` report the database as `ok` once a real round-trip succeeds,
replacing the `not_implemented` placeholder that is there now.
7. Return errors as JSON with a stable shape, not as bare strings.
## Acceptance
- `cargo test --workspace`
- `cargo clippy --all-targets --all-features -- -D warnings`
- A test shows `PATCH` with an interval below the floor stores the floor, not
the requested value.
- A test shows adding the same repo twice yields `409`.
- `curl -fsS localhost:23296/v1/ready` reports `database: "ok"` against a live
database.
## Out of scope
- Job or run endpoints. Jobs arrive in stage 2, runs in stage 3.
- Lane pause/resume and budget display. Stage 7.
- Authentication. The dashboard is mesh-only with no multi-user model by design
(design.md §3.4); adding auth here would imply a second user, which is the
thing that must not exist.
- The dashboard UI itself — a separate child.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of #1. Depends on: PgStore JobStore impl
Goal
Expose tracked repos over the API so the dashboard can manage them.
tireless-apicurrently serves only
/v1/healthand/v1/ready.Stage 1's done-when requires that a repo's schedule can be changed from the
dashboard without a redeploy, so this is not optional plumbing — it is the
reason the dashboard exists (design.md §7, stage 1).
Files
crates/tireless-api/src/main.rs— router wiring, state carrying the storecrates/tireless-api/src/routes/repo.rs— new; the handlerscrates/tireless-api/src/error.rs— new; maptireless_entities::Errortostatus codes in one place rather than per handler
crates/tireless-api/Cargo.toml— add sqlx/pool wiring if neededSteps
Config::database_url()and put thestore in router state.
GET /v1/repos— list tracked repos.POST /v1/repos— add one, taking forge, owner, repo, clone URL and defaultbranch. Reject a duplicate with
409rather than a500.PATCH /v1/repos/:id— edit the schedule: interval, quiet window, enabled.Clamp the interval with
Poll::clampserver-side; a client must not be ableto poll faster than the floor.
DELETE /v1/repos/:id./v1/readyreport the database asokonce a real round-trip succeeds,replacing the
not_implementedplaceholder that is there now.Acceptance
cargo test --workspacecargo clippy --all-targets --all-features -- -D warningsPATCHwith an interval below the floor stores the floor, notthe requested value.
409.curl -fsS localhost:23296/v1/readyreportsdatabase: "ok"against a livedatabase.
Out of scope
(design.md §3.4); adding auth here would imply a second user, which is the
thing that must not exist.