Split site config into core and custom #81

Closed
opened 2026-06-01 12:43:37 -05:00 by caradoc · 2 comments
Collaborator

Goal

Redesign the site configuration API response and storage model so portable Slugkit settings are separated from site-specific extension settings.

Requirements

  • Change GET /api/v1/site-config to return a top-level core object and custom object inside data.
  • Move existing portable fields into core:
    • name
    • url
    • tagline
    • description
    • homepage.intro
    • homepage.body
  • Add custom as a site-specific key/value object.
  • Support JSON-compatible custom values, excluding secrets by documentation/convention:
    • string
    • number
    • boolean
    • null
    • arrays
    • objects
  • Update PATCH /api/v1/site-config so callers can update core, custom, or both.
  • Preserve validation for known core fields.
  • Validate custom as JSON-compatible data without enforcing project-specific keys.
  • Persist custom config in SQLite.
  • Update OpenAPI schemas to describe the core + custom shape.
  • Update tests and docs/specs for the new response and patch request shape.

Acceptance criteria

  • GET /api/v1/site-config returns { data: { core: ..., custom: ... } }.
  • Existing site config fields are available under data.core.
  • PATCH /api/v1/site-config can update core fields.
  • PATCH /api/v1/site-config can update custom key/value data.
  • Custom config persists across reads.
  • Invalid core fields still return validation errors.
  • OpenAPI documents the core + custom schema.
  • Relevant tests and checks pass.

Dependencies

  • None
## Goal Redesign the site configuration API response and storage model so portable Slugkit settings are separated from site-specific extension settings. ## Requirements - Change `GET /api/v1/site-config` to return a top-level `core` object and `custom` object inside `data`. - Move existing portable fields into `core`: - `name` - `url` - `tagline` - `description` - `homepage.intro` - `homepage.body` - Add `custom` as a site-specific key/value object. - Support JSON-compatible custom values, excluding secrets by documentation/convention: - string - number - boolean - null - arrays - objects - Update `PATCH /api/v1/site-config` so callers can update `core`, `custom`, or both. - Preserve validation for known `core` fields. - Validate `custom` as JSON-compatible data without enforcing project-specific keys. - Persist custom config in SQLite. - Update OpenAPI schemas to describe the `core + custom` shape. - Update tests and docs/specs for the new response and patch request shape. ## Acceptance criteria - [ ] `GET /api/v1/site-config` returns `{ data: { core: ..., custom: ... } }`. - [ ] Existing site config fields are available under `data.core`. - [ ] `PATCH /api/v1/site-config` can update `core` fields. - [ ] `PATCH /api/v1/site-config` can update `custom` key/value data. - [ ] Custom config persists across reads. - [ ] Invalid `core` fields still return validation errors. - [ ] OpenAPI documents the `core + custom` schema. - [ ] Relevant tests and checks pass. ## Dependencies - None
Owner

Synced from todu comment by @todu on 2026-06-02T17:28:05.897Z

PR review

PR #86 reviewed and approved.

Acceptance criteria: 8 total, 8 met, 0 missing.

Blocking issues: 0.

Warnings: 0.

Verification reviewed: targeted site-config/config/routes/migration tests passed, targeted CLI command tests passed, npm run typecheck passed, npm test passed, npm run lint passed, ./scripts/pre-pr.sh passed, and Forgejo CI is success for commit 8672148c7ca66b48690a90a296bc8c7b867a9e87.

Verdict: approved; waiting for explicit human merge approval.

_Synced from todu comment by @todu on 2026-06-02T17:28:05.897Z_ ## PR review PR #86 reviewed and approved. Acceptance criteria: 8 total, 8 met, 0 missing. Blocking issues: 0. Warnings: 0. Verification reviewed: targeted site-config/config/routes/migration tests passed, targeted CLI command tests passed, `npm run typecheck` passed, `npm test` passed, `npm run lint` passed, `./scripts/pre-pr.sh` passed, and Forgejo CI is `success` for commit `8672148c7ca66b48690a90a296bc8c7b867a9e87`. Verdict: approved; waiting for explicit human merge approval.
erik 2026-06-02 12:38:43 -05:00
Owner

Synced from todu comment by @todu on 2026-06-02T17:37:01.864Z

Close gate summary

Readiness: READY

Evidence:

  • PR #86 is merged into main; local main is at merge commit 95aad8c.
  • Current implementation returns site config as data.core plus data.custom, maps portable fields under core, accepts partial core and/or custom PATCH bodies, validates core/custom input, and persists custom JSON in SQLite site_config.custom_json.
  • OpenAPI and docs describe the core + custom response/request shape and JSON-compatible custom values.
  • Existing reviewed verification reported: targeted site-config/config/routes/migration tests passed, targeted CLI command tests passed, npm run typecheck passed, npm test passed, npm run lint passed, ./scripts/pre-pr.sh passed, and Forgejo CI was success for commit 8672148c7ca66b48690a90a296bc8c7b867a9e87.

All 8 acceptance criteria are met. Task closed.

_Synced from todu comment by @todu on 2026-06-02T17:37:01.864Z_ ## Close gate summary Readiness: READY Evidence: - PR #86 is merged into `main`; local `main` is at merge commit `95aad8c`. - Current implementation returns site config as `data.core` plus `data.custom`, maps portable fields under `core`, accepts partial `core` and/or `custom` PATCH bodies, validates core/custom input, and persists custom JSON in SQLite `site_config.custom_json`. - OpenAPI and docs describe the `core + custom` response/request shape and JSON-compatible custom values. - Existing reviewed verification reported: targeted site-config/config/routes/migration tests passed, targeted CLI command tests passed, `npm run typecheck` passed, `npm test` passed, `npm run lint` passed, `./scripts/pre-pr.sh` passed, and Forgejo CI was `success` for commit `8672148c7ca66b48690a90a296bc8c7b867a9e87`. All 8 acceptance criteria are met. Task closed.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#81
No description provided.