{"record":{"id":"3128646ca23fbcee","repo":"cilium/cilium","slug":"invalid-repository-format-expected-owner-repo","errorCode":null,"errorMessage":"invalid repository format. Expected 'owner/repo', got '%s'","messagePattern":"invalid repository format\\. Expected 'owner/repo', got '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cilium-cli/features/summary.go","lineNumber":57,"sourceCode":"\t}\n\n\tworkflowData, err := loadWorkflowData(s.params.MetricsDirectory)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn s.printSummaryFromJsons(workflowData)\n}\n\nfunc (s *Feature) downloadWorkflowData(ctx context.Context) error {\n\ttoken := os.Getenv(\"GITHUB_TOKEN\")\n\n\tif token == \"\" {\n\t\treturn fmt.Errorf(\"GITHUB_TOKEN environment variable must be set.\")\n\t}\n\n\tparts := strings.Split(s.params.Repo, \"/\")\n\tif len(parts) != 2 {\n\t\treturn fmt.Errorf(\"invalid repository format. Expected 'owner/repo', got '%s'\", s.params.Repo)\n\t}\n\towner, repoName := parts[0], parts[1]\n\n\tghClient, err := github.NewClient(github.WithAuthToken(token))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating github client: %w\", err)\n\t}\n\n\tallRuns := map[int64]*github.WorkflowRun{}\n\t// Fetch workflow runs for the specific commit\n\tfor _, event := range []string{\"push\", \"schedule\", \"pull_request\", \"pull_request_target\"} {\n\t\topts := &github.ListWorkflowRunsOptions{\n\t\t\tHeadSHA: s.params.Commit,\n\t\t\tStatus:  \"completed\",\n\t\t\tEvent:   event,\n\t\t\tListOptions: github.ListOptions{\n\t\t\t\tPerPage: 100,\n\t\t\t},","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/cilium-cli/features/summary.go#L39-L75","documentation":" The --repo parameter must be exactly 'owner/repo'. `downloadWorkflowData` splits `s.params.Repo` on \"/\" and, if it doesn't yield exactly two parts, rejects it with this message before creating the GitHub client.","triggerScenarios":" `strings.Split(s.params.Repo, \"/\")` returns != 2 parts: e.g. \"cilium\", \"https://github.com/cilium/cilium\", \"cilium/cilium/extra\", or empty string.","commonSituations":" Users pass a full URL instead of owner/repo, omit the flag so it defaults empty, or pass org/repo/branch.","solutions":["Pass `--repo cilium/cilium` (bare owner/repo, no URL, no extra path)","Strip protocol/prefix if deriving from a URL: use path portion only","Validate the flag value in your wrapper script before invoking cilium-cli"],"exampleFix":"// before\n--repo https://github.com/cilium/cilium\n// after\n--repo cilium/cilium","handlingStrategy":"validation","validationCode":"func normalizeRepo(r string) (string, error) {\n\tr = strings.TrimPrefix(r, \"https://github.com/\")\n\tr = strings.TrimPrefix(r, \"github.com/\")\n\tparts := strings.Split(strings.Trim(r, \"/\"), \"/\")\n\tif len(parts) != 2 || parts[0] == \"\" || parts[1] == \"\" {\n\t\treturn \"\", fmt.Errorf(\"repo must be owner/repo, got %q\", r)\n\t}\n\treturn parts[0] + \"/\" + parts[1], nil\n}","typeGuard":"func isOwnerRepoFormat(s string) bool {\n\tparts := strings.Split(s, \"/\")\n\treturn len(parts) == 2 && parts[0] != \"\" && parts[1] != \"\"\n}","tryCatchPattern":"if err := feat.GenSummary(ctx); err != nil {\n\tif strings.Contains(err.Error(), \"invalid repository format\") {\n\t\tnormalized, nerr := normalizeRepo(flagRepo)\n\t\tif nerr == nil { return rerunWithRepo(normalized) }\n\t}\n\treturn err\n}","preventionTips":["Always pass bare owner/repo (no URLs, no extra path segments)","Validate the --repo flag with a regex ^[^/]+/[^/]+$ in wrapper scripts","Don't rely on an empty default — set --repo explicitly"],"tags":["configuration","validation","github"],"backgroundTag":"invalid-input-format","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}