{"record":{"id":"ce135efb343c6d6a","repo":"helm/helm","slug":"version-is-required","errorCode":null,"errorMessage":"version is required","messagePattern":"version is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/chart/v3/lint/rules/chartfile.go","lineNumber":140,"sourceCode":"\t}\n\treturn nil\n}\n\nfunc validateChartAPIVersion(cf *chart.Metadata) error {\n\tif cf.APIVersion == \"\" {\n\t\treturn errors.New(\"apiVersion is required. The value must be \\\"v3\\\"\")\n\t}\n\n\tif cf.APIVersion != chart.APIVersionV3 {\n\t\treturn fmt.Errorf(\"apiVersion '%s' is not valid. The value must be \\\"v3\\\"\", cf.APIVersion)\n\t}\n\n\treturn nil\n}\n\nfunc validateChartVersion(cf *chart.Metadata) error {\n\tif cf.Version == \"\" {\n\t\treturn errors.New(\"version is required\")\n\t}\n\n\tversion, err := semver.StrictNewVersion(cf.Version)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"version '%s' is not a valid SemVerV2\", cf.Version)\n\t}\n\n\tc, err := semver.NewConstraint(\">0.0.0-0\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tvalid, msg := c.Validate(version)\n\n\tif !valid && len(msg) > 0 {\n\t\treturn fmt.Errorf(\"version %w\", msg[0])\n\t}\n\n\treturn nil","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/internal/chart/v3/lint/rules/chartfile.go#L122-L158","documentation":"The default branch of literalParser.listItem (pkg/strvals/literal_parser.go:235) fires only when the scanner's last rune is none of the stop runes '[', '.', '=' while no error occurred. With the current stop set every terminating rune is handled by an explicit case, so this branch is defensive: it guards against internal invariant breakage or future parser changes rather than normal user input.","triggerScenarios":"Not reachable through ordinary ParseLiteral input with the current stop set {'[','.','='}; would require an internal parser regression or an unexpected rune returned without error.","commonSituations":"Virtually never seen in practice; if it appears, it indicates a modified/patched parser, an exotic rune stream, or a Helm bug.","solutions":["Capture the exact input string and Helm version and report it as a bug upstream","Verify you are on a released Helm build, not a fork or local modification","Reduce the failing --set-string expression to the minimal repro before filing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := strvals.ParseLiteral(s); err != nil {\n    if strings.Contains(err.Error(), \"unexpected token\") { /* internal/defensive: report input + version upstream */ }\n    return err\n}","preventionTips":["Treat this branch appearing as a bug signal, not a user error","Keep the failing input for the bug report","Pin a released Helm/strvals version"],"tags":["strvals","set-string","parsing","defensive","unreachable"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}