Skip to content

Migrate to GitHub REST API version 2026-03-10 - #3038

Open
maxffarrell wants to merge 2 commits into
github:mainfrom
maxffarrell:codex/migrate-api-2026-03-10
Open

Migrate to GitHub REST API version 2026-03-10#3038
maxffarrell wants to merge 2 commits into
github:mainfrom
maxffarrell:codex/migrate-api-2026-03-10

Conversation

@maxffarrell

@maxffarrell maxffarrell commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • use REST API version 2026-03-10 for GitHub.com and GitHub Enterprise Cloud
  • pin GitHub Enterprise Server requests to the compatible 2022-11-28 API version
  • apply the host-aware policy to stdio and per-request REST clients, scope discovery, and GitHub App installation-token requests
  • remove the deprecated singular assignee field from issue and pull-request search field schemas
  • add regression coverage for GitHub.com, GHEC, GHES, case-insensitive hosts, lookalike domains, and every request path

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

  • script/lint
  • script/test (full race-enabled suite)
  • script/build-ui
  • script/licenses-check (all supported platforms)
  • go mod tidy -diff
  • go build ./cmd/github-mcp-server
  • generated documentation is clean
  • git diff --check

@maxffarrell
maxffarrell marked this pull request as ready for review August 8, 2026 02:03
@maxffarrell
maxffarrell requested a review from a team as a code owner August 8, 2026 02:03
Copilot AI balanced review requested due to automatic review settings August 8, 2026 02:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates REST requests to GitHub API version 2026-03-10.

Changes:

  • Centralizes the API-version header and transport.
  • Applies the version to REST clients, scope discovery, and GitHub App authentication.
  • Adds request-path coverage.

Reviewed 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.

Comment thread internal/ghmcp/server.go
// 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},
Comment thread pkg/scopes/fetcher.go Outdated
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)
Comment thread internal/githubapp/githubapp.go Outdated
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)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

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

  • Non-blocking: the exported type documentation says this transport only handles cloud requests, but RoundTrip also pins GHES requests to the compatibility version. Include GHES so the documented public behavior matches the implementation.
// APIVersionTransport sets the GitHub REST API version on requests to
// GitHub.com and GitHub Enterprise Cloud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

migrate to api 2026-03-10

2 participants