-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Remove REST API preview headers that have been promoted out of preview #2125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove REST API preview headers that have been promoted out of preview #2125
Conversation
…hub.v3.star+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…ithub.wyandotte-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…/vnd.github.ant-man-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…cation/vnd.github.flash-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…thub.squirrel-girl-preview" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…hub.mockingbird-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…hub.inertia-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
….github.cloak-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…ithub.giant-sentry-fist-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…b.mercy-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…lication/vnd.github.luke-cage-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…vnd.github.eye-scream-preview" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…thub.zzzax-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…on/vnd.github.starfox-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…ication/vnd.github.sombra-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…nd.github.switcheroo-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…application/vnd.github.dorian-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…= "application/vnd.github.london-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…ication/vnd.github.lydian-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…"application/vnd.github.groot-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
… "application/vnd.github.surtur-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…on/vnd.github.baptiste-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…n/vnd.github.comfort-fade-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…hub.doctor-strange-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
…tion/vnd.github.nebula-preview+json" due to graduation See https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/
Codecov Report
@@ Coverage Diff @@
## master #2125 +/- ##
==========================================
- Coverage 97.78% 97.71% -0.08%
==========================================
Files 112 112
Lines 9970 9657 -313
==========================================
- Hits 9749 9436 -313
Misses 154 154
Partials 67 67
Continue to review full report at Codecov.
|
|
codecov seems to fail due to lower test coverage. |
|
Thank you, @andygrunwald . Lately (within the last year or so), we've received a number of complaints from GitHub Enterprise users of this repo that removing custom preview headers are causing their systems to fail because their version of GHE is fixed at a certain version that still requires them to be used. I don't have all the issue numbers at the moment where this occurred but could probably dig them up when I have more time. In the meantime, do you know if the GitHub team has any recommendations for us where we support both current top-of-truck public GitHub APIs in addition to supporting (various) prior versions of GitHub Enterprise? |
|
Thanks, @gmlewis. I think this seems to be a more strategic decision for this library. Mainly around the question of "Which versions of GHE are supported by this library?".
I don't know yet, but I can check if I get an answer from someone inside GitHub. |
|
@gmlewis I have reached out to GitHub Enterprise Support and mentioned the topic of this Pull Request in particular. Here is what we came up with:
Based on this information, I see a few possible options 1. We keep all preview headers "indefinitely"
As far as I know, the implementation on GitHub (Server) side is good enough to not trigger side effects/unexpected behavior when (additional/not respected) headers are sent. Upsides:
Downsides:
2. Supporting the latest state of GitHub.com + official GitHub Enterprise Server versions
Upsides:
Downsides:
3. Implementing a "Version Check" for GitHub Enterprise Servers
Downsides:
My 2 centsSolution 1. We keep all preview headers "indefinitely" seems to be the one with the least effort, but also the least downsides. @gmlewis Do you see additional options? What do you think about this? |
|
Excellent job, @andygrunwald ! Thank you so much for contacting GitHub tech support and for summarizing the situation perfectly. I'm in agreement with you, and if you wouldn't mind, I think a PR from you explaining the situation clearly as you recommend would be the very best outcome. |
|
Sounds good @gmlewis. If you don't mind, I would like to keep this PR open until the new PR is there and replaces this one. One question: |
I believe we are currently in a fine state in terms of GitHub Enterprise users. There were a couple requests a few months ago to revert the removals of specific headers, and we did so. To my knowledge, there are no currently outstanding requests for providing missing custom headers. |
|
Superseded by #2188 |
What type of PR is this?
cleanup
What this PR does / why we need it:
On October 14, 2021, GitHub has promoted 23 preview headers. See October 14, 2021: REST API preview promotions @ GitHub Changelog blog.
This PR will remove 25 (!) preview headers from the codebase, but we keep the two headers that are still in preview by GitHub (mentioned in the blog post):
application/vnd.github.corsair-preview+jsonapplication/vnd.github.scarlet-witch-preview+jsonRemoved headers:
application/vnd.github.v3.star+jsonapplication/vnd.github.wyandotte-preview+jsonapplication/vnd.github.ant-man-preview+jsonapplication/vnd.github.flash-preview+jsonapplication/vnd.github.squirrel-girl-previewapplication/vnd.github.mockingbird-preview+jsonapplication/vnd.github.inertia-preview+jsonapplication/vnd.github.cloak-preview+jsonapplication/vnd.github.giant-sentry-fist-preview+jsonapplication/vnd.github.mercy-preview+jsonapplication/vnd.github.luke-cage-preview+jsonapplication/vnd.github.eye-scream-previewapplication/vnd.github.zzzax-preview+jsonapplication/vnd.github.starfox-preview+jsonapplication/vnd.github.sombra-preview+jsonapplication/vnd.github.switcheroo-preview+jsonapplication/vnd.github.dorian-preview+jsonapplication/vnd.github.london-preview+jsonapplication/vnd.github.lydian-preview+jsonapplication/vnd.github.groot-preview+jsonapplication/vnd.github.surtur-preview+jsonapplication/vnd.github.baptiste-preview+jsonapplication/vnd.github.comfort-fade-preview+jsonapplication/vnd.github.doctor-strange-preview+jsonapplication/vnd.github.nebula-preview+jsonWhy there is a difference of 2 (this PR removes 25 previews, the blog post is mentioning 23)?
Sadly there is no complete list provided in the blogpost of previews that have been removed.
My assumption is that this codebase contained preview headers that have been graduated before.
Special notes for your reviewer:
Size of the Pull Request
This Pull Request is very big and (IMO) hard to review.
Every commit is atomic and removes only one preview.
If you wish to receive 25 Pull Requests (one PR for each preview header), please let me know.
Other obsolete code
By removing the preview headers, I found the following code to be also obsolete:
isComfortFadePreview(incl. tests)go-github/github/pulls_reviews.go
Line 67 in f664094
DraftReviewCommentfieldsgo-github/github/pulls_reviews.go
Lines 43 to 47 in f664094
For now, I kept this code in the codebase to not blow it up even more.
Please let me know what you think about it.
Additional documentation, usage docs, etc.: