{"record":{"id":"1aa0df99a924f497","repo":"juanfont/headscale","slug":"w-q","errorCode":null,"errorMessage":"%w: %q","messagePattern":"%w: %q","errorType":"validation","errorClass":"errUnknownSet","httpStatus":null,"severity":"error","filePath":"cmd/hi/listversions.go","lineNumber":45,"sourceCode":"// listVersions prints the Tailscale versions used by integration tests\n// in a format CI can shell out to. Mirrors integration/scenario.go\n// AllVersions and MustTestVersions: \"head\" and \"unstable\" are bare\n// tags, releases get a \"v\" prefix so each entry can be appended to\n// \"ghcr.io/tailscale/tailscale:\" directly.\nfunc listVersions(env *command.Env) error {\n\trelease := capver.TailscaleLatestMajorMinor(capver.SupportedMajorMinorVersions, true)\n\tall := append([]string{\"head\", \"unstable\"}, release...)\n\tmust := append(append([]string{}, all[0:4]...), all[len(all)-2:]...)\n\n\tvar versions []string\n\n\tswitch listVersionsConfig.Set {\n\tcase \"must\":\n\t\tversions = must\n\tcase \"all\":\n\t\tversions = all\n\tdefault:\n\t\treturn fmt.Errorf(\"%w: %q\", errUnknownSet, listVersionsConfig.Set)\n\t}\n\n\texcluded := make(map[string]bool)\n\n\tif listVersionsConfig.Exclude != \"\" {\n\t\tfor v := range strings.SplitSeq(listVersionsConfig.Exclude, \",\") {\n\t\t\texcluded[strings.TrimSpace(v)] = true\n\t\t}\n\t}\n\n\tout := make([]string, 0, len(versions))\n\n\tfor _, v := range versions {\n\t\tif excluded[v] {\n\t\t\tcontinue\n\t\t}\n\n\t\tif v != \"head\" && v != \"unstable\" {","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/hi/listversions.go#L27-L63","documentation":"Sentinel error errUnknownSet returned by `hi list-versions --set <value>` when the value is neither \"must\" nor \"all\". The command enumerates Tailscale versions from capver.SupportedMajorMinorVersions plus \"head\"/\"unstable\"; only two named sets are predefined (must = first four plus last two of that list).","triggerScenarios":"Passing --set anything other than exactly \"must\" or \"all\" (e.g. --set required, --set Must, --set \"\") — the switch on listVersionsConfig.Set falls to the default branch.","commonSituations":"Typos or case mismatch (\"All\" vs \"all\"); assuming a set name like \"supported\" or \"stable\" exists; scripting the flag with an empty variable.","solutions":["Use exactly `--set must` or `--set all`","Run `go run ./cmd/hi list-versions --set all` to see the full version list and pick exclusions via --exclude instead of inventing set names","Check for trailing whitespace or shell quoting around the flag value in scripts"],"exampleFix":"# before\ngo run ./cmd/hi list-versions --set supported\n\n# after\ngo run ./cmd/hi list-versions --set all --exclude 1.30,1.32","handlingStrategy":"validation","validationCode":"validSets := map[string]bool{\"must\": true, \"all\": true}\nif !validSets[listVersionsConfig.Set] {\n    return fmt.Errorf(\"--set must be one of %v\", maps.Keys(validSets))\n}","typeGuard":"func isValidVersionSet(s string) bool {\n    return s == \"must\" || s == \"all\"\n}","tryCatchPattern":null,"preventionTips":["Pin --set to a literal value in scripts; never pass an unchecked variable","Remember the value is case-sensitive with no aliases","Use --exclude to trim the 'all' set instead of inventing new set names"],"tags":["hi-runner","cli-flags","validation","capver"],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}