fix(config): complete the reloadable allowlist and pin it against ForTask
The allowlist drifted before the chunk shipped. ForTask (config.go:457-465) is the authoritative per-dispatch snapshot and carries Models, Budgets, Dispatch, DiffCapLines, Notify and Forge.Host -- I allowlisted only three. And the poll path reads cfg.Label and cfg.BotUser live per cycle (daemon.go:359,390 and :368,381) off the same per-poll config as Dispatch.Trigger. Five fields would have reported 'requires a restart' while actually taking effect immediately: the safe direction, but exactly the warning-fatigue failure that kills the feature (an operator who is told to restart for a label change that already applied learns the warning is noise). The fix is enforcement, not a bigger list: TestReloadableFieldsCoverForTaskSnapshot reflects over TaskConfig and fails if any field ForTask carries is not in the allowlist (Forge maps to the Forge.Host sub-field entry). A field added to ForTask later now fails the test instead of silently producing a wrong warning. Label and BotUser are not carried by ForTask -- they come off the poll path -- so they are allowlisted by hand with a comment, and the same test pins them explicitly. Also documents on webui.Server.Cfg that in production it is the daemon's OWN Holder (web.Cfg = d.Cfg), so Set publishes to the running daemon: a config-mutating handler must apply to a copy, validate the materialised config, persist, then Set -- never Set directly. task check clean.
This commit is contained in:
1 parent
d8d4c93239
commit
31fdbddd61
3 files changed
+74
-12
No files matched your search
@@ -36,6 +36,12 @@ type Server struct {
|
||||
// dashboard degrades to task data alone when it is nil. Held through a
|
||||
// Holder so a reload swaps the snapshot atomically across handler
|
||||
// goroutines that would otherwise race on the raw shared pointer.
|
||||
//
|
||||
// In production this is the daemon's OWN Holder (main.go wires
|
||||
// web.Cfg = d.Cfg), so Set here publishes to the running daemon. A
|
||||
// config-mutating handler must never call Set directly: it goes
|
||||
// through the same path as reload -- apply to a copy, validate the
|
||||
// materialised config, persist, then Set.
|
||||
Cfg *config.Holder
|
||||
|
||||
// Workflows is the executable registry snapshot supplied by composition.
|
||||
|
||||
Reference in new issue
Block a user