{"record":{"id":"ba1a0987dbf69746","repo":"vitessio/vitess","slug":"package-s-is-not-under-s","errorCode":null,"errorMessage":"package %s is not under %s","messagePattern":"package (.+?) is not under (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/tools/ci-config/check.go","lineNumber":112,"sourceCode":"\t\tsort.Strings(names)\n\t\tfor _, name := range names {\n\t\t\tif prev, ok := firstSeen[name]; ok {\n\t\t\t\tproblems = append(problems, fmt.Sprintf(\"duplicate entry %q defined in both %s and %s\", name, prev, path))\n\t\t\t} else {\n\t\t\t\tfirstSeen[name] = path\n\t\t\t}\n\t\t\tentries = append(entries, entry{configFile: path, name: name, test: config.Tests[name]})\n\t\t}\n\t}\n\treturn entries, problems\n}\n\n// pkgDir maps a package import path from a config entry to a directory\n// under root.\nfunc pkgDir(root, importPath string) (string, error) {\n\trel, ok := strings.CutPrefix(importPath, modulePrefix)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"package %s is not under %s\", importPath, modulePrefix)\n\t}\n\treturn filepath.Join(root, filepath.FromSlash(rel)), nil\n}\n\n// listTests returns the names of all top-level test functions declared in\n// the *_test.go files of dir, sorted and deduplicated. It mirrors how cmd/go\n// discovers tests (isTestFunc/isTest in cmd/go/internal/load/test.go):\n// internal and external test packages both count, TestMain(m *testing.M) is\n// the test entrypoint rather than a test, and a TestMain(t *testing.T) is a\n// regular test. Build constraints are deliberately ignored: CI runs on\n// linux, and a tag-guarded orphan still deserves triage.\nfunc listTests(dir string) ([]string, error) {\n\tdirEntries, err := os.ReadDir(dir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfset := token.NewFileSet()\n\tseen := make(map[string]bool)","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/tools/ci-config/check.go#L94-L130","documentation":"ci-config's pkgDir maps a package import path from the CI config into a directory under the repo root by stripping the module prefix (e.g. vitess.io/vitess/). If the import path doesn't start with that prefix, it cannot be resolved to a directory and this error is returned. It guards against misconfigured package entries in the CI config.","triggerScenarios":"A config entry in .github/workflows or the ci-config input lists a package import path that does not begin with the module's prefix — e.g. `golang.org/x/tools/...`, a typo like `vitessio/vitess/go/vt/...`, or an absolute file path instead of an import path.","commonSituations":"Editing go/test/endtoend or workflow CI config and typing the import path by hand; adding a package from a dependency module instead of the vitess module; renaming the module path without updating config entries.","solutions":["Check the import path in the config entry and ensure it starts with the Vitess module prefix (vitess.io/vitess/)","Fix typos (e.g. vitessio vs vitess.io) and remove any paths belonging to external modules","Use a relative package path under go/ if the tool expects paths relative to root instead of full imports","Verify by running the ci-config tool locally after the edit"],"exampleFix":"// before (config entry)\npackage: go/vt/vtgate/...\n// after\npackage: vitess.io/vitess/go/vt/vtgate/...","handlingStrategy":"validation","validationCode":"const modulePrefix = \"vitess.io/vitess/\"\nfunc validatePkgEntry(importPath string) error {\n    if !strings.HasPrefix(importPath, modulePrefix) {\n        return fmt.Errorf(\"config entry %q must start with %q\", importPath, modulePrefix)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"dir, err := pkgDir(root, importPath)\nif err != nil {\n    return fmt.Errorf(\"fix ci config entry %q: %w\", importPath, err)\n}","preventionTips":["Always write config package entries as full vitess.io/vitess/... import paths","Never reference packages from other modules in CI config entries","Run the ci-config tool locally before committing workflow/config changes"],"tags":["ci","config","go","validation"],"backgroundTag":"invalid-config-entry","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}