From 9f14128b18546a7592a49a553e857948f680c5ae Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 12 Jun 2023 11:27:20 -0700 Subject: [PATCH] Add test for merge_upstream conflict. --- .../00-GET-repos_ehuss_rust.json | 356 ++++++++++++++++++ ...-POST-repos_ehuss_rust_merge-upstream.json | 12 + ...s_rust-lang_rust_git_ref_heads_master.json | 18 + ...epos_ehuss_rust_git_refs_heads_master.json | 18 + tests/github_client/mod.rs | 16 + .../00-GET-repos_rust-lang_rust.json | 26 +- .../repository/01-GET-repos_ehuss_rust.json | 356 ++++++++++++++++++ 7 files changed, 789 insertions(+), 13 deletions(-) create mode 100644 tests/github_client/merge_upstream_conflict/00-GET-repos_ehuss_rust.json create mode 100644 tests/github_client/merge_upstream_conflict/01-POST-repos_ehuss_rust_merge-upstream.json create mode 100644 tests/github_client/merge_upstream_conflict/02-GET-repos_rust-lang_rust_git_ref_heads_master.json create mode 100644 tests/github_client/merge_upstream_conflict/03-PATCH-repos_ehuss_rust_git_refs_heads_master.json create mode 100644 tests/github_client/repository/01-GET-repos_ehuss_rust.json diff --git a/tests/github_client/merge_upstream_conflict/00-GET-repos_ehuss_rust.json b/tests/github_client/merge_upstream_conflict/00-GET-repos_ehuss_rust.json new file mode 100644 index 00000000..275fd36a --- /dev/null +++ b/tests/github_client/merge_upstream_conflict/00-GET-repos_ehuss_rust.json @@ -0,0 +1,356 @@ +{ + "kind": "Request", + "method": "GET", + "path": "/repos/ehuss/rust", + "query": null, + "request_body": "", + "response_code": 200, + "response_body": { + "allow_auto_merge": false, + "allow_forking": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_squash_merge": true, + "allow_update_branch": false, + "archive_url": "https://api.github.com/repos/ehuss/rust/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/ehuss/rust/assignees{/user}", + "blobs_url": "https://api.github.com/repos/ehuss/rust/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/ehuss/rust/branches{/branch}", + "clone_url": "https://github.com/ehuss/rust.git", + "collaborators_url": "https://api.github.com/repos/ehuss/rust/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/ehuss/rust/comments{/number}", + "commits_url": "https://api.github.com/repos/ehuss/rust/commits{/sha}", + "compare_url": "https://api.github.com/repos/ehuss/rust/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/ehuss/rust/contents/{+path}", + "contributors_url": "https://api.github.com/repos/ehuss/rust/contributors", + "created_at": "2018-01-14T20:35:48Z", + "default_branch": "master", + "delete_branch_on_merge": false, + "deployments_url": "https://api.github.com/repos/ehuss/rust/deployments", + "description": "A safe, concurrent, practical language.", + "disabled": false, + "downloads_url": "https://api.github.com/repos/ehuss/rust/downloads", + "events_url": "https://api.github.com/repos/ehuss/rust/events", + "fork": true, + "forks": 0, + "forks_count": 0, + "forks_url": "https://api.github.com/repos/ehuss/rust/forks", + "full_name": "ehuss/rust", + "git_commits_url": "https://api.github.com/repos/ehuss/rust/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/ehuss/rust/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/ehuss/rust/git/tags{/sha}", + "git_url": "git://github.com/ehuss/rust.git", + "has_discussions": false, + "has_downloads": true, + "has_issues": false, + "has_pages": true, + "has_projects": true, + "has_wiki": false, + "homepage": "https://www.rust-lang.org", + "hooks_url": "https://api.github.com/repos/ehuss/rust/hooks", + "html_url": "https://github.com/ehuss/rust", + "id": 117464625, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/ehuss/rust/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/ehuss/rust/issues/events{/number}", + "issues_url": "https://api.github.com/repos/ehuss/rust/issues{/number}", + "keys_url": "https://api.github.com/repos/ehuss/rust/keys{/key_id}", + "labels_url": "https://api.github.com/repos/ehuss/rust/labels{/name}", + "language": "Rust", + "languages_url": "https://api.github.com/repos/ehuss/rust/languages", + "license": { + "key": "other", + "name": "Other", + "node_id": "MDc6TGljZW5zZTA=", + "spdx_id": "NOASSERTION", + "url": null + }, + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "merges_url": "https://api.github.com/repos/ehuss/rust/merges", + "milestones_url": "https://api.github.com/repos/ehuss/rust/milestones{/number}", + "mirror_url": null, + "name": "rust", + "network_count": 10902, + "node_id": "MDEwOlJlcG9zaXRvcnkxMTc0NjQ2MjU=", + "notifications_url": "https://api.github.com/repos/ehuss/rust/notifications{?since,all,participating}", + "open_issues": 0, + "open_issues_count": 0, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/43198?v=4", + "events_url": "https://api.github.com/users/ehuss/events{/privacy}", + "followers_url": "https://api.github.com/users/ehuss/followers", + "following_url": "https://api.github.com/users/ehuss/following{/other_user}", + "gists_url": "https://api.github.com/users/ehuss/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/ehuss", + "id": 43198, + "login": "ehuss", + "node_id": "MDQ6VXNlcjQzMTk4", + "organizations_url": "https://api.github.com/users/ehuss/orgs", + "received_events_url": "https://api.github.com/users/ehuss/received_events", + "repos_url": "https://api.github.com/users/ehuss/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/ehuss/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/ehuss/subscriptions", + "type": "User", + "url": "https://api.github.com/users/ehuss" + }, + "parent": { + "allow_forking": true, + "archive_url": "https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/rust-lang/rust/assignees{/user}", + "blobs_url": "https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/rust-lang/rust/branches{/branch}", + "clone_url": "https://github.com/rust-lang/rust.git", + "collaborators_url": "https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/rust-lang/rust/comments{/number}", + "commits_url": "https://api.github.com/repos/rust-lang/rust/commits{/sha}", + "compare_url": "https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/rust-lang/rust/contents/{+path}", + "contributors_url": "https://api.github.com/repos/rust-lang/rust/contributors", + "created_at": "2010-06-16T20:39:03Z", + "default_branch": "master", + "deployments_url": "https://api.github.com/repos/rust-lang/rust/deployments", + "description": "Empowering everyone to build reliable and efficient software.", + "disabled": false, + "downloads_url": "https://api.github.com/repos/rust-lang/rust/downloads", + "events_url": "https://api.github.com/repos/rust-lang/rust/events", + "fork": false, + "forks": 10902, + "forks_count": 10902, + "forks_url": "https://api.github.com/repos/rust-lang/rust/forks", + "full_name": "rust-lang/rust", + "git_commits_url": "https://api.github.com/repos/rust-lang/rust/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/rust-lang/rust/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/rust-lang/rust/git/tags{/sha}", + "git_url": "git://github.com/rust-lang/rust.git", + "has_discussions": false, + "has_downloads": true, + "has_issues": true, + "has_pages": false, + "has_projects": true, + "has_wiki": false, + "homepage": "https://www.rust-lang.org", + "hooks_url": "https://api.github.com/repos/rust-lang/rust/hooks", + "html_url": "https://github.com/rust-lang/rust", + "id": 724712, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/rust-lang/rust/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/rust-lang/rust/issues/events{/number}", + "issues_url": "https://api.github.com/repos/rust-lang/rust/issues{/number}", + "keys_url": "https://api.github.com/repos/rust-lang/rust/keys{/key_id}", + "labels_url": "https://api.github.com/repos/rust-lang/rust/labels{/name}", + "language": "Rust", + "languages_url": "https://api.github.com/repos/rust-lang/rust/languages", + "license": { + "key": "other", + "name": "Other", + "node_id": "MDc6TGljZW5zZTA=", + "spdx_id": "NOASSERTION", + "url": null + }, + "merges_url": "https://api.github.com/repos/rust-lang/rust/merges", + "milestones_url": "https://api.github.com/repos/rust-lang/rust/milestones{/number}", + "mirror_url": null, + "name": "rust", + "node_id": "MDEwOlJlcG9zaXRvcnk3MjQ3MTI=", + "notifications_url": "https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}", + "open_issues": 9613, + "open_issues_count": 9613, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/5430905?v=4", + "events_url": "https://api.github.com/users/rust-lang/events{/privacy}", + "followers_url": "https://api.github.com/users/rust-lang/followers", + "following_url": "https://api.github.com/users/rust-lang/following{/other_user}", + "gists_url": "https://api.github.com/users/rust-lang/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/rust-lang", + "id": 5430905, + "login": "rust-lang", + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0MzA5MDU=", + "organizations_url": "https://api.github.com/users/rust-lang/orgs", + "received_events_url": "https://api.github.com/users/rust-lang/received_events", + "repos_url": "https://api.github.com/users/rust-lang/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/rust-lang/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/rust-lang/subscriptions", + "type": "Organization", + "url": "https://api.github.com/users/rust-lang" + }, + "private": false, + "pulls_url": "https://api.github.com/repos/rust-lang/rust/pulls{/number}", + "pushed_at": "2023-06-12T17:58:57Z", + "releases_url": "https://api.github.com/repos/rust-lang/rust/releases{/id}", + "size": 894511, + "ssh_url": "git@github.com:rust-lang/rust.git", + "stargazers_count": 82555, + "stargazers_url": "https://api.github.com/repos/rust-lang/rust/stargazers", + "statuses_url": "https://api.github.com/repos/rust-lang/rust/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/rust-lang/rust/subscribers", + "subscription_url": "https://api.github.com/repos/rust-lang/rust/subscription", + "svn_url": "https://github.com/rust-lang/rust", + "tags_url": "https://api.github.com/repos/rust-lang/rust/tags", + "teams_url": "https://api.github.com/repos/rust-lang/rust/teams", + "topics": [ + "compiler", + "hacktoberfest", + "language", + "rust" + ], + "trees_url": "https://api.github.com/repos/rust-lang/rust/git/trees{/sha}", + "updated_at": "2023-06-12T18:19:44Z", + "url": "https://api.github.com/repos/rust-lang/rust", + "visibility": "public", + "watchers": 82555, + "watchers_count": 82555, + "web_commit_signoff_required": false + }, + "permissions": { + "admin": true, + "maintain": true, + "pull": true, + "push": true, + "triage": true + }, + "private": false, + "pulls_url": "https://api.github.com/repos/ehuss/rust/pulls{/number}", + "pushed_at": "2023-06-12T18:22:29Z", + "releases_url": "https://api.github.com/repos/ehuss/rust/releases{/id}", + "size": 887983, + "source": { + "allow_forking": true, + "archive_url": "https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/rust-lang/rust/assignees{/user}", + "blobs_url": "https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/rust-lang/rust/branches{/branch}", + "clone_url": "https://github.com/rust-lang/rust.git", + "collaborators_url": "https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/rust-lang/rust/comments{/number}", + "commits_url": "https://api.github.com/repos/rust-lang/rust/commits{/sha}", + "compare_url": "https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/rust-lang/rust/contents/{+path}", + "contributors_url": "https://api.github.com/repos/rust-lang/rust/contributors", + "created_at": "2010-06-16T20:39:03Z", + "default_branch": "master", + "deployments_url": "https://api.github.com/repos/rust-lang/rust/deployments", + "description": "Empowering everyone to build reliable and efficient software.", + "disabled": false, + "downloads_url": "https://api.github.com/repos/rust-lang/rust/downloads", + "events_url": "https://api.github.com/repos/rust-lang/rust/events", + "fork": false, + "forks": 10902, + "forks_count": 10902, + "forks_url": "https://api.github.com/repos/rust-lang/rust/forks", + "full_name": "rust-lang/rust", + "git_commits_url": "https://api.github.com/repos/rust-lang/rust/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/rust-lang/rust/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/rust-lang/rust/git/tags{/sha}", + "git_url": "git://github.com/rust-lang/rust.git", + "has_discussions": false, + "has_downloads": true, + "has_issues": true, + "has_pages": false, + "has_projects": true, + "has_wiki": false, + "homepage": "https://www.rust-lang.org", + "hooks_url": "https://api.github.com/repos/rust-lang/rust/hooks", + "html_url": "https://github.com/rust-lang/rust", + "id": 724712, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/rust-lang/rust/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/rust-lang/rust/issues/events{/number}", + "issues_url": "https://api.github.com/repos/rust-lang/rust/issues{/number}", + "keys_url": "https://api.github.com/repos/rust-lang/rust/keys{/key_id}", + "labels_url": "https://api.github.com/repos/rust-lang/rust/labels{/name}", + "language": "Rust", + "languages_url": "https://api.github.com/repos/rust-lang/rust/languages", + "license": { + "key": "other", + "name": "Other", + "node_id": "MDc6TGljZW5zZTA=", + "spdx_id": "NOASSERTION", + "url": null + }, + "merges_url": "https://api.github.com/repos/rust-lang/rust/merges", + "milestones_url": "https://api.github.com/repos/rust-lang/rust/milestones{/number}", + "mirror_url": null, + "name": "rust", + "node_id": "MDEwOlJlcG9zaXRvcnk3MjQ3MTI=", + "notifications_url": "https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}", + "open_issues": 9613, + "open_issues_count": 9613, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/5430905?v=4", + "events_url": "https://api.github.com/users/rust-lang/events{/privacy}", + "followers_url": "https://api.github.com/users/rust-lang/followers", + "following_url": "https://api.github.com/users/rust-lang/following{/other_user}", + "gists_url": "https://api.github.com/users/rust-lang/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/rust-lang", + "id": 5430905, + "login": "rust-lang", + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0MzA5MDU=", + "organizations_url": "https://api.github.com/users/rust-lang/orgs", + "received_events_url": "https://api.github.com/users/rust-lang/received_events", + "repos_url": "https://api.github.com/users/rust-lang/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/rust-lang/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/rust-lang/subscriptions", + "type": "Organization", + "url": "https://api.github.com/users/rust-lang" + }, + "private": false, + "pulls_url": "https://api.github.com/repos/rust-lang/rust/pulls{/number}", + "pushed_at": "2023-06-12T17:58:57Z", + "releases_url": "https://api.github.com/repos/rust-lang/rust/releases{/id}", + "size": 894511, + "ssh_url": "git@github.com:rust-lang/rust.git", + "stargazers_count": 82555, + "stargazers_url": "https://api.github.com/repos/rust-lang/rust/stargazers", + "statuses_url": "https://api.github.com/repos/rust-lang/rust/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/rust-lang/rust/subscribers", + "subscription_url": "https://api.github.com/repos/rust-lang/rust/subscription", + "svn_url": "https://github.com/rust-lang/rust", + "tags_url": "https://api.github.com/repos/rust-lang/rust/tags", + "teams_url": "https://api.github.com/repos/rust-lang/rust/teams", + "topics": [ + "compiler", + "hacktoberfest", + "language", + "rust" + ], + "trees_url": "https://api.github.com/repos/rust-lang/rust/git/trees{/sha}", + "updated_at": "2023-06-12T18:19:44Z", + "url": "https://api.github.com/repos/rust-lang/rust", + "visibility": "public", + "watchers": 82555, + "watchers_count": 82555, + "web_commit_signoff_required": false + }, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "ssh_url": "git@github.com:ehuss/rust.git", + "stargazers_count": 0, + "stargazers_url": "https://api.github.com/repos/ehuss/rust/stargazers", + "statuses_url": "https://api.github.com/repos/ehuss/rust/statuses/{sha}", + "subscribers_count": 0, + "subscribers_url": "https://api.github.com/repos/ehuss/rust/subscribers", + "subscription_url": "https://api.github.com/repos/ehuss/rust/subscription", + "svn_url": "https://github.com/ehuss/rust", + "tags_url": "https://api.github.com/repos/ehuss/rust/tags", + "teams_url": "https://api.github.com/repos/ehuss/rust/teams", + "topics": [], + "trees_url": "https://api.github.com/repos/ehuss/rust/git/trees{/sha}", + "updated_at": "2021-11-03T23:44:04Z", + "url": "https://api.github.com/repos/ehuss/rust", + "use_squash_pr_title_as_default": false, + "visibility": "public", + "watchers": 0, + "watchers_count": 0, + "web_commit_signoff_required": false + } +} \ No newline at end of file diff --git a/tests/github_client/merge_upstream_conflict/01-POST-repos_ehuss_rust_merge-upstream.json b/tests/github_client/merge_upstream_conflict/01-POST-repos_ehuss_rust_merge-upstream.json new file mode 100644 index 00000000..97587b64 --- /dev/null +++ b/tests/github_client/merge_upstream_conflict/01-POST-repos_ehuss_rust_merge-upstream.json @@ -0,0 +1,12 @@ +{ + "kind": "Request", + "method": "POST", + "path": "/repos/ehuss/rust/merge-upstream", + "query": null, + "request_body": "{\"branch\":\"master\"}", + "response_code": 409, + "response_body": { + "documentation_url": "https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository", + "message": "There are merge conflicts" + } +} \ No newline at end of file diff --git a/tests/github_client/merge_upstream_conflict/02-GET-repos_rust-lang_rust_git_ref_heads_master.json b/tests/github_client/merge_upstream_conflict/02-GET-repos_rust-lang_rust_git_ref_heads_master.json new file mode 100644 index 00000000..9c7efcaa --- /dev/null +++ b/tests/github_client/merge_upstream_conflict/02-GET-repos_rust-lang_rust_git_ref_heads_master.json @@ -0,0 +1,18 @@ +{ + "kind": "Request", + "method": "GET", + "path": "/repos/rust-lang/rust/git/ref/heads/master", + "query": null, + "request_body": "", + "response_code": 200, + "response_body": { + "node_id": "MDM6UmVmNzI0NzEyOnJlZnMvaGVhZHMvbWFzdGVy", + "object": { + "sha": "b963a57205e548e8538a8182b1c273ea75007614", + "type": "commit", + "url": "https://api.github.com/repos/rust-lang/rust/git/commits/b963a57205e548e8538a8182b1c273ea75007614" + }, + "ref": "refs/heads/master", + "url": "https://api.github.com/repos/rust-lang/rust/git/refs/heads/master" + } +} \ No newline at end of file diff --git a/tests/github_client/merge_upstream_conflict/03-PATCH-repos_ehuss_rust_git_refs_heads_master.json b/tests/github_client/merge_upstream_conflict/03-PATCH-repos_ehuss_rust_git_refs_heads_master.json new file mode 100644 index 00000000..bd4cd342 --- /dev/null +++ b/tests/github_client/merge_upstream_conflict/03-PATCH-repos_ehuss_rust_git_refs_heads_master.json @@ -0,0 +1,18 @@ +{ + "kind": "Request", + "method": "PATCH", + "path": "/repos/ehuss/rust/git/refs/heads/master", + "query": null, + "request_body": "{\"force\":true,\"sha\":\"b963a57205e548e8538a8182b1c273ea75007614\"}", + "response_code": 200, + "response_body": { + "node_id": "MDM6UmVmMTE3NDY0NjI1OnJlZnMvaGVhZHMvbWFzdGVy", + "object": { + "sha": "b963a57205e548e8538a8182b1c273ea75007614", + "type": "commit", + "url": "https://api.github.com/repos/ehuss/rust/git/commits/b963a57205e548e8538a8182b1c273ea75007614" + }, + "ref": "refs/heads/master", + "url": "https://api.github.com/repos/ehuss/rust/git/refs/heads/master" + } +} \ No newline at end of file diff --git a/tests/github_client/mod.rs b/tests/github_client/mod.rs index 6cbfeeb0..c04ca99e 100644 --- a/tests/github_client/mod.rs +++ b/tests/github_client/mod.rs @@ -134,6 +134,13 @@ fn repository() { assert_eq!(repo.fork, false); assert_eq!(repo.owner(), "rust-lang"); assert_eq!(repo.name(), "rust"); + assert!(repo.parent.is_none()); + + let repo = gh.repository("ehuss/rust").await.unwrap(); + assert_eq!(repo.fork, true); + let parent = repo.parent.unwrap(); + assert_eq!(parent.full_name, "rust-lang/rust"); + assert_eq!(parent.fork, false); }); } @@ -365,6 +372,15 @@ fn merge_upstream() { }); } +#[test] +fn merge_upstream_conflict() { + // Test when there is a merge conflict. + run_test("merge_upstream_conflict", |gh| async move { + let repo = gh.repository("ehuss/rust").await.unwrap(); + repo.merge_upstream(&gh, "master").await.unwrap(); + }); +} + #[test] fn user() { run_test("user", |gh| async move { diff --git a/tests/github_client/repository/00-GET-repos_rust-lang_rust.json b/tests/github_client/repository/00-GET-repos_rust-lang_rust.json index c1bedcb0..6fe62aeb 100644 --- a/tests/github_client/repository/00-GET-repos_rust-lang_rust.json +++ b/tests/github_client/repository/00-GET-repos_rust-lang_rust.json @@ -27,8 +27,8 @@ "downloads_url": "https://api.github.com/repos/rust-lang/rust/downloads", "events_url": "https://api.github.com/repos/rust-lang/rust/events", "fork": false, - "forks": 10257, - "forks_count": 10257, + "forks": 10902, + "forks_count": 10902, "forks_url": "https://api.github.com/repos/rust-lang/rust/forks", "full_name": "rust-lang/rust", "git_commits_url": "https://api.github.com/repos/rust-lang/rust/git/commits{/sha}", @@ -64,11 +64,11 @@ "milestones_url": "https://api.github.com/repos/rust-lang/rust/milestones{/number}", "mirror_url": null, "name": "rust", - "network_count": 10257, + "network_count": 10902, "node_id": "MDEwOlJlcG9zaXRvcnk3MjQ3MTI=", "notifications_url": "https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}", - "open_issues": 9527, - "open_issues_count": 9527, + "open_issues": 9613, + "open_issues_count": 9613, "organization": { "avatar_url": "https://avatars.githubusercontent.com/u/5430905?v=4", "events_url": "https://api.github.com/users/rust-lang/events{/privacy}", @@ -118,14 +118,14 @@ }, "private": false, "pulls_url": "https://api.github.com/repos/rust-lang/rust/pulls{/number}", - "pushed_at": "2023-01-23T22:28:29Z", + "pushed_at": "2023-06-12T17:58:57Z", "releases_url": "https://api.github.com/repos/rust-lang/rust/releases{/id}", - "size": 1057370, + "size": 894511, "ssh_url": "git@github.com:rust-lang/rust.git", - "stargazers_count": 76867, + "stargazers_count": 82555, "stargazers_url": "https://api.github.com/repos/rust-lang/rust/stargazers", "statuses_url": "https://api.github.com/repos/rust-lang/rust/statuses/{sha}", - "subscribers_count": 1481, + "subscribers_count": 1496, "subscribers_url": "https://api.github.com/repos/rust-lang/rust/subscribers", "subscription_url": "https://api.github.com/repos/rust-lang/rust/subscription", "svn_url": "https://github.com/rust-lang/rust", @@ -138,11 +138,11 @@ "rust" ], "trees_url": "https://api.github.com/repos/rust-lang/rust/git/trees{/sha}", - "updated_at": "2023-01-23T22:36:05Z", + "updated_at": "2023-06-12T17:54:18Z", "url": "https://api.github.com/repos/rust-lang/rust", "visibility": "public", - "watchers": 76867, - "watchers_count": 76867, + "watchers": 82555, + "watchers_count": 82555, "web_commit_signoff_required": false } -} +} \ No newline at end of file diff --git a/tests/github_client/repository/01-GET-repos_ehuss_rust.json b/tests/github_client/repository/01-GET-repos_ehuss_rust.json new file mode 100644 index 00000000..81b31b2d --- /dev/null +++ b/tests/github_client/repository/01-GET-repos_ehuss_rust.json @@ -0,0 +1,356 @@ +{ + "kind": "Request", + "method": "GET", + "path": "/repos/ehuss/rust", + "query": null, + "request_body": "", + "response_code": 200, + "response_body": { + "allow_auto_merge": false, + "allow_forking": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_squash_merge": true, + "allow_update_branch": false, + "archive_url": "https://api.github.com/repos/ehuss/rust/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/ehuss/rust/assignees{/user}", + "blobs_url": "https://api.github.com/repos/ehuss/rust/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/ehuss/rust/branches{/branch}", + "clone_url": "https://github.com/ehuss/rust.git", + "collaborators_url": "https://api.github.com/repos/ehuss/rust/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/ehuss/rust/comments{/number}", + "commits_url": "https://api.github.com/repos/ehuss/rust/commits{/sha}", + "compare_url": "https://api.github.com/repos/ehuss/rust/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/ehuss/rust/contents/{+path}", + "contributors_url": "https://api.github.com/repos/ehuss/rust/contributors", + "created_at": "2018-01-14T20:35:48Z", + "default_branch": "master", + "delete_branch_on_merge": false, + "deployments_url": "https://api.github.com/repos/ehuss/rust/deployments", + "description": "A safe, concurrent, practical language.", + "disabled": false, + "downloads_url": "https://api.github.com/repos/ehuss/rust/downloads", + "events_url": "https://api.github.com/repos/ehuss/rust/events", + "fork": true, + "forks": 0, + "forks_count": 0, + "forks_url": "https://api.github.com/repos/ehuss/rust/forks", + "full_name": "ehuss/rust", + "git_commits_url": "https://api.github.com/repos/ehuss/rust/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/ehuss/rust/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/ehuss/rust/git/tags{/sha}", + "git_url": "git://github.com/ehuss/rust.git", + "has_discussions": false, + "has_downloads": true, + "has_issues": false, + "has_pages": true, + "has_projects": true, + "has_wiki": false, + "homepage": "https://www.rust-lang.org", + "hooks_url": "https://api.github.com/repos/ehuss/rust/hooks", + "html_url": "https://github.com/ehuss/rust", + "id": 117464625, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/ehuss/rust/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/ehuss/rust/issues/events{/number}", + "issues_url": "https://api.github.com/repos/ehuss/rust/issues{/number}", + "keys_url": "https://api.github.com/repos/ehuss/rust/keys{/key_id}", + "labels_url": "https://api.github.com/repos/ehuss/rust/labels{/name}", + "language": "Rust", + "languages_url": "https://api.github.com/repos/ehuss/rust/languages", + "license": { + "key": "other", + "name": "Other", + "node_id": "MDc6TGljZW5zZTA=", + "spdx_id": "NOASSERTION", + "url": null + }, + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "merges_url": "https://api.github.com/repos/ehuss/rust/merges", + "milestones_url": "https://api.github.com/repos/ehuss/rust/milestones{/number}", + "mirror_url": null, + "name": "rust", + "network_count": 10902, + "node_id": "MDEwOlJlcG9zaXRvcnkxMTc0NjQ2MjU=", + "notifications_url": "https://api.github.com/repos/ehuss/rust/notifications{?since,all,participating}", + "open_issues": 0, + "open_issues_count": 0, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/43198?v=4", + "events_url": "https://api.github.com/users/ehuss/events{/privacy}", + "followers_url": "https://api.github.com/users/ehuss/followers", + "following_url": "https://api.github.com/users/ehuss/following{/other_user}", + "gists_url": "https://api.github.com/users/ehuss/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/ehuss", + "id": 43198, + "login": "ehuss", + "node_id": "MDQ6VXNlcjQzMTk4", + "organizations_url": "https://api.github.com/users/ehuss/orgs", + "received_events_url": "https://api.github.com/users/ehuss/received_events", + "repos_url": "https://api.github.com/users/ehuss/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/ehuss/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/ehuss/subscriptions", + "type": "User", + "url": "https://api.github.com/users/ehuss" + }, + "parent": { + "allow_forking": true, + "archive_url": "https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/rust-lang/rust/assignees{/user}", + "blobs_url": "https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/rust-lang/rust/branches{/branch}", + "clone_url": "https://github.com/rust-lang/rust.git", + "collaborators_url": "https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/rust-lang/rust/comments{/number}", + "commits_url": "https://api.github.com/repos/rust-lang/rust/commits{/sha}", + "compare_url": "https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/rust-lang/rust/contents/{+path}", + "contributors_url": "https://api.github.com/repos/rust-lang/rust/contributors", + "created_at": "2010-06-16T20:39:03Z", + "default_branch": "master", + "deployments_url": "https://api.github.com/repos/rust-lang/rust/deployments", + "description": "Empowering everyone to build reliable and efficient software.", + "disabled": false, + "downloads_url": "https://api.github.com/repos/rust-lang/rust/downloads", + "events_url": "https://api.github.com/repos/rust-lang/rust/events", + "fork": false, + "forks": 10902, + "forks_count": 10902, + "forks_url": "https://api.github.com/repos/rust-lang/rust/forks", + "full_name": "rust-lang/rust", + "git_commits_url": "https://api.github.com/repos/rust-lang/rust/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/rust-lang/rust/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/rust-lang/rust/git/tags{/sha}", + "git_url": "git://github.com/rust-lang/rust.git", + "has_discussions": false, + "has_downloads": true, + "has_issues": true, + "has_pages": false, + "has_projects": true, + "has_wiki": false, + "homepage": "https://www.rust-lang.org", + "hooks_url": "https://api.github.com/repos/rust-lang/rust/hooks", + "html_url": "https://github.com/rust-lang/rust", + "id": 724712, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/rust-lang/rust/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/rust-lang/rust/issues/events{/number}", + "issues_url": "https://api.github.com/repos/rust-lang/rust/issues{/number}", + "keys_url": "https://api.github.com/repos/rust-lang/rust/keys{/key_id}", + "labels_url": "https://api.github.com/repos/rust-lang/rust/labels{/name}", + "language": "Rust", + "languages_url": "https://api.github.com/repos/rust-lang/rust/languages", + "license": { + "key": "other", + "name": "Other", + "node_id": "MDc6TGljZW5zZTA=", + "spdx_id": "NOASSERTION", + "url": null + }, + "merges_url": "https://api.github.com/repos/rust-lang/rust/merges", + "milestones_url": "https://api.github.com/repos/rust-lang/rust/milestones{/number}", + "mirror_url": null, + "name": "rust", + "node_id": "MDEwOlJlcG9zaXRvcnk3MjQ3MTI=", + "notifications_url": "https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}", + "open_issues": 9613, + "open_issues_count": 9613, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/5430905?v=4", + "events_url": "https://api.github.com/users/rust-lang/events{/privacy}", + "followers_url": "https://api.github.com/users/rust-lang/followers", + "following_url": "https://api.github.com/users/rust-lang/following{/other_user}", + "gists_url": "https://api.github.com/users/rust-lang/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/rust-lang", + "id": 5430905, + "login": "rust-lang", + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0MzA5MDU=", + "organizations_url": "https://api.github.com/users/rust-lang/orgs", + "received_events_url": "https://api.github.com/users/rust-lang/received_events", + "repos_url": "https://api.github.com/users/rust-lang/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/rust-lang/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/rust-lang/subscriptions", + "type": "Organization", + "url": "https://api.github.com/users/rust-lang" + }, + "private": false, + "pulls_url": "https://api.github.com/repos/rust-lang/rust/pulls{/number}", + "pushed_at": "2023-06-12T17:58:57Z", + "releases_url": "https://api.github.com/repos/rust-lang/rust/releases{/id}", + "size": 894511, + "ssh_url": "git@github.com:rust-lang/rust.git", + "stargazers_count": 82555, + "stargazers_url": "https://api.github.com/repos/rust-lang/rust/stargazers", + "statuses_url": "https://api.github.com/repos/rust-lang/rust/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/rust-lang/rust/subscribers", + "subscription_url": "https://api.github.com/repos/rust-lang/rust/subscription", + "svn_url": "https://github.com/rust-lang/rust", + "tags_url": "https://api.github.com/repos/rust-lang/rust/tags", + "teams_url": "https://api.github.com/repos/rust-lang/rust/teams", + "topics": [ + "compiler", + "hacktoberfest", + "language", + "rust" + ], + "trees_url": "https://api.github.com/repos/rust-lang/rust/git/trees{/sha}", + "updated_at": "2023-06-12T17:54:18Z", + "url": "https://api.github.com/repos/rust-lang/rust", + "visibility": "public", + "watchers": 82555, + "watchers_count": 82555, + "web_commit_signoff_required": false + }, + "permissions": { + "admin": true, + "maintain": true, + "pull": true, + "push": true, + "triage": true + }, + "private": false, + "pulls_url": "https://api.github.com/repos/ehuss/rust/pulls{/number}", + "pushed_at": "2023-06-08T15:50:19Z", + "releases_url": "https://api.github.com/repos/ehuss/rust/releases{/id}", + "size": 887983, + "source": { + "allow_forking": true, + "archive_url": "https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/rust-lang/rust/assignees{/user}", + "blobs_url": "https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/rust-lang/rust/branches{/branch}", + "clone_url": "https://github.com/rust-lang/rust.git", + "collaborators_url": "https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/rust-lang/rust/comments{/number}", + "commits_url": "https://api.github.com/repos/rust-lang/rust/commits{/sha}", + "compare_url": "https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/rust-lang/rust/contents/{+path}", + "contributors_url": "https://api.github.com/repos/rust-lang/rust/contributors", + "created_at": "2010-06-16T20:39:03Z", + "default_branch": "master", + "deployments_url": "https://api.github.com/repos/rust-lang/rust/deployments", + "description": "Empowering everyone to build reliable and efficient software.", + "disabled": false, + "downloads_url": "https://api.github.com/repos/rust-lang/rust/downloads", + "events_url": "https://api.github.com/repos/rust-lang/rust/events", + "fork": false, + "forks": 10902, + "forks_count": 10902, + "forks_url": "https://api.github.com/repos/rust-lang/rust/forks", + "full_name": "rust-lang/rust", + "git_commits_url": "https://api.github.com/repos/rust-lang/rust/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/rust-lang/rust/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/rust-lang/rust/git/tags{/sha}", + "git_url": "git://github.com/rust-lang/rust.git", + "has_discussions": false, + "has_downloads": true, + "has_issues": true, + "has_pages": false, + "has_projects": true, + "has_wiki": false, + "homepage": "https://www.rust-lang.org", + "hooks_url": "https://api.github.com/repos/rust-lang/rust/hooks", + "html_url": "https://github.com/rust-lang/rust", + "id": 724712, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/rust-lang/rust/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/rust-lang/rust/issues/events{/number}", + "issues_url": "https://api.github.com/repos/rust-lang/rust/issues{/number}", + "keys_url": "https://api.github.com/repos/rust-lang/rust/keys{/key_id}", + "labels_url": "https://api.github.com/repos/rust-lang/rust/labels{/name}", + "language": "Rust", + "languages_url": "https://api.github.com/repos/rust-lang/rust/languages", + "license": { + "key": "other", + "name": "Other", + "node_id": "MDc6TGljZW5zZTA=", + "spdx_id": "NOASSERTION", + "url": null + }, + "merges_url": "https://api.github.com/repos/rust-lang/rust/merges", + "milestones_url": "https://api.github.com/repos/rust-lang/rust/milestones{/number}", + "mirror_url": null, + "name": "rust", + "node_id": "MDEwOlJlcG9zaXRvcnk3MjQ3MTI=", + "notifications_url": "https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}", + "open_issues": 9613, + "open_issues_count": 9613, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/5430905?v=4", + "events_url": "https://api.github.com/users/rust-lang/events{/privacy}", + "followers_url": "https://api.github.com/users/rust-lang/followers", + "following_url": "https://api.github.com/users/rust-lang/following{/other_user}", + "gists_url": "https://api.github.com/users/rust-lang/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/rust-lang", + "id": 5430905, + "login": "rust-lang", + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0MzA5MDU=", + "organizations_url": "https://api.github.com/users/rust-lang/orgs", + "received_events_url": "https://api.github.com/users/rust-lang/received_events", + "repos_url": "https://api.github.com/users/rust-lang/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/rust-lang/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/rust-lang/subscriptions", + "type": "Organization", + "url": "https://api.github.com/users/rust-lang" + }, + "private": false, + "pulls_url": "https://api.github.com/repos/rust-lang/rust/pulls{/number}", + "pushed_at": "2023-06-12T17:58:57Z", + "releases_url": "https://api.github.com/repos/rust-lang/rust/releases{/id}", + "size": 894511, + "ssh_url": "git@github.com:rust-lang/rust.git", + "stargazers_count": 82555, + "stargazers_url": "https://api.github.com/repos/rust-lang/rust/stargazers", + "statuses_url": "https://api.github.com/repos/rust-lang/rust/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/rust-lang/rust/subscribers", + "subscription_url": "https://api.github.com/repos/rust-lang/rust/subscription", + "svn_url": "https://github.com/rust-lang/rust", + "tags_url": "https://api.github.com/repos/rust-lang/rust/tags", + "teams_url": "https://api.github.com/repos/rust-lang/rust/teams", + "topics": [ + "compiler", + "hacktoberfest", + "language", + "rust" + ], + "trees_url": "https://api.github.com/repos/rust-lang/rust/git/trees{/sha}", + "updated_at": "2023-06-12T17:54:18Z", + "url": "https://api.github.com/repos/rust-lang/rust", + "visibility": "public", + "watchers": 82555, + "watchers_count": 82555, + "web_commit_signoff_required": false + }, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "ssh_url": "git@github.com:ehuss/rust.git", + "stargazers_count": 0, + "stargazers_url": "https://api.github.com/repos/ehuss/rust/stargazers", + "statuses_url": "https://api.github.com/repos/ehuss/rust/statuses/{sha}", + "subscribers_count": 0, + "subscribers_url": "https://api.github.com/repos/ehuss/rust/subscribers", + "subscription_url": "https://api.github.com/repos/ehuss/rust/subscription", + "svn_url": "https://github.com/ehuss/rust", + "tags_url": "https://api.github.com/repos/ehuss/rust/tags", + "teams_url": "https://api.github.com/repos/ehuss/rust/teams", + "topics": [], + "trees_url": "https://api.github.com/repos/ehuss/rust/git/trees{/sha}", + "updated_at": "2021-11-03T23:44:04Z", + "url": "https://api.github.com/repos/ehuss/rust", + "use_squash_pr_title_as_default": false, + "visibility": "public", + "watchers": 0, + "watchers_count": 0, + "web_commit_signoff_required": false + } +} \ No newline at end of file