From dceecbef0a5a97e706bc577f8f7acd1824484710 Mon Sep 17 00:00:00 2001 From: Gavin Mogan Date: Thu, 19 Dec 2019 11:54:07 -0800 Subject: [PATCH 1/2] Labels with description are not preview anymore https://developer.github.com/v3/issues/labels/#create-a-label --- src/main/java/org/kohsuke/github/GHRepository.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index a76dd5b1e7..a59243232b 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -1831,12 +1831,9 @@ public GHLabel createLabel(String name, String color) throws IOException { * @throws IOException * the io exception */ - @Preview - @Deprecated public GHLabel createLabel(String name, String color, String description) throws IOException { return root.createRequest() .method("POST") - .withPreview(SYMMETRA) .with("name", name) .with("color", color) .with("description", description) From 16d8c2b221428999a80ee28c111ec8b0aa7f30d9 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Thu, 19 Dec 2019 13:25:21 -0800 Subject: [PATCH 2/2] Remove Symmetra preview --- src/main/java/org/kohsuke/github/GHLabel.java | 8 -------- src/main/java/org/kohsuke/github/GHRepository.java | 7 +------ src/main/java/org/kohsuke/github/Previews.java | 8 -------- ..._github-api-test-org_test-labels_labels-12-b2265f.json | 1 - ...s_github-api-test-org_test-labels_labels-3-82e643.json | 1 - ...s_github-api-test-org_test-labels_labels-5-ce07a3.json | 1 - ...-test-org_test-labels_labels_enhancement-4-ba366e.json | 1 - ...ub-api-test-org_test-labels_labels_test-10-3ee113.json | 1 - ...hub-api-test-org_test-labels_labels_test-6-6c1d5b.json | 1 - ...hub-api-test-org_test-labels_labels_test-7-aceb5f.json | 1 - ...hub-api-test-org_test-labels_labels_test-8-0dc6e2.json | 1 - ...hub-api-test-org_test-labels_labels_test-9-e4f1b8.json | 1 - ...b-api-test-org_test-labels_labels_test2-13-633a55.json | 1 - 13 files changed, 1 insertion(+), 32 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHLabel.java b/src/main/java/org/kohsuke/github/GHLabel.java index b47e1f2d99..8fdd0d7d6f 100644 --- a/src/main/java/org/kohsuke/github/GHLabel.java +++ b/src/main/java/org/kohsuke/github/GHLabel.java @@ -6,8 +6,6 @@ import java.util.List; import java.util.Objects; -import static org.kohsuke.github.Previews.SYMMETRA; - /** * The type GHLabel. * @@ -51,8 +49,6 @@ public String getColor() { * * @return the description */ - @Preview - @Deprecated public String getDescription() { return description; } @@ -83,7 +79,6 @@ public void delete() throws IOException { public void setColor(String newColor) throws IOException { repo.root.createRequest() .method("PATCH") - .withPreview(SYMMETRA) .with("name", name) .with("color", newColor) .with("description", description) @@ -99,12 +94,9 @@ public void setColor(String newColor) throws IOException { * @throws IOException * the io exception */ - @Preview - @Deprecated public void setDescription(String newDescription) throws IOException { repo.root.createRequest() .method("PATCH") - .withPreview(SYMMETRA) .with("name", name) .with("color", color) .with("description", newDescription) diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index a59243232b..f07538823f 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -1782,7 +1782,6 @@ public PagedIterable listEvents() throws IOException { */ public PagedIterable listLabels() throws IOException { return root.createRequest() - .withPreview(SYMMETRA) .asPagedIterable(getApiTailUrl("labels"), GHLabel[].class, item -> item.wrapUp(GHRepository.this)); } @@ -1796,11 +1795,7 @@ public PagedIterable listLabels() throws IOException { * the io exception */ public GHLabel getLabel(String name) throws IOException { - return root.createRequest() - .withPreview(SYMMETRA) - .withUrlPath(getApiTailUrl("labels/" + name)) - .fetch(GHLabel.class) - .wrapUp(this); + return root.createRequest().withUrlPath(getApiTailUrl("labels/" + name)).fetch(GHLabel.class).wrapUp(this); } /** diff --git a/src/main/java/org/kohsuke/github/Previews.java b/src/main/java/org/kohsuke/github/Previews.java index 2468ac94cb..5ca049c57e 100644 --- a/src/main/java/org/kohsuke/github/Previews.java +++ b/src/main/java/org/kohsuke/github/Previews.java @@ -66,14 +66,6 @@ class Previews { */ static final String SQUIRREL_GIRL = "application/vnd.github.squirrel-girl-preview"; - /** - * Label emoji, search, and descriptions - * - * @see GitHub API - * Previews - */ - static final String SYMMETRA = "application/vnd.github.symmetra-preview+json"; - /** * Require signed commits * diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-12-b2265f.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-12-b2265f.json index bbbb9baa0a..9f6f1e0f53 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-12-b2265f.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-12-b2265f.json @@ -32,7 +32,6 @@ "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "", "Location": "https://api.github.com/repos/github-api-test-org/test-labels/labels/test2", - "X-GitHub-Media-Type": "github.symmetra-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-3-82e643.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-3-82e643.json index 328d22e6a6..7eed346f9d 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-3-82e643.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-3-82e643.json @@ -24,7 +24,6 @@ "ETag": "W/\"70c6bea1b42c9775915fdf6e8279aa26\"", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", - "X-GitHub-Media-Type": "github.symmetra-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-5-ce07a3.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-5-ce07a3.json index c9bef91493..4542b42c08 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-5-ce07a3.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-5-ce07a3.json @@ -32,7 +32,6 @@ "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "", "Location": "https://api.github.com/repos/github-api-test-org/test-labels/labels/test", - "X-GitHub-Media-Type": "github.symmetra-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_enhancement-4-ba366e.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_enhancement-4-ba366e.json index dccdd4cf09..4f5866b759 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_enhancement-4-ba366e.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_enhancement-4-ba366e.json @@ -25,7 +25,6 @@ "Last-Modified": "Sun, 15 Feb 2015 14:49:10 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", - "X-GitHub-Media-Type": "github.symmetra-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-10-3ee113.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-10-3ee113.json index 0d70c8f03a..7fa4100786 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-10-3ee113.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-10-3ee113.json @@ -25,7 +25,6 @@ "Last-Modified": "Sat, 05 Oct 2019 05:21:23 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", - "X-GitHub-Media-Type": "github.symmetra-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-6-6c1d5b.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-6-6c1d5b.json index c18f2d7526..6f0cc8c9f0 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-6-6c1d5b.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-6-6c1d5b.json @@ -25,7 +25,6 @@ "Last-Modified": "Sat, 05 Oct 2019 05:21:23 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", - "X-GitHub-Media-Type": "github.symmetra-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-7-aceb5f.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-7-aceb5f.json index 796c73c9db..09e387f6e0 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-7-aceb5f.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-7-aceb5f.json @@ -31,7 +31,6 @@ "ETag": "W/\"b6be68c4a5dbc522147f58e4b1b1aed1\"", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "", - "X-GitHub-Media-Type": "github.symmetra-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-8-0dc6e2.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-8-0dc6e2.json index d3294e4dd4..6f46c893f6 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-8-0dc6e2.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-8-0dc6e2.json @@ -25,7 +25,6 @@ "Last-Modified": "Sat, 05 Oct 2019 05:21:23 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", - "X-GitHub-Media-Type": "github.symmetra-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-9-e4f1b8.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-9-e4f1b8.json index d81e429acd..c85b9e6de4 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-9-e4f1b8.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-9-e4f1b8.json @@ -31,7 +31,6 @@ "ETag": "W/\"cd828b300f3803bcda7512b44c762a69\"", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "", - "X-GitHub-Media-Type": "github.symmetra-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-13-633a55.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-13-633a55.json index 00543e0ef3..7425a5967a 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-13-633a55.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-13-633a55.json @@ -25,7 +25,6 @@ "Last-Modified": "Sat, 05 Oct 2019 05:21:24 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", - "X-GitHub-Media-Type": "github.symmetra-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",