feat(api): POST /service-config/reset-defaults #944

Merged
dev merged 1 commit from dev/937 into main 2026-05-08 09:17:53 +00:00
Collaborator

Adds POST /api/service-config/reset-defaults (admin-gated) that overwrites the scope='global' row with SERVICE_CONFIG_DEFAULTS. Optional fields?: string[] body limits the reset to specific columns. Writes a config_revision row with the prior row as snapshot and returns the new global row.

Also adds janitor_json to the handler's raw type and SELECT (was missing), and exports postServiceConfigReset from the web API client.

Closes #937

Test plan

  • 4 unit tests covering: full reset, partial reset (fields: ['watchdogs_json']), INSERT path (no prior global row), unknown field → 400
  • just qa (server typecheck + Biome) clean
Adds `POST /api/service-config/reset-defaults` (admin-gated) that overwrites the `scope='global'` row with `SERVICE_CONFIG_DEFAULTS`. Optional `fields?: string[]` body limits the reset to specific columns. Writes a `config_revision` row with the prior row as snapshot and returns the new global row. Also adds `janitor_json` to the handler's raw type and SELECT (was missing), and exports `postServiceConfigReset` from the web API client. Closes #937 ## Test plan - 4 unit tests covering: full reset, partial reset (`fields: ['watchdogs_json']`), INSERT path (no prior global row), unknown field → 400 - `just qa` (server typecheck + Biome) clean
dev self-assigned this 2026-05-08 09:08:21 +00:00
feat(api): POST /service-config/reset-defaults
All checks were successful
qa / dockerfile (pull_request) Successful in 11s
qa / db-schema (pull_request) Successful in 16s
qa / i18n-string-check (pull_request) Successful in 16s
qa / sql-layer-check (pull_request) Successful in 8s
qa / qa-1 (pull_request) Successful in 1m53s
qa / qa (pull_request) Successful in 0s
f5ce29712c
Adds reset-to-factory-defaults endpoint for the service-config
dashboard. Supports full and partial (fields:[]) resets, writes a
config_revision snapshot of the prior row, and returns the new
global row. Wires the handler in main.ts and exports
postServiceConfigReset from the web API client.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dev requested review from reviewer 2026-05-08 09:11:24 +00:00
reviewer approved these changes 2026-05-08 09:12:19 +00:00
reviewer left a comment

CI green. Logic correct — snapshot-before-write, exhaustive column switch, admin-gated, 4 tests cover all paths. janitor_json omission fix is a good bonus. Nit: INSERT path ignores columns and always writes all defaults, but that's the only sane behaviour when creating a row from scratch.

CI green. Logic correct — snapshot-before-write, exhaustive column switch, admin-gated, 4 tests cover all paths. `janitor_json` omission fix is a good bonus. Nit: INSERT path ignores `columns` and always writes all defaults, but that's the only sane behaviour when creating a row from scratch.
Collaborator

PR has conflicts — please rebase on main before merging.

PR has conflicts — please rebase on main before merging.
dev force-pushed dev/937 from f5ce29712c
All checks were successful
qa / dockerfile (pull_request) Successful in 11s
qa / db-schema (pull_request) Successful in 16s
qa / i18n-string-check (pull_request) Successful in 16s
qa / sql-layer-check (pull_request) Successful in 8s
qa / qa-1 (pull_request) Successful in 1m53s
qa / qa (pull_request) Successful in 0s
to 1121a99732
All checks were successful
qa / sql-layer-check (pull_request) Successful in 8s
qa / dockerfile (pull_request) Successful in 9s
qa / i18n-string-check (pull_request) Successful in 11s
qa / db-schema (pull_request) Successful in 40s
qa / qa-1 (pull_request) Successful in 1m25s
qa / qa (pull_request) Successful in 0s
2026-05-08 09:14:50 +00:00
Compare
dev merged commit 73bd1ec51b into main 2026-05-08 09:17:53 +00:00
Sign in to join this conversation.
No reviewers
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
charles/claude-hooks!944
No description provided.