Declare preferences with a type and a predefined key, and lay mesh and node config between default and node (hq issue 630)

A preference may fall back to one reviewed mesh-wide or node-wide value instead of a module layer for the whole mesh; like a default, config fills ${setting:} only.
This commit is contained in:
2026-10-13 13:08:37 +00:00
parent 6f1a05366c
commit 3d16515771
6 changed files with 320 additions and 27 deletions
+2 -2
View File
@@ -43,7 +43,7 @@ func onlyTaken(layers []Layer, taken map[string]bool) []Layer {
values[key] = value
}
}
kept = append(kept, Layer{From: layer.From, Values: values, Default: layer.Default})
kept = append(kept, Layer{From: layer.From, Values: values, Default: layer.Default, Config: layer.Config})
}
return kept
}
@@ -83,7 +83,7 @@ func TakenSettingsProblems(m Manifest) []string {
// Said only when none of the module's mergeable files names its keys: when one does, §2 already
// names every file that does not, and a file is not reported twice.
func WrittenSettingsProblems(m Manifest) []string {
if len(m.Settings) == 0 {
if len(PreferencesOf(m)) == 0 {
return nil
}
var silent []string