Seed the mock startup option into the system settings scope
ci / vet-and-test (pull_request) Successful in 48s

Why: Since the system-managed settings change (#188), runtime.* writes
at the user scope are rejected, so the mock startup flag failed with
"system-managed settings require admin" and the serve process never
became healthy - the Dev multi-instance integration regression.

Evidence: go build ok; internal/app and internal/settings suites green
(SELF); the Dev composite CI on the follow-up PR re-runs
make test-multi-instance against this fix (GATE).

Impact: The mock startup flag now seeds runtime.mock via MergeSystem
(trusted operator input, effective for every tenant through the
Effective merge chain); no HTTP surface changes.

Refs: Dev PR #508; backend #188.
This commit is contained in:
2026-10-13 04:45:12 +00:00
parent 349a47de6f
commit 0af1ebc915
+4 -1
View File
@@ -437,7 +437,10 @@ func Run(opt Options) error {
return fmt.Errorf("default profile: %w", err)
}
if opt.ForceMock {
if err := setSvc.MergeUser(store.OwnerDefault, map[string]any{"runtime": map[string]any{"mock": true}}); err != nil {
// runtime.* 自 #188 起为系统受管项:启动选项属受信操作员输入,
// 播种走系统层(对所有租户生效);用户层写入会被受管拦截拒绝,
// 导致 serve --mock 直接启动失败(multi-instance 集成回归)。
if err := setSvc.MergeSystem(map[string]any{"runtime": map[string]any{"mock": true}}); err != nil {
return err
}
}