Skip to content

Conversation

@alexandear
Copy link
Contributor

The PR removes deprecated preview "Accept" headers from all search endpoints.

The REST API for search was fully launched a long time ago https://docs.github.com/en/rest/search/search

@alexandear
Copy link
Contributor Author

We can't remove preview constants yet:

$ grep -r --include='*.go' --exclude='*_test.go' 'mediaTypeTopicsPreview' .
./github/repos_forks.go:        req.Header.Set("Accept", mediaTypeTopicsPreview)
./github/teams.go:      req.Header.Set("Accept", mediaTypeTopicsPreview)
./github/teams.go:      req.Header.Set("Accept", mediaTypeTopicsPreview)
./github/activity_star.go:      acceptHeaders := []string{mediaTypeStarring, mediaTypeTopicsPreview}
./github/repos.go:      acceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview}
./github/repos.go:              mediaTypeTopicsPreview,
./github/repos.go:      req.Header.Set("Accept", mediaTypeTopicsPreview)
./github/repos.go:      req.Header.Set("Accept", mediaTypeTopicsPreview)
./github/github.go:     mediaTypeTopicsPreview = "application/vnd.github.mercy-preview+json"

$ grep -r --include='*.go' --exclude='*_test.go' 'mediaTypeReactionsPreview' .
./github/issues.go:     req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/issues.go:     req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/issues.go:     req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/issues_comments.go:    req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/issues_comments.go:    req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/reactions.go:  req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/repos_comments.go:     req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/repos_comments.go:     req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/repos_comments.go:     req.Header.Set("Accept", mediaTypeReactionsPreview)
./github/pulls_comments.go:     acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}
./github/pulls_comments.go:     acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}
./github/pulls_comments.go:     acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}
./github/github.go:     mediaTypeReactionsPreview = "application/vnd.github.squirrel-girl-preview"

@alexandear alexandear changed the title fix: Remove custom Accept headers in search endpoints fix: Remove custom Accept headers from search endpoints Nov 10, 2025
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.32%. Comparing base (9c16433) to head (a068ebe).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3820      +/-   ##
==========================================
- Coverage   92.32%   92.32%   -0.01%     
==========================================
  Files         194      194              
  Lines       13984    13973      -11     
==========================================
- Hits        12911    12900      -11     
  Misses        884      884              
  Partials      189      189              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @alexandear!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @zyfy29

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Nov 10, 2025
Copy link
Contributor

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

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

LGTM

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Nov 12, 2025
@gmlewis
Copy link
Collaborator

gmlewis commented Nov 12, 2025

Thank you, @stevehipwell!
Merging.

@gmlewis gmlewis merged commit 3959138 into google:master Nov 12, 2025
7 checks passed
@alexandear alexandear deleted the fix/search-remove-preview-headers branch November 12, 2025 18:46
alexandear added a commit to alexandear-org/go-github that referenced this pull request Nov 13, 2025
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.

3 participants