| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Migrates REST requests to GitHub API version 2026-03-10.
Changes:
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file| File | Description |
|---|---|
| pkg/http/headers/headers.go | Defines the API version. |
| pkg/http/transport/api_version.go | Adds the versioning transport. |
| pkg/http/transport/api_version_test.go | Tests transport behavior. |
| internal/ghmcp/server.go | Versions stdio REST clients. |
| internal/ghmcp/oauth_test.go | Tests stdio requests. |
| pkg/github/dependencies.go | Versions per-request clients. |
| pkg/github/dependencies_test.go | Tests per-request clients. |
| pkg/scopes/fetcher.go | Updates scope discovery. |
| pkg/scopes/fetcher_test.go | Tests scope headers. |
| internal/githubapp/githubapp.go | Updates token requests. |
| internal/githubapp/githubapp_test.go | Tests token-request headers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
| // and shadow the dynamic one. | ||
| restUATransport := &transport.UserAgentTransport{ | ||
| Transport: http.DefaultTransport, | ||
| Transport: &transport.APIVersionTransport{Transport: http.DefaultTransport}, |
| // Construct REST client | ||
| restClient, err := gogithub.NewClient( | ||
| gogithub.WithHTTPClient(&http.Client{ | ||
| Transport: &transport.APIVersionTransport{Transport: http.DefaultTransport}, |
| req.Header.Set(headers.AuthorizationHeader, "Bearer "+token) | ||
| req.Header.Set(headers.AcceptHeader, "application/vnd.github+json") | ||
| req.Header.Set(headers.GitHubAPIVersionHeader, "2022-11-28") | ||
| req.Header.Set(headers.GitHubAPIVersionHeader, headers.GitHubAPIVersion) |
| req.Header.Set("X-GitHub-Api-Version", "2022-11-28") | ||
| req.Header.Set(headers.AuthorizationHeader, "Bearer "+jwt) | ||
| req.Header.Set(headers.AcceptHeader, "application/vnd.github+json") | ||
| req.Header.Set(headers.GitHubAPIVersionHeader, headers.GitHubAPIVersion) |
There was a problem hiding this comment.
Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.
Suppressed comments (1)pkg/http/transport/api_version.go:11
// APIVersionTransport sets the GitHub REST API version on requests to // GitHub.com and GitHub Enterprise Cloud.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Why
go-github v89 supports the 2026-03-10 API contract but still defaults generated requests to 2022-11-28. The scope probe and GitHub App token exchange also hardcoded the older version, so GitHub.com and GHEC were not consistently opting into the new contract.
GHES releases support REST API versions independently. Keeping GHES on 2022-11-28 preserves compatibility with supported releases before GHES 3.21 while allowing cloud deployments to migrate.
Closes #3037.
Validation
Fixes #3037