3.5 KiB
3.5 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 03-auto-merge-settings | Persist automatic merge setting | completed | 3 |
|
plan.md | ../../specs/ui/requirements/message-queue-auto-merge.md |
Task 03: Persist automatic merge setting
Acceptance
- Message Queue settings GET/PATCH include
auto_merge_enabledin configured and effective values; default and legacy-missing values are true, explicit false persists, and partial patches preserve capacity and manual merge. - Persistence completes before live apply, an environment capacity lock does not block an auto-only update or lose its effective live capacity, and backend startup applies the resolved values before new admissions.
- Store, resolver, service, HTTP route, and backend wiring tests cover fresh, legacy, restart, invalid-record fallback, partial update, explicit false, live apply, and environment-lock cases.
Verification
cd apps/backend && go test -count=1 ./internal/system/queuesettings ./internal/system ./internal/backendapp
cd apps/backend && go test -race -count=1 ./internal/system/queuesettings ./internal/orchestrator/messagequeue
Files likely touched
apps/backend/internal/system/queuesettings/types.goapps/backend/internal/system/queuesettings/store.goapps/backend/internal/system/queuesettings/resolver.goapps/backend/internal/system/queuesettings/service.goapps/backend/internal/system/queuesettings/queuesettings_test.goapps/backend/internal/backendapp/orchestrator.goapps/backend/internal/backendapp/message_queue_settings_test.goapps/backend/internal/system/system_routes_test.go
Dependencies
Task 02.
Parallelism
Sequential.
Inputs
- Spec:
Data model,API surface,Permissions,Persistence guarantees, and settings scenarios. - Plan:
Backend > Persistent settings and startup wiring. - Existing patterns: pointer-backed
merge_enabledlegacy decoding,SettingsPatch.Apply, persisted-before-live-apply service flow, andresolveQueueMergeEnabledstartup wiring.
Risks
- Plain bool decoding would silently turn legacy installs off. The stored shape needs a pointer for the new field.
- Keep
merge_enabledandauto_merge_enablednames and live setters distinct. - The capacity environment source/lock metadata remains about capacity only.
- Live apply must use resolved effective capacity after any merge-only patch; copying the persisted capacity would override the active environment value.
Output contract
Report summary, files changed, exact commands/outcomes, blockers, risks, and
update this task plus plan.md status in the same conversation.
Results
- Added
auto_merge_enabledto configured/effective responses and partial patches, with pointer-backed legacy decoding that defaults omitted values on. - Persisted normalized three-field JSON and applied all live values only after a successful save.
- Fixed merge-only live apply under a capacity environment override to reapply the resolved environment capacity instead of the persisted value.
- Wired startup to resolve once and apply capacity, manual merge, and automatic merge before queue admissions; added fresh/legacy/false/restart resolver, HTTP, persistence, and live-target tests.
- Verification passed:
cd apps/backend && go test -count=1 ./internal/system/queuesettings ./internal/system ./internal/backendappcd apps/backend && go test -race -count=1 ./internal/system/queuesettings ./internal/orchestrator/messagequeue
- Blockers: none.