From adc9a564fdbcda116c41448b870a4f46afd82384 Mon Sep 17 00:00:00 2001 From: Andy Grunwald Date: Sun, 31 Oct 2021 08:30:54 +0100 Subject: [PATCH 1/4] Comment to keep API preview headers around These media types will be added to the API request as headers and used to enable particular features on GitHub API that are still in preview. After some time, specific media types will be promoted (to a "stable" state). From then on, the preview headers are not required anymore to activate the additional feature on GitHub.com's API. However, this API header might still be needed for users to run a GitHub Enterprise Server on-premise. It's not uncommon for GitHub Enterprise Server customers to run older versions which would probably rely on the preview headers for some time. While the header promotion is going out for GitHub.com, it may be some time before it even arrives in GitHub Enterprise Server. We keep those preview headers around to avoid breaking older GitHub Enterprise Server versions. Additionally, an non-functional (preview) header doesn't create any side effects on GitHub Cloud version. See https://github.com/google/go-github/pull/2125 for full context. --- github/github.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/github/github.go b/github/github.go index d4d7a54a7f1..75b0542686e 100644 --- a/github/github.go +++ b/github/github.go @@ -48,6 +48,21 @@ const ( mediaTypeIssueImportAPI = "application/vnd.github.golden-comet-preview+json" // Media Type values to access preview APIs + // These media types will be added to the API request as headers + // and used to enable particular features on GitHub API that are still in preview. + // After some time, specific media types will be promoted (to a "stable" state). + // From then on, the preview headers are not required anymore to activate the additional + // feature on GitHub.com's API. However, this API header might still be needed for users to run a GitHub Enterprise Server + // on-premise. + // It's not uncommon for GitHub Enterprise Server customers to run older versions which + // would probably rely on the preview headers for some time. + // While the header promotion is going out for GitHub.com, it may be some time before it + // even arrives in GitHub Enterprise Server. + // We keep those preview headers around to avoid breaking older GitHub Enterprise Server + // versions. Additionally, an non-functional (preview) header doesn't create any side effects + // on GitHub Cloud version. + // + // See https://github.com/google/go-github/pull/2125 for full context. // https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/ mediaTypeStarringPreview = "application/vnd.github.v3.star+json" From 0cc52e5709d263717180b601960b1d7d3ba7ac4c Mon Sep 17 00:00:00 2001 From: Andy Grunwald Date: Sun, 31 Oct 2021 15:57:56 +0100 Subject: [PATCH 2/4] Update github/github.go Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> --- github/github.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/github.go b/github/github.go index 75b0542686e..6bb71876fd7 100644 --- a/github/github.go +++ b/github/github.go @@ -59,7 +59,7 @@ const ( // While the header promotion is going out for GitHub.com, it may be some time before it // even arrives in GitHub Enterprise Server. // We keep those preview headers around to avoid breaking older GitHub Enterprise Server - // versions. Additionally, an non-functional (preview) header doesn't create any side effects + // versions. Additionally, non-functional (preview) headers don't create any side effects // on GitHub Cloud version. // // See https://github.com/google/go-github/pull/2125 for full context. From 831f799320c3d5cea0977bc5fd4bca4ad20a50f7 Mon Sep 17 00:00:00 2001 From: Andy Grunwald Date: Sun, 31 Oct 2021 15:58:35 +0100 Subject: [PATCH 3/4] Update github/github.go Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> --- github/github.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/github.go b/github/github.go index 6bb71876fd7..2fa518b59b2 100644 --- a/github/github.go +++ b/github/github.go @@ -53,7 +53,7 @@ const ( // After some time, specific media types will be promoted (to a "stable" state). // From then on, the preview headers are not required anymore to activate the additional // feature on GitHub.com's API. However, this API header might still be needed for users to run a GitHub Enterprise Server - // on-premise. + // to run a GitHub Enterprise Server on-premise. // It's not uncommon for GitHub Enterprise Server customers to run older versions which // would probably rely on the preview headers for some time. // While the header promotion is going out for GitHub.com, it may be some time before it From 5a6a8453882304a9abcbafe911a5a5ae8d5f9581 Mon Sep 17 00:00:00 2001 From: Andy Grunwald Date: Sun, 31 Oct 2021 15:58:42 +0100 Subject: [PATCH 4/4] Update github/github.go Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> --- github/github.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/github.go b/github/github.go index 2fa518b59b2..02cdabd551c 100644 --- a/github/github.go +++ b/github/github.go @@ -52,7 +52,7 @@ const ( // and used to enable particular features on GitHub API that are still in preview. // After some time, specific media types will be promoted (to a "stable" state). // From then on, the preview headers are not required anymore to activate the additional - // feature on GitHub.com's API. However, this API header might still be needed for users to run a GitHub Enterprise Server + // feature on GitHub.com's API. However, this API header might still be needed for users // to run a GitHub Enterprise Server on-premise. // It's not uncommon for GitHub Enterprise Server customers to run older versions which // would probably rely on the preview headers for some time.