{"record":{"id":"6592d940196062ba","repo":"bytebase/bytebase","slug":"issue-label-q-color-invalid","errorCode":null,"errorMessage":"issue label %q color invalid","messagePattern":"issue label %q color invalid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/api/v1/project_service.go","lineNumber":1369,"sourceCode":"\n\tvalidPrefixes := []string{\n\t\tcommon.UserBindingPrefix,\n\t\tcommon.GroupBindingPrefix,\n\t\tcommon.ServiceAccountBindingPrefix,\n\t\tcommon.WorkloadIdentityBindingPrefix,\n\t}\n\tfor _, prefix := range validPrefixes {\n\t\tif strings.HasPrefix(member, prefix) && len(member[len(prefix):]) > 0 {\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn errors.Errorf(\"invalid member %s\", member)\n}\n\nfunc validateIssueLabels(labels []*v1pb.Label) error {\n\tfor _, label := range labels {\n\t\tif label.Color != nil && !isOpaqueColor(label.Color) {\n\t\t\treturn errors.Errorf(\"issue label %q color invalid\", label.Value)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":1351,"sourceCodeEnd":1374,"githubUrl":"https://github.com/bytebase/bytebase/blob/1870550677fe08f0d2a78c07acd27541464eb945/backend/api/v1/project_service.go#L1351-L1374","documentation":"validateIssueLabels iterates project issue labels and, when a label has a Color set, checks it is an opaque (fully opaque alpha) color via isOpaqueColor. A transparent or semi-transparent color string fails with 'issue label %q color invalid'.","triggerScenarios":"CreateProject or UpdateProject with a label whose color is e.g. \"#RRGGBBAA\" with alpha < FF, \"transparent\", or an rgba(...) value with alpha < 1.","commonSituations":"Picking a color from a palette that includes transparent variants; copying CSS colors with alpha channels; frontends sending rgba(...) values.","solutions":["Provide a fully opaque color, e.g. \"#RRGGBB\" (6-digit hex) or 8-digit hex with alpha FF","Remove the alpha channel or set it to FF/1.0","If transparency is not needed, omit the color field entirely","Normalize colors client-side to opaque hex before sending"],"exampleFix":"// before\nlabel.Color = \"#FF573380\" // 50% alpha\n// after\nlabel.Color = \"#FF5733\" // opaque","handlingStrategy":"validation","validationCode":"func isOpaqueHex(c string) bool { if len(c)==7 && c[0]=='#' { return true }; if len(c)==9 && c[0]=='#' { return strings.EqualFold(c[7:9],\"ff\") }; return false }","typeGuard":"func isOpaqueColor(c *string) bool { return c != nil && (len(*c)==7 || (len(*c)==9 && strings.EqualFold((*c)[7:9],\"ff\"))) && c[0]=='#' }","tryCatchPattern":null,"preventionTips":["Use opaque 6-digit hex colors for label colors","Strip alpha channels before sending colors","Pick colors from a palette of pre-validated opaque values"],"tags":["validation","color","issue-labels","project"],"backgroundTag":"invalid-argument-value","analyzedSha":"1870550677fe08f0d2a78c07acd27541464eb945","analyzedAt":"2026-09-06T21:16:13.665Z","contentChangedAt":"2026-09-06T21:16:13.665Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}