Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions acceptance/bundle/refschema/output/root.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions cmd/bundle/debug/refschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading