Add runtime site config editing #46

Closed
opened 2026-05-22 09:25:56 -05:00 by erik · 2 comments
Owner

Goal

Allow site owners to update supported site configuration values at runtime through the Slugkit API and CLI. The OpenAPI document and CLI are the product path; an admin UI is only an example a site owner might build later and is out of scope for this slice.

Requirements

  • Build on DB-backed site configuration from task-6278792d.
  • Add authenticated API endpoints for reading and updating the smallest useful site configuration group.
  • Document the new API operations in the OpenAPI document.
  • Add slug CLI commands that use the API rather than editing local files or the database directly.
  • Validate inputs and return clear API/CLI errors.
  • Redact or avoid exposing secrets in output.
  • Keep the PR as a small vertical slice.

Acceptance criteria

  • A site owner can read supported site config through the Slugkit API.
  • A site owner can update a supported config value through the Slugkit API.
  • The OpenAPI document includes the site config read/update operations.
  • A site owner can read and update supported config through the slug CLI.
  • Updated config is visible through the public/manual test path.
  • Invalid config input returns clear API and CLI errors.
  • Tests cover successful API/CLI update and invalid input.
  • Relevant lint/test checks pass.

Dependencies

  • task-6278792d
## Goal Allow site owners to update supported site configuration values at runtime through the Slugkit API and CLI. The OpenAPI document and CLI are the product path; an admin UI is only an example a site owner might build later and is out of scope for this slice. ## Requirements - Build on DB-backed site configuration from `task-6278792d`. - Add authenticated API endpoints for reading and updating the smallest useful site configuration group. - Document the new API operations in the OpenAPI document. - Add `slug` CLI commands that use the API rather than editing local files or the database directly. - Validate inputs and return clear API/CLI errors. - Redact or avoid exposing secrets in output. - Keep the PR as a small vertical slice. ## Acceptance criteria - [ ] A site owner can read supported site config through the Slugkit API. - [ ] A site owner can update a supported config value through the Slugkit API. - [ ] The OpenAPI document includes the site config read/update operations. - [ ] A site owner can read and update supported config through the `slug` CLI. - [ ] Updated config is visible through the public/manual test path. - [ ] Invalid config input returns clear API and CLI errors. - [ ] Tests cover successful API/CLI update and invalid input. - [ ] Relevant lint/test checks pass. ## Dependencies - task-6278792d
Author
Owner

Synced from todu comment by @todu on 2026-05-22T22:54:46.618Z

PR Review: Approved

PR: #63

Summary

Reviewed PR #63 at commit 9cc7461. The PR delivers runtime site config editing through the Slugkit product path: authenticated API routes, OpenAPI contract, CLI commands using the API, tests, and docs.

Acceptance Criteria

  • A site owner can read supported site config through the Slugkit API.
  • A site owner can update a supported config value through the Slugkit API.
  • The OpenAPI document includes the site config read/update operations.
  • A site owner can read and update supported config through the slug CLI.
  • Updated config is visible through the public/manual test path.
  • Invalid config input returns clear API and CLI errors.
  • Tests cover successful API/CLI update and invalid input.
  • Relevant lint/test checks pass: make check, ./scripts/pre-pr.sh, and Forgejo CI passed.

Blocking Issues

None.

Warnings

None.

Verdict

Approved for merge after explicit human approval.

_Synced from todu comment by @todu on 2026-05-22T22:54:46.618Z_ ## PR Review: Approved PR: https://forge.caradoc.com/erik/slugkit/pulls/63 ### Summary Reviewed PR #63 at commit `9cc7461`. The PR delivers runtime site config editing through the Slugkit product path: authenticated API routes, OpenAPI contract, CLI commands using the API, tests, and docs. ### Acceptance Criteria - [x] A site owner can read supported site config through the Slugkit API. - [x] A site owner can update a supported config value through the Slugkit API. - [x] The OpenAPI document includes the site config read/update operations. - [x] A site owner can read and update supported config through the `slug` CLI. - [x] Updated config is visible through the public/manual test path. - [x] Invalid config input returns clear API and CLI errors. - [x] Tests cover successful API/CLI update and invalid input. - [x] Relevant lint/test checks pass: `make check`, `./scripts/pre-pr.sh`, and Forgejo CI passed. ### Blocking Issues None. ### Warnings None. ### Verdict Approved for merge after explicit human approval.
erik 2026-05-22 19:22:34 -05:00
Author
Owner

Synced from todu comment by @todu on 2026-05-23T00:17:52.319Z

Closing Summary

PR #63 merged: #63

Acceptance criteria evidence:

  • A site owner can read supported site config through the Slugkit API: met — GET /api/v1/site-config is implemented and tested.
  • A site owner can update a supported config value through the Slugkit API: met — PATCH /api/v1/site-config validates and persists supported fields through updateSiteConfig; API tests cover updates.
  • The OpenAPI document includes the site config read/update operations: met — /site-config GET/PATCH, operation IDs, and schemas are defined in template/site/src/api/openapi.ts and asserted in route tests.
  • A site owner can read and update supported config through the slug CLI: met — slug site config show and slug site config set <field> <value> call the API and are covered by CLI tests.
  • Updated config is visible through the public/manual test path: met — tests verify updated config appears on / and /api/v1/meta; manual smoke verified CLI update and metadata reflection.
  • Invalid config input returns clear API and CLI errors: met — API returns field-level 422 validation errors and CLI surfaces API validation messages.
  • Tests cover successful API/CLI update and invalid input: met — API and CLI tests cover success and invalid input paths.
  • Relevant lint/test checks pass: met — make check, ./scripts/pre-pr.sh, PR review, and Forgejo CI passed.

Readiness: READY

_Synced from todu comment by @todu on 2026-05-23T00:17:52.319Z_ ## Closing Summary PR #63 merged: https://forge.caradoc.com/erik/slugkit/pulls/63 Acceptance criteria evidence: - A site owner can read supported site config through the Slugkit API: met — `GET /api/v1/site-config` is implemented and tested. - A site owner can update a supported config value through the Slugkit API: met — `PATCH /api/v1/site-config` validates and persists supported fields through `updateSiteConfig`; API tests cover updates. - The OpenAPI document includes the site config read/update operations: met — `/site-config` GET/PATCH, operation IDs, and schemas are defined in `template/site/src/api/openapi.ts` and asserted in route tests. - A site owner can read and update supported config through the `slug` CLI: met — `slug site config show` and `slug site config set <field> <value>` call the API and are covered by CLI tests. - Updated config is visible through the public/manual test path: met — tests verify updated config appears on `/` and `/api/v1/meta`; manual smoke verified CLI update and metadata reflection. - Invalid config input returns clear API and CLI errors: met — API returns field-level 422 validation errors and CLI surfaces API validation messages. - Tests cover successful API/CLI update and invalid input: met — API and CLI tests cover success and invalid input paths. - Relevant lint/test checks pass: met — `make check`, `./scripts/pre-pr.sh`, PR review, and Forgejo CI passed. Readiness: READY
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit#46
No description provided.