From 2b2fb74fe56caca44372bba1ba884ef082205bae Mon Sep 17 00:00:00 2001 From: "pieter.noordhuis" Date: Wed, 4 Nov 2026 08:36:24 +0000 Subject: [PATCH] Include python.resources in bundle debug refschema output dumpRootSchema pruned every field whose path ended in ".resources", which also dropped python.resources and experimental.python.resources (a []string list of loader functions) while their siblings were listed. Prune by type instead (config.Resources / *config.Resources), so only the root, targets.* and environments.* resource trees are skipped. Co-authored-by: Isaac --- acceptance/bundle/refschema/output/root.txt | 4 ++++ cmd/bundle/debug/refschema.go | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/acceptance/bundle/refschema/output/root.txt b/acceptance/bundle/refschema/output/root.txt index aa8a83ea6cd..a674d85068d 100644 --- a/acceptance/bundle/refschema/output/root.txt +++ b/acceptance/bundle/refschema/output/root.txt @@ -222,6 +222,8 @@ experimental.pydabs.enabled bool INPUT experimental.python config.Python INPUT experimental.python.mutators []string INPUT experimental.python.mutators[*] string INPUT +experimental.python.resources []string INPUT +experimental.python.resources[*] string INPUT experimental.python.venv_path string INPUT experimental.python_wheel_wrapper bool INPUT experimental.scripts map[config.ScriptHook]config.Command INPUT @@ -249,6 +251,8 @@ presets.trigger_pause_status string INPUT python config.Python INPUT python.mutators []string INPUT python.mutators[*] string INPUT +python.resources []string INPUT +python.resources[*] string INPUT python.venv_path string INPUT run_as *jobs.JobRunAs INPUT run_as.group_name string INPUT diff --git a/cmd/bundle/debug/refschema.go b/cmd/bundle/debug/refschema.go index 55ba03696a7..ccb43a7ad5f 100644 --- a/cmd/bundle/debug/refschema.go +++ b/cmd/bundle/debug/refschema.go @@ -129,15 +129,19 @@ func dumpRemoteSchemas(out io.Writer) error { // dumpRootSchema dumps fields of the bundle config outside of resources. // Resource fields are dumped per resource type by dumpRemoteSchemas. func dumpRootSchema(out io.Writer) error { + resourcesType := reflect.TypeFor[config.Resources]() var lines []string err := structwalk.WalkType(reflect.TypeFor[config.Root](), func(path *structpath.PatternNode, typ reflect.Type, field *reflect.StructField) bool { if path == nil { return true } - p := path.String() - if p == "resources" || strings.HasSuffix(p, ".resources") { + // Match on type rather than field name: python.resources is a []string + // that belongs here, while root resources are dumped per type and target + // resources only override them. + if typ == resourcesType || typ == reflect.PointerTo(resourcesType) { return false } + p := path.String() t := strings.ReplaceAll(fmt.Sprint(typ), "interface {}", "any") lines = append(lines, fmt.Sprintf("%s\t%s\tINPUT\n", p, t)) return true