diff --git a/pom.xml b/pom.xml
index daf7b8fd..7c790141 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
github-client
- 0.4.1
+ 0.4.2
com.spotify
@@ -23,7 +23,7 @@
scm:git:https://github.com/spotify/github-java-client.git
scm:git:git@github.com:spotify/github-java-client.git
scm:https://github.com/spotify/github-java-client/
- v0.4.1
+ v0.4.2
@@ -67,7 +67,7 @@
UTF-8
UTF-8
- 1742308459
+ 1743926423
spotbugsexclude.xml
error
checkstyle.xml
@@ -189,7 +189,7 @@
commons-io
commons-io
- 2.7
+ 2.14.0
compile
diff --git a/src/main/java/com/spotify/github/v3/prs/AutoMerge.java b/src/main/java/com/spotify/github/v3/prs/AutoMerge.java
new file mode 100644
index 00000000..6cbad38e
--- /dev/null
+++ b/src/main/java/com/spotify/github/v3/prs/AutoMerge.java
@@ -0,0 +1,49 @@
+/*-
+ * -\-\-
+ * github-api
+ * --
+ * Copyright (C) 2016 - 2020 Spotify AB
+ * --
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * -/-/-
+ */
+
+package com.spotify.github.v3.prs;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.spotify.github.GithubStyle;
+import com.spotify.github.v3.User;
+import org.immutables.value.Value;
+
+import javax.annotation.Nullable;
+
+@Value.Immutable
+@GithubStyle
+@JsonSerialize(as = ImmutableAutoMerge.class)
+@JsonDeserialize(as = ImmutableAutoMerge.class)
+public interface AutoMerge {
+ // Who enabled the auto merge
+ User enabledBy();
+
+ // Merge Method chosen for the auto merge
+ String mergeMethod();
+
+ // The commit title to use when merging the pull request
+ @Nullable
+ String commitTitle();
+
+ // The commit message to use when merging the pull request
+ @Nullable
+ String commitMessage();
+}
diff --git a/src/main/java/com/spotify/github/v3/prs/PullRequest.java b/src/main/java/com/spotify/github/v3/prs/PullRequest.java
index 0938d0f2..84b88504 100644
--- a/src/main/java/com/spotify/github/v3/prs/PullRequest.java
+++ b/src/main/java/com/spotify/github/v3/prs/PullRequest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -87,4 +87,7 @@ public interface PullRequest extends PullRequestItem {
@Nullable
List labels();
+
+ @Nullable
+ AutoMerge autoMerge();
}
diff --git a/src/test/java/com/spotify/github/v3/prs/PullRequestTest.java b/src/test/java/com/spotify/github/v3/prs/PullRequestTest.java
index fe640a39..5cedad6b 100644
--- a/src/test/java/com/spotify/github/v3/prs/PullRequestTest.java
+++ b/src/test/java/com/spotify/github/v3/prs/PullRequestTest.java
@@ -24,6 +24,8 @@
import static java.nio.charset.Charset.defaultCharset;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
import com.google.common.io.Resources;
import com.spotify.github.jackson.Json;
@@ -85,6 +87,36 @@ public void testSerializationMergeParams() throws IOException {
assertThat(params.mergeMethod(), is(MergeMethod.merge));
}
+ @Test
+ public void testSerializationAutoMergeDisabled() throws IOException {
+ String fixture =
+ Resources.toString(getResource(this.getClass(), "pull_request_automerge_disabled.json"), defaultCharset());
+ final PullRequest pr = Json.create().fromJson(fixture, PullRequest.class);
+
+ assertThat(pr.id(), is(2439836648L));
+ assertThat(pr.head().sha(), is("881ef333d1ffc01869b666f13d3b37d7af92b9a2"));
+ assertThat(pr.merged(), is(false));
+ assertThat(pr.mergeable().get(), is(true));
+ assertThat(pr.draft(), is(Optional.of(true)));
+ assertNull(pr.autoMerge());
+ }
+
+ @Test
+ public void testSerializationAutoMergeEnabled() throws IOException {
+ String fixture =
+ Resources.toString(getResource(this.getClass(), "pull_request_automerge_enabled.json"), defaultCharset());
+ final PullRequest pr = Json.create().fromJson(fixture, PullRequest.class);
+
+ assertThat(pr.id(), is(2439836648L));
+ assertThat(pr.head().sha(), is("881ef333d1ffc01869b666f13d3b37d7af92b9a2"));
+ assertThat(pr.merged(), is(false));
+ assertThat(pr.mergeable().get(), is(true));
+ assertThat(pr.draft(), is(Optional.of(false)));
+ assertNotNull(pr.autoMerge());
+ assertThat(pr.autoMerge().enabledBy().login(), is("octocat"));
+ assertThat(pr.autoMerge().mergeMethod(), is("squash"));
+ }
+
@Test
public void testDeserializationMergeParamsOmitsFields() throws IOException {
final MergeParameters params = ImmutableMergeParameters.builder()
diff --git a/src/test/resources/com/spotify/github/v3/prs/pull_request_automerge_disabled.json b/src/test/resources/com/spotify/github/v3/prs/pull_request_automerge_disabled.json
new file mode 100644
index 00000000..e4d01d2a
--- /dev/null
+++ b/src/test/resources/com/spotify/github/v3/prs/pull_request_automerge_disabled.json
@@ -0,0 +1,359 @@
+{
+ "url": "https://api.github.com/repos/spotify/github-java-client/pulls/226",
+ "id": 2439836648,
+ "node_id": "PR_kwDODynaQc6RbPPo",
+ "html_url": "https://github.com/spotify/github-java-client/pull/226",
+ "diff_url": "https://github.com/spotify/github-java-client/pull/226.diff",
+ "patch_url": "https://github.com/spotify/github-java-client/pull/226.patch",
+ "issue_url": "https://api.github.com/repos/spotify/github-java-client/issues/226",
+ "number": 226,
+ "state": "open",
+ "locked": false,
+ "title": "feat: Add auto_merge field to the PR class",
+ "user": {
+ "login": "octocat",
+ "id": 1445581,
+ "node_id": "MDQ6VXNlcjE0NDU1ODE=",
+ "avatar_url": "https://avatars.githubusercontent.com/u/1445581?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/octocat",
+ "html_url": "https://github.com/octocat",
+ "followers_url": "https://api.github.com/users/octocat/followers",
+ "following_url": "https://api.github.com/users/octocat/following{/other_user}",
+ "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
+ "organizations_url": "https://api.github.com/users/octocat/orgs",
+ "repos_url": "https://api.github.com/users/octocat/repos",
+ "events_url": "https://api.github.com/users/octocat/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/octocat/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "body": "Adds the auto_merge field to the PR class",
+ "created_at": "2025-04-04T15:21:13Z",
+ "updated_at": "2025-04-04T15:23:48Z",
+ "closed_at": null,
+ "merged_at": null,
+ "merge_commit_sha": "62862b387d19968ab0777ac90044929ece5b94ca",
+ "assignee": null,
+ "assignees": [],
+ "requested_reviewers": [],
+ "requested_teams": [],
+ "labels": [],
+ "milestone": null,
+ "draft": true,
+ "commits_url": "https://api.github.com/repos/spotify/github-java-client/pulls/226/commits",
+ "review_comments_url": "https://api.github.com/repos/spotify/github-java-client/pulls/226/comments",
+ "review_comment_url": "https://api.github.com/repos/spotify/github-java-client/pulls/comments{/number}",
+ "comments_url": "https://api.github.com/repos/spotify/github-java-client/issues/226/comments",
+ "statuses_url": "https://api.github.com/repos/spotify/github-java-client/statuses/881ef333d1ffc01869b666f13d3b37d7af92b9a2",
+ "head": {
+ "label": "spotify:feat/add-auto-merge-field",
+ "ref": "feat/add-auto-merge-field",
+ "sha": "881ef333d1ffc01869b666f13d3b37d7af92b9a2",
+ "user": {
+ "login": "spotify",
+ "id": 251374,
+ "node_id": "MDEyOk9yZ2FuaXphdGlvbjI1MTM3NA==",
+ "avatar_url": "https://avatars.githubusercontent.com/u/251374?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/spotify",
+ "html_url": "https://github.com/spotify",
+ "followers_url": "https://api.github.com/users/spotify/followers",
+ "following_url": "https://api.github.com/users/spotify/following{/other_user}",
+ "gists_url": "https://api.github.com/users/spotify/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/spotify/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/spotify/subscriptions",
+ "organizations_url": "https://api.github.com/users/spotify/orgs",
+ "repos_url": "https://api.github.com/users/spotify/repos",
+ "events_url": "https://api.github.com/users/spotify/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/spotify/received_events",
+ "type": "Organization",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "repo": {
+ "id": 254401089,
+ "node_id": "MDEwOlJlcG9zaXRvcnkyNTQ0MDEwODk=",
+ "name": "github-java-client",
+ "full_name": "spotify/github-java-client",
+ "private": false,
+ "owner": {
+ "login": "spotify",
+ "id": 251374,
+ "node_id": "MDEyOk9yZ2FuaXphdGlvbjI1MTM3NA==",
+ "avatar_url": "https://avatars.githubusercontent.com/u/251374?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/spotify",
+ "html_url": "https://github.com/spotify",
+ "followers_url": "https://api.github.com/users/spotify/followers",
+ "following_url": "https://api.github.com/users/spotify/following{/other_user}",
+ "gists_url": "https://api.github.com/users/spotify/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/spotify/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/spotify/subscriptions",
+ "organizations_url": "https://api.github.com/users/spotify/orgs",
+ "repos_url": "https://api.github.com/users/spotify/repos",
+ "events_url": "https://api.github.com/users/spotify/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/spotify/received_events",
+ "type": "Organization",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "html_url": "https://github.com/spotify/github-java-client",
+ "description": "A Java client to Github API",
+ "fork": false,
+ "url": "https://api.github.com/repos/spotify/github-java-client",
+ "forks_url": "https://api.github.com/repos/spotify/github-java-client/forks",
+ "keys_url": "https://api.github.com/repos/spotify/github-java-client/keys{/key_id}",
+ "collaborators_url": "https://api.github.com/repos/spotify/github-java-client/collaborators{/collaborator}",
+ "teams_url": "https://api.github.com/repos/spotify/github-java-client/teams",
+ "hooks_url": "https://api.github.com/repos/spotify/github-java-client/hooks",
+ "issue_events_url": "https://api.github.com/repos/spotify/github-java-client/issues/events{/number}",
+ "events_url": "https://api.github.com/repos/spotify/github-java-client/events",
+ "assignees_url": "https://api.github.com/repos/spotify/github-java-client/assignees{/user}",
+ "branches_url": "https://api.github.com/repos/spotify/github-java-client/branches{/branch}",
+ "tags_url": "https://api.github.com/repos/spotify/github-java-client/tags",
+ "blobs_url": "https://api.github.com/repos/spotify/github-java-client/git/blobs{/sha}",
+ "git_tags_url": "https://api.github.com/repos/spotify/github-java-client/git/tags{/sha}",
+ "git_refs_url": "https://api.github.com/repos/spotify/github-java-client/git/refs{/sha}",
+ "trees_url": "https://api.github.com/repos/spotify/github-java-client/git/trees{/sha}",
+ "statuses_url": "https://api.github.com/repos/spotify/github-java-client/statuses/{sha}",
+ "languages_url": "https://api.github.com/repos/spotify/github-java-client/languages",
+ "stargazers_url": "https://api.github.com/repos/spotify/github-java-client/stargazers",
+ "contributors_url": "https://api.github.com/repos/spotify/github-java-client/contributors",
+ "subscribers_url": "https://api.github.com/repos/spotify/github-java-client/subscribers",
+ "subscription_url": "https://api.github.com/repos/spotify/github-java-client/subscription",
+ "commits_url": "https://api.github.com/repos/spotify/github-java-client/commits{/sha}",
+ "git_commits_url": "https://api.github.com/repos/spotify/github-java-client/git/commits{/sha}",
+ "comments_url": "https://api.github.com/repos/spotify/github-java-client/comments{/number}",
+ "issue_comment_url": "https://api.github.com/repos/spotify/github-java-client/issues/comments{/number}",
+ "contents_url": "https://api.github.com/repos/spotify/github-java-client/contents/{+path}",
+ "compare_url": "https://api.github.com/repos/spotify/github-java-client/compare/{base}...{head}",
+ "merges_url": "https://api.github.com/repos/spotify/github-java-client/merges",
+ "archive_url": "https://api.github.com/repos/spotify/github-java-client/{archive_format}{/ref}",
+ "downloads_url": "https://api.github.com/repos/spotify/github-java-client/downloads",
+ "issues_url": "https://api.github.com/repos/spotify/github-java-client/issues{/number}",
+ "pulls_url": "https://api.github.com/repos/spotify/github-java-client/pulls{/number}",
+ "milestones_url": "https://api.github.com/repos/spotify/github-java-client/milestones{/number}",
+ "notifications_url": "https://api.github.com/repos/spotify/github-java-client/notifications{?since,all,participating}",
+ "labels_url": "https://api.github.com/repos/spotify/github-java-client/labels{/name}",
+ "releases_url": "https://api.github.com/repos/spotify/github-java-client/releases{/id}",
+ "deployments_url": "https://api.github.com/repos/spotify/github-java-client/deployments",
+ "created_at": "2020-04-09T14:55:56Z",
+ "updated_at": "2025-03-29T17:20:38Z",
+ "pushed_at": "2025-04-04T15:20:42Z",
+ "git_url": "git://github.com/spotify/github-java-client.git",
+ "ssh_url": "git@github.com:spotify/github-java-client.git",
+ "clone_url": "https://github.com/spotify/github-java-client.git",
+ "svn_url": "https://github.com/spotify/github-java-client",
+ "homepage": "",
+ "size": 3067,
+ "stargazers_count": 144,
+ "watchers_count": 144,
+ "language": "Java",
+ "has_issues": true,
+ "has_projects": false,
+ "has_downloads": true,
+ "has_wiki": false,
+ "has_pages": true,
+ "has_discussions": false,
+ "forks_count": 93,
+ "mirror_url": null,
+ "archived": false,
+ "disabled": false,
+ "open_issues_count": 23,
+ "license": {
+ "key": "apache-2.0",
+ "name": "Apache License 2.0",
+ "spdx_id": "Apache-2.0",
+ "url": "https://api.github.com/licenses/apache-2.0",
+ "node_id": "MDc6TGljZW5zZTI="
+ },
+ "allow_forking": true,
+ "is_template": false,
+ "web_commit_signoff_required": false,
+ "topics": [],
+ "visibility": "public",
+ "forks": 93,
+ "open_issues": 23,
+ "watchers": 144,
+ "default_branch": "master"
+ }
+ },
+ "base": {
+ "label": "spotify:master",
+ "ref": "master",
+ "sha": "bcd052d1b2508ae1e97cbeea16f198ce796743ad",
+ "user": {
+ "login": "spotify",
+ "id": 251374,
+ "node_id": "MDEyOk9yZ2FuaXphdGlvbjI1MTM3NA==",
+ "avatar_url": "https://avatars.githubusercontent.com/u/251374?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/spotify",
+ "html_url": "https://github.com/spotify",
+ "followers_url": "https://api.github.com/users/spotify/followers",
+ "following_url": "https://api.github.com/users/spotify/following{/other_user}",
+ "gists_url": "https://api.github.com/users/spotify/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/spotify/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/spotify/subscriptions",
+ "organizations_url": "https://api.github.com/users/spotify/orgs",
+ "repos_url": "https://api.github.com/users/spotify/repos",
+ "events_url": "https://api.github.com/users/spotify/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/spotify/received_events",
+ "type": "Organization",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "repo": {
+ "id": 254401089,
+ "node_id": "MDEwOlJlcG9zaXRvcnkyNTQ0MDEwODk=",
+ "name": "github-java-client",
+ "full_name": "spotify/github-java-client",
+ "private": false,
+ "owner": {
+ "login": "spotify",
+ "id": 251374,
+ "node_id": "MDEyOk9yZ2FuaXphdGlvbjI1MTM3NA==",
+ "avatar_url": "https://avatars.githubusercontent.com/u/251374?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/spotify",
+ "html_url": "https://github.com/spotify",
+ "followers_url": "https://api.github.com/users/spotify/followers",
+ "following_url": "https://api.github.com/users/spotify/following{/other_user}",
+ "gists_url": "https://api.github.com/users/spotify/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/spotify/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/spotify/subscriptions",
+ "organizations_url": "https://api.github.com/users/spotify/orgs",
+ "repos_url": "https://api.github.com/users/spotify/repos",
+ "events_url": "https://api.github.com/users/spotify/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/spotify/received_events",
+ "type": "Organization",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "html_url": "https://github.com/spotify/github-java-client",
+ "description": "A Java client to Github API",
+ "fork": false,
+ "url": "https://api.github.com/repos/spotify/github-java-client",
+ "forks_url": "https://api.github.com/repos/spotify/github-java-client/forks",
+ "keys_url": "https://api.github.com/repos/spotify/github-java-client/keys{/key_id}",
+ "collaborators_url": "https://api.github.com/repos/spotify/github-java-client/collaborators{/collaborator}",
+ "teams_url": "https://api.github.com/repos/spotify/github-java-client/teams",
+ "hooks_url": "https://api.github.com/repos/spotify/github-java-client/hooks",
+ "issue_events_url": "https://api.github.com/repos/spotify/github-java-client/issues/events{/number}",
+ "events_url": "https://api.github.com/repos/spotify/github-java-client/events",
+ "assignees_url": "https://api.github.com/repos/spotify/github-java-client/assignees{/user}",
+ "branches_url": "https://api.github.com/repos/spotify/github-java-client/branches{/branch}",
+ "tags_url": "https://api.github.com/repos/spotify/github-java-client/tags",
+ "blobs_url": "https://api.github.com/repos/spotify/github-java-client/git/blobs{/sha}",
+ "git_tags_url": "https://api.github.com/repos/spotify/github-java-client/git/tags{/sha}",
+ "git_refs_url": "https://api.github.com/repos/spotify/github-java-client/git/refs{/sha}",
+ "trees_url": "https://api.github.com/repos/spotify/github-java-client/git/trees{/sha}",
+ "statuses_url": "https://api.github.com/repos/spotify/github-java-client/statuses/{sha}",
+ "languages_url": "https://api.github.com/repos/spotify/github-java-client/languages",
+ "stargazers_url": "https://api.github.com/repos/spotify/github-java-client/stargazers",
+ "contributors_url": "https://api.github.com/repos/spotify/github-java-client/contributors",
+ "subscribers_url": "https://api.github.com/repos/spotify/github-java-client/subscribers",
+ "subscription_url": "https://api.github.com/repos/spotify/github-java-client/subscription",
+ "commits_url": "https://api.github.com/repos/spotify/github-java-client/commits{/sha}",
+ "git_commits_url": "https://api.github.com/repos/spotify/github-java-client/git/commits{/sha}",
+ "comments_url": "https://api.github.com/repos/spotify/github-java-client/comments{/number}",
+ "issue_comment_url": "https://api.github.com/repos/spotify/github-java-client/issues/comments{/number}",
+ "contents_url": "https://api.github.com/repos/spotify/github-java-client/contents/{+path}",
+ "compare_url": "https://api.github.com/repos/spotify/github-java-client/compare/{base}...{head}",
+ "merges_url": "https://api.github.com/repos/spotify/github-java-client/merges",
+ "archive_url": "https://api.github.com/repos/spotify/github-java-client/{archive_format}{/ref}",
+ "downloads_url": "https://api.github.com/repos/spotify/github-java-client/downloads",
+ "issues_url": "https://api.github.com/repos/spotify/github-java-client/issues{/number}",
+ "pulls_url": "https://api.github.com/repos/spotify/github-java-client/pulls{/number}",
+ "milestones_url": "https://api.github.com/repos/spotify/github-java-client/milestones{/number}",
+ "notifications_url": "https://api.github.com/repos/spotify/github-java-client/notifications{?since,all,participating}",
+ "labels_url": "https://api.github.com/repos/spotify/github-java-client/labels{/name}",
+ "releases_url": "https://api.github.com/repos/spotify/github-java-client/releases{/id}",
+ "deployments_url": "https://api.github.com/repos/spotify/github-java-client/deployments",
+ "created_at": "2020-04-09T14:55:56Z",
+ "updated_at": "2025-03-29T17:20:38Z",
+ "pushed_at": "2025-04-04T15:20:42Z",
+ "git_url": "git://github.com/spotify/github-java-client.git",
+ "ssh_url": "git@github.com:spotify/github-java-client.git",
+ "clone_url": "https://github.com/spotify/github-java-client.git",
+ "svn_url": "https://github.com/spotify/github-java-client",
+ "homepage": "",
+ "size": 3067,
+ "stargazers_count": 144,
+ "watchers_count": 144,
+ "language": "Java",
+ "has_issues": true,
+ "has_projects": false,
+ "has_downloads": true,
+ "has_wiki": false,
+ "has_pages": true,
+ "has_discussions": false,
+ "forks_count": 93,
+ "mirror_url": null,
+ "archived": false,
+ "disabled": false,
+ "open_issues_count": 23,
+ "license": {
+ "key": "apache-2.0",
+ "name": "Apache License 2.0",
+ "spdx_id": "Apache-2.0",
+ "url": "https://api.github.com/licenses/apache-2.0",
+ "node_id": "MDc6TGljZW5zZTI="
+ },
+ "allow_forking": true,
+ "is_template": false,
+ "web_commit_signoff_required": false,
+ "topics": [],
+ "visibility": "public",
+ "forks": 93,
+ "open_issues": 23,
+ "watchers": 144,
+ "default_branch": "master"
+ }
+ },
+ "_links": {
+ "self": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/pulls/226"
+ },
+ "html": {
+ "href": "https://github.com/spotify/github-java-client/pull/226"
+ },
+ "issue": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/issues/226"
+ },
+ "comments": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/issues/226/comments"
+ },
+ "review_comments": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/pulls/226/comments"
+ },
+ "review_comment": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/pulls/comments{/number}"
+ },
+ "commits": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/pulls/226/commits"
+ },
+ "statuses": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/statuses/881ef333d1ffc01869b666f13d3b37d7af92b9a2"
+ }
+ },
+ "author_association": "MEMBER",
+ "auto_merge": null,
+ "active_lock_reason": null,
+ "merged": false,
+ "mergeable": true,
+ "rebaseable": true,
+ "mergeable_state": "blocked",
+ "merged_by": null,
+ "comments": 1,
+ "review_comments": 0,
+ "maintainer_can_modify": false,
+ "commits": 1,
+ "additions": 54,
+ "deletions": 2,
+ "changed_files": 2
+}
\ No newline at end of file
diff --git a/src/test/resources/com/spotify/github/v3/prs/pull_request_automerge_enabled.json b/src/test/resources/com/spotify/github/v3/prs/pull_request_automerge_enabled.json
new file mode 100644
index 00000000..6d71517a
--- /dev/null
+++ b/src/test/resources/com/spotify/github/v3/prs/pull_request_automerge_enabled.json
@@ -0,0 +1,384 @@
+{
+ "url": "https://api.github.com/repos/spotify/github-java-client/pulls/226",
+ "id": 2439836648,
+ "node_id": "PR_kwDODynaQc6RbPPo",
+ "html_url": "https://github.com/spotify/github-java-client/pull/226",
+ "diff_url": "https://github.com/spotify/github-java-client/pull/226.diff",
+ "patch_url": "https://github.com/spotify/github-java-client/pull/226.patch",
+ "issue_url": "https://api.github.com/repos/spotify/github-java-client/issues/226",
+ "number": 226,
+ "state": "open",
+ "locked": false,
+ "title": "feat: Add auto_merge field to the PR class",
+ "user": {
+ "login": "octocat",
+ "id": 1445581,
+ "node_id": "MDQ6VXNlcjE0NDU1ODE=",
+ "avatar_url": "https://avatars.githubusercontent.com/u/1445581?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/octocat",
+ "html_url": "https://github.com/octocat",
+ "followers_url": "https://api.github.com/users/octocat/followers",
+ "following_url": "https://api.github.com/users/octocat/following{/other_user}",
+ "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
+ "organizations_url": "https://api.github.com/users/octocat/orgs",
+ "repos_url": "https://api.github.com/users/octocat/repos",
+ "events_url": "https://api.github.com/users/octocat/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/octocat/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "body": "Adds the auto_merge field to the PR class",
+ "created_at": "2025-04-04T15:21:13Z",
+ "updated_at": "2025-04-05T07:45:19Z",
+ "closed_at": null,
+ "merged_at": null,
+ "merge_commit_sha": "62862b387d19968ab0777ac90044929ece5b94ca",
+ "assignee": null,
+ "assignees": [],
+ "requested_reviewers": [],
+ "requested_teams": [],
+ "labels": [],
+ "milestone": null,
+ "draft": false,
+ "commits_url": "https://api.github.com/repos/spotify/github-java-client/pulls/226/commits",
+ "review_comments_url": "https://api.github.com/repos/spotify/github-java-client/pulls/226/comments",
+ "review_comment_url": "https://api.github.com/repos/spotify/github-java-client/pulls/comments{/number}",
+ "comments_url": "https://api.github.com/repos/spotify/github-java-client/issues/226/comments",
+ "statuses_url": "https://api.github.com/repos/spotify/github-java-client/statuses/881ef333d1ffc01869b666f13d3b37d7af92b9a2",
+ "head": {
+ "label": "spotify:feat/add-auto-merge-field",
+ "ref": "feat/add-auto-merge-field",
+ "sha": "881ef333d1ffc01869b666f13d3b37d7af92b9a2",
+ "user": {
+ "login": "spotify",
+ "id": 251374,
+ "node_id": "MDEyOk9yZ2FuaXphdGlvbjI1MTM3NA==",
+ "avatar_url": "https://avatars.githubusercontent.com/u/251374?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/spotify",
+ "html_url": "https://github.com/spotify",
+ "followers_url": "https://api.github.com/users/spotify/followers",
+ "following_url": "https://api.github.com/users/spotify/following{/other_user}",
+ "gists_url": "https://api.github.com/users/spotify/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/spotify/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/spotify/subscriptions",
+ "organizations_url": "https://api.github.com/users/spotify/orgs",
+ "repos_url": "https://api.github.com/users/spotify/repos",
+ "events_url": "https://api.github.com/users/spotify/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/spotify/received_events",
+ "type": "Organization",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "repo": {
+ "id": 254401089,
+ "node_id": "MDEwOlJlcG9zaXRvcnkyNTQ0MDEwODk=",
+ "name": "github-java-client",
+ "full_name": "spotify/github-java-client",
+ "private": false,
+ "owner": {
+ "login": "spotify",
+ "id": 251374,
+ "node_id": "MDEyOk9yZ2FuaXphdGlvbjI1MTM3NA==",
+ "avatar_url": "https://avatars.githubusercontent.com/u/251374?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/spotify",
+ "html_url": "https://github.com/spotify",
+ "followers_url": "https://api.github.com/users/spotify/followers",
+ "following_url": "https://api.github.com/users/spotify/following{/other_user}",
+ "gists_url": "https://api.github.com/users/spotify/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/spotify/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/spotify/subscriptions",
+ "organizations_url": "https://api.github.com/users/spotify/orgs",
+ "repos_url": "https://api.github.com/users/spotify/repos",
+ "events_url": "https://api.github.com/users/spotify/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/spotify/received_events",
+ "type": "Organization",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "html_url": "https://github.com/spotify/github-java-client",
+ "description": "A Java client to Github API",
+ "fork": false,
+ "url": "https://api.github.com/repos/spotify/github-java-client",
+ "forks_url": "https://api.github.com/repos/spotify/github-java-client/forks",
+ "keys_url": "https://api.github.com/repos/spotify/github-java-client/keys{/key_id}",
+ "collaborators_url": "https://api.github.com/repos/spotify/github-java-client/collaborators{/collaborator}",
+ "teams_url": "https://api.github.com/repos/spotify/github-java-client/teams",
+ "hooks_url": "https://api.github.com/repos/spotify/github-java-client/hooks",
+ "issue_events_url": "https://api.github.com/repos/spotify/github-java-client/issues/events{/number}",
+ "events_url": "https://api.github.com/repos/spotify/github-java-client/events",
+ "assignees_url": "https://api.github.com/repos/spotify/github-java-client/assignees{/user}",
+ "branches_url": "https://api.github.com/repos/spotify/github-java-client/branches{/branch}",
+ "tags_url": "https://api.github.com/repos/spotify/github-java-client/tags",
+ "blobs_url": "https://api.github.com/repos/spotify/github-java-client/git/blobs{/sha}",
+ "git_tags_url": "https://api.github.com/repos/spotify/github-java-client/git/tags{/sha}",
+ "git_refs_url": "https://api.github.com/repos/spotify/github-java-client/git/refs{/sha}",
+ "trees_url": "https://api.github.com/repos/spotify/github-java-client/git/trees{/sha}",
+ "statuses_url": "https://api.github.com/repos/spotify/github-java-client/statuses/{sha}",
+ "languages_url": "https://api.github.com/repos/spotify/github-java-client/languages",
+ "stargazers_url": "https://api.github.com/repos/spotify/github-java-client/stargazers",
+ "contributors_url": "https://api.github.com/repos/spotify/github-java-client/contributors",
+ "subscribers_url": "https://api.github.com/repos/spotify/github-java-client/subscribers",
+ "subscription_url": "https://api.github.com/repos/spotify/github-java-client/subscription",
+ "commits_url": "https://api.github.com/repos/spotify/github-java-client/commits{/sha}",
+ "git_commits_url": "https://api.github.com/repos/spotify/github-java-client/git/commits{/sha}",
+ "comments_url": "https://api.github.com/repos/spotify/github-java-client/comments{/number}",
+ "issue_comment_url": "https://api.github.com/repos/spotify/github-java-client/issues/comments{/number}",
+ "contents_url": "https://api.github.com/repos/spotify/github-java-client/contents/{+path}",
+ "compare_url": "https://api.github.com/repos/spotify/github-java-client/compare/{base}...{head}",
+ "merges_url": "https://api.github.com/repos/spotify/github-java-client/merges",
+ "archive_url": "https://api.github.com/repos/spotify/github-java-client/{archive_format}{/ref}",
+ "downloads_url": "https://api.github.com/repos/spotify/github-java-client/downloads",
+ "issues_url": "https://api.github.com/repos/spotify/github-java-client/issues{/number}",
+ "pulls_url": "https://api.github.com/repos/spotify/github-java-client/pulls{/number}",
+ "milestones_url": "https://api.github.com/repos/spotify/github-java-client/milestones{/number}",
+ "notifications_url": "https://api.github.com/repos/spotify/github-java-client/notifications{?since,all,participating}",
+ "labels_url": "https://api.github.com/repos/spotify/github-java-client/labels{/name}",
+ "releases_url": "https://api.github.com/repos/spotify/github-java-client/releases{/id}",
+ "deployments_url": "https://api.github.com/repos/spotify/github-java-client/deployments",
+ "created_at": "2020-04-09T14:55:56Z",
+ "updated_at": "2025-03-29T17:20:38Z",
+ "pushed_at": "2025-04-04T15:20:42Z",
+ "git_url": "git://github.com/spotify/github-java-client.git",
+ "ssh_url": "git@github.com:spotify/github-java-client.git",
+ "clone_url": "https://github.com/spotify/github-java-client.git",
+ "svn_url": "https://github.com/spotify/github-java-client",
+ "homepage": "",
+ "size": 3067,
+ "stargazers_count": 144,
+ "watchers_count": 144,
+ "language": "Java",
+ "has_issues": true,
+ "has_projects": false,
+ "has_downloads": true,
+ "has_wiki": false,
+ "has_pages": true,
+ "has_discussions": false,
+ "forks_count": 93,
+ "mirror_url": null,
+ "archived": false,
+ "disabled": false,
+ "open_issues_count": 23,
+ "license": {
+ "key": "apache-2.0",
+ "name": "Apache License 2.0",
+ "spdx_id": "Apache-2.0",
+ "url": "https://api.github.com/licenses/apache-2.0",
+ "node_id": "MDc6TGljZW5zZTI="
+ },
+ "allow_forking": true,
+ "is_template": false,
+ "web_commit_signoff_required": false,
+ "topics": [],
+ "visibility": "public",
+ "forks": 93,
+ "open_issues": 23,
+ "watchers": 144,
+ "default_branch": "master"
+ }
+ },
+ "base": {
+ "label": "spotify:master",
+ "ref": "master",
+ "sha": "bcd052d1b2508ae1e97cbeea16f198ce796743ad",
+ "user": {
+ "login": "spotify",
+ "id": 251374,
+ "node_id": "MDEyOk9yZ2FuaXphdGlvbjI1MTM3NA==",
+ "avatar_url": "https://avatars.githubusercontent.com/u/251374?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/spotify",
+ "html_url": "https://github.com/spotify",
+ "followers_url": "https://api.github.com/users/spotify/followers",
+ "following_url": "https://api.github.com/users/spotify/following{/other_user}",
+ "gists_url": "https://api.github.com/users/spotify/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/spotify/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/spotify/subscriptions",
+ "organizations_url": "https://api.github.com/users/spotify/orgs",
+ "repos_url": "https://api.github.com/users/spotify/repos",
+ "events_url": "https://api.github.com/users/spotify/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/spotify/received_events",
+ "type": "Organization",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "repo": {
+ "id": 254401089,
+ "node_id": "MDEwOlJlcG9zaXRvcnkyNTQ0MDEwODk=",
+ "name": "github-java-client",
+ "full_name": "spotify/github-java-client",
+ "private": false,
+ "owner": {
+ "login": "spotify",
+ "id": 251374,
+ "node_id": "MDEyOk9yZ2FuaXphdGlvbjI1MTM3NA==",
+ "avatar_url": "https://avatars.githubusercontent.com/u/251374?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/spotify",
+ "html_url": "https://github.com/spotify",
+ "followers_url": "https://api.github.com/users/spotify/followers",
+ "following_url": "https://api.github.com/users/spotify/following{/other_user}",
+ "gists_url": "https://api.github.com/users/spotify/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/spotify/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/spotify/subscriptions",
+ "organizations_url": "https://api.github.com/users/spotify/orgs",
+ "repos_url": "https://api.github.com/users/spotify/repos",
+ "events_url": "https://api.github.com/users/spotify/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/spotify/received_events",
+ "type": "Organization",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "html_url": "https://github.com/spotify/github-java-client",
+ "description": "A Java client to Github API",
+ "fork": false,
+ "url": "https://api.github.com/repos/spotify/github-java-client",
+ "forks_url": "https://api.github.com/repos/spotify/github-java-client/forks",
+ "keys_url": "https://api.github.com/repos/spotify/github-java-client/keys{/key_id}",
+ "collaborators_url": "https://api.github.com/repos/spotify/github-java-client/collaborators{/collaborator}",
+ "teams_url": "https://api.github.com/repos/spotify/github-java-client/teams",
+ "hooks_url": "https://api.github.com/repos/spotify/github-java-client/hooks",
+ "issue_events_url": "https://api.github.com/repos/spotify/github-java-client/issues/events{/number}",
+ "events_url": "https://api.github.com/repos/spotify/github-java-client/events",
+ "assignees_url": "https://api.github.com/repos/spotify/github-java-client/assignees{/user}",
+ "branches_url": "https://api.github.com/repos/spotify/github-java-client/branches{/branch}",
+ "tags_url": "https://api.github.com/repos/spotify/github-java-client/tags",
+ "blobs_url": "https://api.github.com/repos/spotify/github-java-client/git/blobs{/sha}",
+ "git_tags_url": "https://api.github.com/repos/spotify/github-java-client/git/tags{/sha}",
+ "git_refs_url": "https://api.github.com/repos/spotify/github-java-client/git/refs{/sha}",
+ "trees_url": "https://api.github.com/repos/spotify/github-java-client/git/trees{/sha}",
+ "statuses_url": "https://api.github.com/repos/spotify/github-java-client/statuses/{sha}",
+ "languages_url": "https://api.github.com/repos/spotify/github-java-client/languages",
+ "stargazers_url": "https://api.github.com/repos/spotify/github-java-client/stargazers",
+ "contributors_url": "https://api.github.com/repos/spotify/github-java-client/contributors",
+ "subscribers_url": "https://api.github.com/repos/spotify/github-java-client/subscribers",
+ "subscription_url": "https://api.github.com/repos/spotify/github-java-client/subscription",
+ "commits_url": "https://api.github.com/repos/spotify/github-java-client/commits{/sha}",
+ "git_commits_url": "https://api.github.com/repos/spotify/github-java-client/git/commits{/sha}",
+ "comments_url": "https://api.github.com/repos/spotify/github-java-client/comments{/number}",
+ "issue_comment_url": "https://api.github.com/repos/spotify/github-java-client/issues/comments{/number}",
+ "contents_url": "https://api.github.com/repos/spotify/github-java-client/contents/{+path}",
+ "compare_url": "https://api.github.com/repos/spotify/github-java-client/compare/{base}...{head}",
+ "merges_url": "https://api.github.com/repos/spotify/github-java-client/merges",
+ "archive_url": "https://api.github.com/repos/spotify/github-java-client/{archive_format}{/ref}",
+ "downloads_url": "https://api.github.com/repos/spotify/github-java-client/downloads",
+ "issues_url": "https://api.github.com/repos/spotify/github-java-client/issues{/number}",
+ "pulls_url": "https://api.github.com/repos/spotify/github-java-client/pulls{/number}",
+ "milestones_url": "https://api.github.com/repos/spotify/github-java-client/milestones{/number}",
+ "notifications_url": "https://api.github.com/repos/spotify/github-java-client/notifications{?since,all,participating}",
+ "labels_url": "https://api.github.com/repos/spotify/github-java-client/labels{/name}",
+ "releases_url": "https://api.github.com/repos/spotify/github-java-client/releases{/id}",
+ "deployments_url": "https://api.github.com/repos/spotify/github-java-client/deployments",
+ "created_at": "2020-04-09T14:55:56Z",
+ "updated_at": "2025-03-29T17:20:38Z",
+ "pushed_at": "2025-04-04T15:20:42Z",
+ "git_url": "git://github.com/spotify/github-java-client.git",
+ "ssh_url": "git@github.com:spotify/github-java-client.git",
+ "clone_url": "https://github.com/spotify/github-java-client.git",
+ "svn_url": "https://github.com/spotify/github-java-client",
+ "homepage": "",
+ "size": 3067,
+ "stargazers_count": 144,
+ "watchers_count": 144,
+ "language": "Java",
+ "has_issues": true,
+ "has_projects": false,
+ "has_downloads": true,
+ "has_wiki": false,
+ "has_pages": true,
+ "has_discussions": false,
+ "forks_count": 93,
+ "mirror_url": null,
+ "archived": false,
+ "disabled": false,
+ "open_issues_count": 23,
+ "license": {
+ "key": "apache-2.0",
+ "name": "Apache License 2.0",
+ "spdx_id": "Apache-2.0",
+ "url": "https://api.github.com/licenses/apache-2.0",
+ "node_id": "MDc6TGljZW5zZTI="
+ },
+ "allow_forking": true,
+ "is_template": false,
+ "web_commit_signoff_required": false,
+ "topics": [],
+ "visibility": "public",
+ "forks": 93,
+ "open_issues": 23,
+ "watchers": 144,
+ "default_branch": "master"
+ }
+ },
+ "_links": {
+ "self": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/pulls/226"
+ },
+ "html": {
+ "href": "https://github.com/spotify/github-java-client/pull/226"
+ },
+ "issue": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/issues/226"
+ },
+ "comments": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/issues/226/comments"
+ },
+ "review_comments": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/pulls/226/comments"
+ },
+ "review_comment": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/pulls/comments{/number}"
+ },
+ "commits": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/pulls/226/commits"
+ },
+ "statuses": {
+ "href": "https://api.github.com/repos/spotify/github-java-client/statuses/881ef333d1ffc01869b666f13d3b37d7af92b9a2"
+ }
+ },
+ "author_association": "MEMBER",
+ "auto_merge": {
+ "enabled_by": {
+ "login": "octocat",
+ "id": 1445581,
+ "node_id": "MDQ6VXNlcjE0NDU1ODE=",
+ "avatar_url": "https://avatars.githubusercontent.com/u/1445581?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/octocat",
+ "html_url": "https://github.com/octocat",
+ "followers_url": "https://api.github.com/users/octocat/followers",
+ "following_url": "https://api.github.com/users/octocat/following{/other_user}",
+ "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
+ "organizations_url": "https://api.github.com/users/octocat/orgs",
+ "repos_url": "https://api.github.com/users/octocat/repos",
+ "events_url": "https://api.github.com/users/octocat/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/octocat/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "merge_method": "squash",
+ "commit_title": "feat: Add auto_merge field to the PR class (#226)",
+ "commit_message": ""
+ },
+ "active_lock_reason": null,
+ "merged": false,
+ "mergeable": true,
+ "rebaseable": true,
+ "mergeable_state": "blocked",
+ "merged_by": null,
+ "comments": 1,
+ "review_comments": 0,
+ "maintainer_can_modify": false,
+ "commits": 1,
+ "additions": 54,
+ "deletions": 2,
+ "changed_files": 2
+}
\ No newline at end of file