{"record":{"id":"48295ffee77cc045","repo":"JuliusBrussee/caveman","slug":"githubapp-decode-repo-w","errorCode":null,"errorMessage":"githubapp: decode repo: %w","messagePattern":"githubapp: decode repo: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/githubapp/githubapp.go","lineNumber":265,"sourceCode":"\tFullName      string `json:\"full_name\"`\n\tDefaultBranch string `json:\"default_branch\"`\n}\n\n// GetRepo verifies that the installation token can see owner/name and returns the\n// repo's stable node id + default branch. Used by select-repo to confirm the repo\n// truly belongs to the installation before the binding goes 'active'.\nfunc (a *App) GetRepo(ctx context.Context, token, owner, name string) (Repo, error) {\n\tstatus, raw, err := a.do(ctx, \"Bearer \"+token, http.MethodGet,\n\t\t\"/repos/\"+url.PathEscape(owner)+\"/\"+url.PathEscape(name), nil)\n\tif err != nil {\n\t\treturn Repo{}, err\n\t}\n\tif status != http.StatusOK {\n\t\treturn Repo{}, fmt.Errorf(\"githubapp: get repo %s/%s: HTTP %d: %s\", owner, name, status, snippet(raw))\n\t}\n\tvar r Repo\n\tif err := json.Unmarshal(raw, &r); err != nil {\n\t\treturn Repo{}, fmt.Errorf(\"githubapp: decode repo: %w\", err)\n\t}\n\treturn r, nil\n}\n\n// GetRepoInstallation asks GitHub which installation of this App owns access to\n// a repository. This avoids treating public repository visibility as proof that\n// a caller-supplied installation id is authorized for that repository.\nfunc (a *App) GetRepoInstallation(ctx context.Context, owner, name string) (Installation, error) {\n\tvar out Installation\n\tjwt, err := a.AppJWT()\n\tif err != nil {\n\t\treturn out, err\n\t}\n\tstatus, raw, err := a.do(ctx, \"Bearer \"+jwt, http.MethodGet,\n\t\t\"/repos/\"+url.PathEscape(owner)+\"/\"+url.PathEscape(name)+\"/installation\", nil)\n\tif err != nil {\n\t\treturn out, err\n\t}","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/shared/platform/githubapp/githubapp.go#L247-L283","documentation":"GetRepo received a 200 from the GitHub repos endpoint but the body failed to decode into the Repo struct (node id, default branch, etc.). The success-status payload is not the documented repository JSON — a GitHub API change or an interfering proxy.","triggerScenarios":"Thrown at shared/platform/githubapp/githubapp.go:265 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request; inspect the raw body if it persists to check for API schema changes"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}