{"record":{"id":"18cb76b79bcd4279","repo":"GoogleContainerTools/skaffold","slug":"customtest-has-invalid-dependencies-dependencies","errorCode":null,"errorMessage":"customTest has invalid dependencies; dependencies.ignore can only be used in conjunction with dependencies.paths","messagePattern":"customTest has invalid dependencies; dependencies\\.ignore can only be used in conjunction with dependencies\\.paths","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/validation/validation.go","lineNumber":819,"sourceCode":"\t\t\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{\n\t\t\t\t\tError:    fmt.Errorf(\"custom test command must not be empty;\"),\n\t\t\t\t\tLocation: cfg.YAMLInfos.Locate(&cfg.Test[i].CustomTests[j]),\n\t\t\t\t})\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif ct.Dependencies == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ct.Dependencies.Command != \"\" && ct.Dependencies.Paths != nil {\n\t\t\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{\n\t\t\t\t\tError:    fmt.Errorf(\"dependencies can use either command or paths, but not both\"),\n\t\t\t\t\tLocation: cfg.YAMLInfos.Locate(&cfg.Test[i].CustomTests[j]),\n\t\t\t\t})\n\t\t\t}\n\t\t\tif ct.Dependencies.Paths == nil && ct.Dependencies.Ignore != nil {\n\t\t\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{\n\t\t\t\t\tError:    fmt.Errorf(\"customTest has invalid dependencies; dependencies.ignore can only be used in conjunction with dependencies.paths\"),\n\t\t\t\t\tLocation: cfg.YAMLInfos.Locate(&cfg.Test[i].CustomTests[j]),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\nfunc wrapWithContext(config *parser.SkaffoldConfigEntry, errs ...ErrorWithLocation) []ErrorWithLocation {\n\tvar id string\n\tif config.Metadata.Name != \"\" {\n\t\tid = fmt.Sprintf(\"in module %q\", config.Metadata.Name)\n\t} else {\n\t\tid = fmt.Sprintf(\"in unnamed config[%d]\", config.SourceIndex)\n\t}\n\n\tfor i := range errs {\n\t\tif errs[i].Location == nil || errs[i].Location.StartLine == -1 {","sourceCodeStart":801,"sourceCodeEnd":837,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/validation/validation.go#L801-L837","documentation":"Validation error from validateCustomTest: a custom test sets dependencies.ignore without dependencies.paths. Ignore patterns are only meaningful as filters over an explicit paths list, so the combination is rejected with the test's YAML location.","triggerScenarios":"Processing a skaffold.yaml where a customTest's `dependencies:` block has `ignore:` set while `paths` is nil/absent (typically because only `command` is set).","commonSituations":"Copying an ignore list from another test that used paths; removing paths during a switch to command-based dependencies but leaving ignore behind; assuming ignore applies to command output too.","solutions":["Add a `paths` list alongside `ignore`, or remove the `ignore` field if using command-based dependencies","Keep ignore only as a filter of the paths set","Validate the dependencies block against the skaffold schema before running"],"exampleFix":"# before\n- customTests:\n  - command: ./run-tests.sh\n    dependencies:\n      command: ./list-deps.sh\n      ignore: [\"**/*_test.go\"]\n# after\n- customTests:\n  - command: ./run-tests.sh\n    dependencies:\n      paths: [\"src/**\"]\n      ignore: [\"**/*_test.go\"]","handlingStrategy":"validation","validationCode":"func ignoreNeedsPaths(ct CustomTest) error {\n\td := ct.Dependencies\n\tif d != nil && len(d.Ignore) > 0 && d.Paths == nil {\n\t\treturn fmt.Errorf(\"customTest dependencies.ignore requires dependencies.paths\")\n\t}\n\treturn nil\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Use ignore only together with paths","When migrating to command-based dependencies, drop ignore lists too","Schema-lint skaffold.yaml before committing"],"tags":["skaffold","yaml-validation","custom-test","dependencies"],"backgroundTag":"schema-validation-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}