diff --git a/data/payloads/github_repos_dlang-tour_core_commits_4941624d1af77e84565ec86979c21c1d582b1c06_status b/data/payloads/github_repos_dlang-tour_core_commits_4941624d1af77e84565ec86979c21c1d582b1c06_status new file mode 100644 index 0000000..fb9d28e --- /dev/null +++ b/data/payloads/github_repos_dlang-tour_core_commits_4941624d1af77e84565ec86979c21c1d582b1c06_status @@ -0,0 +1,104 @@ +{ + "state": "failure", + "statuses": [ + { + "url": "https://api.github.com/repos/dlang-tour/core/statuses/4941624d1af77e84565ec86979c21c1d582b1c06", + "id": 1387272824, + "state": "success", + "description": "The Travis CI build passed", + "target_url": "https://travis-ci.org/dlang-tour/core/builds/254930692?utm_source=github_status&utm_medium=notification", + "context": "continuous-integration/travis-ci/pr", + "created_at": "2017-07-18T16:46:42Z", + "updated_at": "2017-07-18T16:46:42Z" + }, + { + "url": "https://api.github.com/repos/dlang-tour/core/statuses/4941624d1af77e84565ec86979c21c1d582b1c06", + "id": 1387274982, + "state": "success", + "description": "46.14% (+0.079%) compared to 73a4467", + "target_url": "https://codecov.io/gh/dlang-tour/core/compare/73a4467b97e27f39e2da12e6e7f6915c08f02b79...4941624d1af77e84565ec86979c21c1d582b1c06", + "context": "codecov/project", + "created_at": "2017-07-18T16:47:20Z", + "updated_at": "2017-07-18T16:47:20Z" + }, + { + "url": "https://api.github.com/repos/dlang-tour/core/statuses/4941624d1af77e84565ec86979c21c1d582b1c06", + "id": 1387274995, + "state": "failure", + "description": "0% of diff hit (target 46.061%)", + "target_url": "https://codecov.io/gh/dlang-tour/core/compare/73a4467b97e27f39e2da12e6e7f6915c08f02b79...4941624d1af77e84565ec86979c21c1d582b1c06", + "context": "codecov/patch", + "created_at": "2017-07-18T16:47:20Z", + "updated_at": "2017-07-18T16:47:20Z" + } + ], + "sha": "4941624d1af77e84565ec86979c21c1d582b1c06", + "total_count": 3, + "repository": { + "id": 49131290, + "name": "core", + "full_name": "dlang-tour/core", + "owner": { + "login": "dlang-tour", + "id": 21092294, + "avatar_url": "https://avatars0.githubusercontent.com/u/21092294?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dlang-tour", + "html_url": "https://github.com/dlang-tour", + "followers_url": "https://api.github.com/users/dlang-tour/followers", + "following_url": "https://api.github.com/users/dlang-tour/following{/other_user}", + "gists_url": "https://api.github.com/users/dlang-tour/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dlang-tour/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dlang-tour/subscriptions", + "organizations_url": "https://api.github.com/users/dlang-tour/orgs", + "repos_url": "https://api.github.com/users/dlang-tour/repos", + "events_url": "https://api.github.com/users/dlang-tour/events{/privacy}", + "received_events_url": "https://api.github.com/users/dlang-tour/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/dlang-tour/core", + "description": "D Language online tour (https://tour.dlang.org/) and online editor (https://run.dlang.io/)", + "fork": false, + "url": "https://api.github.com/repos/dlang-tour/core", + "forks_url": "https://api.github.com/repos/dlang-tour/core/forks", + "keys_url": "https://api.github.com/repos/dlang-tour/core/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/dlang-tour/core/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/dlang-tour/core/teams", + "hooks_url": "https://api.github.com/repos/dlang-tour/core/hooks", + "issue_events_url": "https://api.github.com/repos/dlang-tour/core/issues/events{/number}", + "events_url": "https://api.github.com/repos/dlang-tour/core/events", + "assignees_url": "https://api.github.com/repos/dlang-tour/core/assignees{/user}", + "branches_url": "https://api.github.com/repos/dlang-tour/core/branches{/branch}", + "tags_url": "https://api.github.com/repos/dlang-tour/core/tags", + "blobs_url": "https://api.github.com/repos/dlang-tour/core/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/dlang-tour/core/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/dlang-tour/core/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/dlang-tour/core/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/dlang-tour/core/statuses/{sha}", + "languages_url": "https://api.github.com/repos/dlang-tour/core/languages", + "stargazers_url": "https://api.github.com/repos/dlang-tour/core/stargazers", + "contributors_url": "https://api.github.com/repos/dlang-tour/core/contributors", + "subscribers_url": "https://api.github.com/repos/dlang-tour/core/subscribers", + "subscription_url": "https://api.github.com/repos/dlang-tour/core/subscription", + "commits_url": "https://api.github.com/repos/dlang-tour/core/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/dlang-tour/core/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/dlang-tour/core/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/dlang-tour/core/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/dlang-tour/core/contents/{+path}", + "compare_url": "https://api.github.com/repos/dlang-tour/core/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/dlang-tour/core/merges", + "archive_url": "https://api.github.com/repos/dlang-tour/core/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/dlang-tour/core/downloads", + "issues_url": "https://api.github.com/repos/dlang-tour/core/issues{/number}", + "pulls_url": "https://api.github.com/repos/dlang-tour/core/pulls{/number}", + "milestones_url": "https://api.github.com/repos/dlang-tour/core/milestones{/number}", + "notifications_url": "https://api.github.com/repos/dlang-tour/core/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/dlang-tour/core/labels{/name}", + "releases_url": "https://api.github.com/repos/dlang-tour/core/releases{/id}", + "deployments_url": "https://api.github.com/repos/dlang-tour/core/deployments" + }, + "commit_url": "https://api.github.com/repos/dlang-tour/core/commits/4941624d1af77e84565ec86979c21c1d582b1c06", + "url": "https://api.github.com/repos/dlang-tour/core/commits/4941624d1af77e84565ec86979c21c1d582b1c06/status" +} diff --git a/data/payloads/github_repos_dlang_dmd_commits_782fd3fdd4a9c23e1307b4b963b443ed60517dfe_status b/data/payloads/github_repos_dlang_dmd_commits_782fd3fdd4a9c23e1307b4b963b443ed60517dfe_status new file mode 100644 index 0000000..07f0161 --- /dev/null +++ b/data/payloads/github_repos_dlang_dmd_commits_782fd3fdd4a9c23e1307b4b963b443ed60517dfe_status @@ -0,0 +1,144 @@ +{ + "state": "success", + "statuses": [ + { + "url": "https://api.github.com/repos/dlang/dmd/statuses/782fd3fdd4a9c23e1307b4b963b443ed60517dfe", + "id": 916874615, + "state": "success", + "description": "Your tests passed on CircleCI!", + "target_url": "https://circleci.com/gh/dlang/dmd/1884?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link", + "context": "ci/circleci", + "created_at": "2016-12-17T12:28:10Z", + "updated_at": "2016-12-17T12:28:10Z" + }, + { + "url": "https://api.github.com/repos/dlang/dmd/statuses/782fd3fdd4a9c23e1307b4b963b443ed60517dfe", + "id": 916874870, + "state": "success", + "description": "100% of diff hit (target 86.500%)", + "target_url": "https://codecov.io/gh/dlang/dmd/compare/6b928dc41975ce8e6186f704139984ac09fbd82f...782fd3fdd4a9c23e1307b4b963b443ed60517dfe", + "context": "codecov/patch", + "created_at": "2016-12-17T12:28:52Z", + "updated_at": "2016-12-17T12:28:52Z" + }, + { + "url": "https://api.github.com/repos/dlang/dmd/statuses/782fd3fdd4a9c23e1307b4b963b443ed60517dfe", + "id": 916874877, + "state": "success", + "description": "87.185% (+0.685%) compared to 6b928dc", + "target_url": "https://codecov.io/gh/dlang/dmd/compare/6b928dc41975ce8e6186f704139984ac09fbd82f...782fd3fdd4a9c23e1307b4b963b443ed60517dfe", + "context": "codecov/project", + "created_at": "2016-12-17T12:28:53Z", + "updated_at": "2016-12-17T12:28:53Z" + }, + { + "url": "https://api.github.com/repos/dlang/dmd/statuses/782fd3fdd4a9c23e1307b4b963b443ed60517dfe", + "id": 916878318, + "state": "success", + "description": "Build finished. ", + "target_url": "https://ci.dawg.eu/job/dmd_trigger/404/", + "context": "Project Tester", + "created_at": "2016-12-17T12:38:41Z", + "updated_at": "2016-12-17T12:38:41Z" + }, + { + "url": "https://api.github.com/repos/dlang/dmd/statuses/782fd3fdd4a9c23e1307b4b963b443ed60517dfe", + "id": 916896053, + "state": "success", + "description": "The Travis CI build passed", + "target_url": "https://travis-ci.org/dlang/dmd/builds/184758323", + "context": "continuous-integration/travis-ci/pr", + "created_at": "2016-12-17T13:27:29Z", + "updated_at": "2016-12-17T13:27:29Z" + }, + { + "url": "https://api.github.com/repos/dlang/dmd/statuses/782fd3fdd4a9c23e1307b4b963b443ed60517dfe", + "id": 918967960, + "state": "success", + "description": "Documentation OK (no changes)", + "target_url": "http://dtest.thecybershadow.net/results/9aaec9234a88b5841aa055622cdf9740b19fb8a0/782fd3fdd4a9c23e1307b4b963b443ed60517dfe/", + "context": "CyberShadow/DAutoTest", + "created_at": "2016-12-19T16:51:38Z", + "updated_at": "2016-12-19T16:51:38Z" + }, + { + "url": "https://api.github.com/repos/dlang/dmd/statuses/782fd3fdd4a9c23e1307b4b963b443ed60517dfe", + "id": 919074399, + "state": "success", + "description": "Pass: 10", + "target_url": "https://auto-tester.puremagic.com/pull-history.ghtml?projectid=1&repoid=1&pullid=6327", + "context": "auto-tester", + "created_at": "2016-12-19T17:39:55Z", + "updated_at": "2016-12-19T17:39:55Z" + } + ], + "sha": "782fd3fdd4a9c23e1307b4b963b443ed60517dfe", + "total_count": 7, + "repository": { + "id": 1257070, + "name": "dmd", + "full_name": "dlang/dmd", + "owner": { + "login": "dlang", + "id": 565913, + "avatar_url": "https://avatars3.githubusercontent.com/u/565913?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dlang", + "html_url": "https://github.com/dlang", + "followers_url": "https://api.github.com/users/dlang/followers", + "following_url": "https://api.github.com/users/dlang/following{/other_user}", + "gists_url": "https://api.github.com/users/dlang/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dlang/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dlang/subscriptions", + "organizations_url": "https://api.github.com/users/dlang/orgs", + "repos_url": "https://api.github.com/users/dlang/repos", + "events_url": "https://api.github.com/users/dlang/events{/privacy}", + "received_events_url": "https://api.github.com/users/dlang/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/dlang/dmd", + "description": "dmd D Programming Language compiler", + "fork": false, + "url": "https://api.github.com/repos/dlang/dmd", + "forks_url": "https://api.github.com/repos/dlang/dmd/forks", + "keys_url": "https://api.github.com/repos/dlang/dmd/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/dlang/dmd/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/dlang/dmd/teams", + "hooks_url": "https://api.github.com/repos/dlang/dmd/hooks", + "issue_events_url": "https://api.github.com/repos/dlang/dmd/issues/events{/number}", + "events_url": "https://api.github.com/repos/dlang/dmd/events", + "assignees_url": "https://api.github.com/repos/dlang/dmd/assignees{/user}", + "branches_url": "https://api.github.com/repos/dlang/dmd/branches{/branch}", + "tags_url": "https://api.github.com/repos/dlang/dmd/tags", + "blobs_url": "https://api.github.com/repos/dlang/dmd/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/dlang/dmd/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/dlang/dmd/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/dlang/dmd/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/dlang/dmd/statuses/{sha}", + "languages_url": "https://api.github.com/repos/dlang/dmd/languages", + "stargazers_url": "https://api.github.com/repos/dlang/dmd/stargazers", + "contributors_url": "https://api.github.com/repos/dlang/dmd/contributors", + "subscribers_url": "https://api.github.com/repos/dlang/dmd/subscribers", + "subscription_url": "https://api.github.com/repos/dlang/dmd/subscription", + "commits_url": "https://api.github.com/repos/dlang/dmd/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/dlang/dmd/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/dlang/dmd/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/dlang/dmd/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/dlang/dmd/contents/{+path}", + "compare_url": "https://api.github.com/repos/dlang/dmd/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/dlang/dmd/merges", + "archive_url": "https://api.github.com/repos/dlang/dmd/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/dlang/dmd/downloads", + "issues_url": "https://api.github.com/repos/dlang/dmd/issues{/number}", + "pulls_url": "https://api.github.com/repos/dlang/dmd/pulls{/number}", + "milestones_url": "https://api.github.com/repos/dlang/dmd/milestones{/number}", + "notifications_url": "https://api.github.com/repos/dlang/dmd/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/dlang/dmd/labels{/name}", + "releases_url": "https://api.github.com/repos/dlang/dmd/releases{/id}", + "deployments_url": "https://api.github.com/repos/dlang/dmd/deployments" + }, + "commit_url": "https://api.github.com/repos/dlang/dmd/commits/782fd3fdd4a9c23e1307b4b963b443ed60517dfe", + "url": "https://api.github.com/repos/dlang/dmd/commits/782fd3fdd4a9c23e1307b4b963b443ed60517dfe/status" +} diff --git a/data/payloads/github_repos_dlang_dmd_commits_d6fc98058b637f9a558206847e6d7057ab9fb3de_status b/data/payloads/github_repos_dlang_dmd_commits_d6fc98058b637f9a558206847e6d7057ab9fb3de_status new file mode 100644 index 0000000..366020b --- /dev/null +++ b/data/payloads/github_repos_dlang_dmd_commits_d6fc98058b637f9a558206847e6d7057ab9fb3de_status @@ -0,0 +1,114 @@ +{ + "state": "failure", + "statuses": [ + { + "url": "https://api.github.com/repos/dlang/dmd/statuses/d6fc98058b637f9a558206847e6d7057ab9fb3de", + "id": 916884078, + "state": "failure", + "description": "Build finished. ", + "target_url": "https://ci.dawg.eu/job/dmd_trigger/406/", + "context": "Project Tester", + "created_at": "2016-12-17T12:53:20Z", + "updated_at": "2016-12-17T12:53:20Z" + }, + { + "url": "https://api.github.com/repos/dlang/dmd/statuses/d6fc98058b637f9a558206847e6d7057ab9fb3de", + "id": 916884200, + "state": "failure", + "description": "Build failed", + "target_url": "http://dtest.thecybershadow.net/results/b122a97f578369aa95c26d7f7a8dcc74e95f115c/d6fc98058b637f9a558206847e6d7057ab9fb3de/", + "context": "CyberShadow/DAutoTest", + "created_at": "2016-12-17T12:53:44Z", + "updated_at": "2016-12-17T12:53:44Z" + }, + { + "url": "https://api.github.com/repos/dlang/dmd/statuses/d6fc98058b637f9a558206847e6d7057ab9fb3de", + "id": 916884248, + "state": "failure", + "description": "Your tests failed on CircleCI", + "target_url": "https://circleci.com/gh/dlang/dmd/1886?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link", + "context": "ci/circleci", + "created_at": "2016-12-17T12:53:50Z", + "updated_at": "2016-12-17T12:53:50Z" + }, + { + "url": "https://api.github.com/repos/dlang/dmd/statuses/d6fc98058b637f9a558206847e6d7057ab9fb3de", + "id": 916891980, + "state": "failure", + "description": "The Travis CI build failed", + "target_url": "https://travis-ci.org/dlang/dmd/builds/184762316", + "context": "continuous-integration/travis-ci/pr", + "created_at": "2016-12-17T13:14:25Z", + "updated_at": "2016-12-17T13:14:25Z" + } + ], + "sha": "d6fc98058b637f9a558206847e6d7057ab9fb3de", + "total_count": 4, + "repository": { + "id": 1257070, + "name": "dmd", + "full_name": "dlang/dmd", + "owner": { + "login": "dlang", + "id": 565913, + "avatar_url": "https://avatars3.githubusercontent.com/u/565913?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dlang", + "html_url": "https://github.com/dlang", + "followers_url": "https://api.github.com/users/dlang/followers", + "following_url": "https://api.github.com/users/dlang/following{/other_user}", + "gists_url": "https://api.github.com/users/dlang/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dlang/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dlang/subscriptions", + "organizations_url": "https://api.github.com/users/dlang/orgs", + "repos_url": "https://api.github.com/users/dlang/repos", + "events_url": "https://api.github.com/users/dlang/events{/privacy}", + "received_events_url": "https://api.github.com/users/dlang/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/dlang/dmd", + "description": "dmd D Programming Language compiler", + "fork": false, + "url": "https://api.github.com/repos/dlang/dmd", + "forks_url": "https://api.github.com/repos/dlang/dmd/forks", + "keys_url": "https://api.github.com/repos/dlang/dmd/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/dlang/dmd/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/dlang/dmd/teams", + "hooks_url": "https://api.github.com/repos/dlang/dmd/hooks", + "issue_events_url": "https://api.github.com/repos/dlang/dmd/issues/events{/number}", + "events_url": "https://api.github.com/repos/dlang/dmd/events", + "assignees_url": "https://api.github.com/repos/dlang/dmd/assignees{/user}", + "branches_url": "https://api.github.com/repos/dlang/dmd/branches{/branch}", + "tags_url": "https://api.github.com/repos/dlang/dmd/tags", + "blobs_url": "https://api.github.com/repos/dlang/dmd/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/dlang/dmd/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/dlang/dmd/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/dlang/dmd/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/dlang/dmd/statuses/{sha}", + "languages_url": "https://api.github.com/repos/dlang/dmd/languages", + "stargazers_url": "https://api.github.com/repos/dlang/dmd/stargazers", + "contributors_url": "https://api.github.com/repos/dlang/dmd/contributors", + "subscribers_url": "https://api.github.com/repos/dlang/dmd/subscribers", + "subscription_url": "https://api.github.com/repos/dlang/dmd/subscription", + "commits_url": "https://api.github.com/repos/dlang/dmd/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/dlang/dmd/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/dlang/dmd/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/dlang/dmd/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/dlang/dmd/contents/{+path}", + "compare_url": "https://api.github.com/repos/dlang/dmd/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/dlang/dmd/merges", + "archive_url": "https://api.github.com/repos/dlang/dmd/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/dlang/dmd/downloads", + "issues_url": "https://api.github.com/repos/dlang/dmd/issues{/number}", + "pulls_url": "https://api.github.com/repos/dlang/dmd/pulls{/number}", + "milestones_url": "https://api.github.com/repos/dlang/dmd/milestones{/number}", + "notifications_url": "https://api.github.com/repos/dlang/dmd/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/dlang/dmd/labels{/name}", + "releases_url": "https://api.github.com/repos/dlang/dmd/releases{/id}", + "deployments_url": "https://api.github.com/repos/dlang/dmd/deployments" + }, + "commit_url": "https://api.github.com/repos/dlang/dmd/commits/d6fc98058b637f9a558206847e6d7057ab9fb3de", + "url": "https://api.github.com/repos/dlang/dmd/commits/d6fc98058b637f9a558206847e6d7057ab9fb3de/status" +} diff --git a/data/payloads/github_repos_dlang_phobos_commits_0fb66f092b897b55318509c6582008b3f912311a_status b/data/payloads/github_repos_dlang_phobos_commits_0fb66f092b897b55318509c6582008b3f912311a_status new file mode 100644 index 0000000..fa6e2ef --- /dev/null +++ b/data/payloads/github_repos_dlang_phobos_commits_0fb66f092b897b55318509c6582008b3f912311a_status @@ -0,0 +1,134 @@ +{ + "state": "success", + "statuses": [ + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/0fb66f092b897b55318509c6582008b3f912311a", + "id": 1333576374, + "state": "success", + "description": "Your tests passed on CircleCI!", + "target_url": "https://circleci.com/gh/dlang/phobos/3250?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link", + "context": "ci/circleci", + "created_at": "2017-06-27T14:27:54Z", + "updated_at": "2017-06-27T14:27:54Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/0fb66f092b897b55318509c6582008b3f912311a", + "id": 1334863192, + "state": "success", + "description": "Documentation OK (no changes)", + "target_url": "http://dtest.dlang.io/results/4fadf69d2aa1cde536e39d27ba0a4d72d24a7498/0fb66f092b897b55318509c6582008b3f912311a/", + "context": "CyberShadow/DAutoTest", + "created_at": "2017-06-27T20:52:26Z", + "updated_at": "2017-06-27T20:52:26Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/0fb66f092b897b55318509c6582008b3f912311a", + "id": 1334873284, + "state": "success", + "description": "This commit looks good", + "target_url": "https://ci.dlang.io/job/dlang-org/job/phobos/job/PR-5114/20/display/redirect", + "context": "continuous-integration/jenkins/pr-merge", + "created_at": "2017-06-27T20:55:21Z", + "updated_at": "2017-06-27T20:55:21Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/0fb66f092b897b55318509c6582008b3f912311a", + "id": 1335010533, + "state": "success", + "description": "Pass: 10", + "target_url": "https://auto-tester.puremagic.com/pull-history.ghtml?projectid=1&repoid=3&pullid=5114", + "context": "auto-tester", + "created_at": "2017-06-27T21:38:30Z", + "updated_at": "2017-06-27T21:38:30Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/0fb66f092b897b55318509c6582008b3f912311a", + "id": 1335014232, + "state": "success", + "description": "88.453% (+<.001%) compared to 8f98afc", + "target_url": "https://codecov.io/gh/dlang/phobos/compare/8f98afc9ae8fba931bbe52b5c7ed23f8bc8180c4...0fb66f092b897b55318509c6582008b3f912311a", + "context": "codecov/project", + "created_at": "2017-06-27T21:39:50Z", + "updated_at": "2017-06-27T21:39:50Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/0fb66f092b897b55318509c6582008b3f912311a", + "id": 1335014515, + "state": "success", + "description": "Coverage not affected when comparing 8f98afc...0fb66f0", + "target_url": "https://codecov.io/gh/dlang/phobos/compare/8f98afc9ae8fba931bbe52b5c7ed23f8bc8180c4...0fb66f092b897b55318509c6582008b3f912311a", + "context": "codecov/patch", + "created_at": "2017-06-27T21:39:56Z", + "updated_at": "2017-06-27T21:39:56Z" + } + ], + "sha": "0fb66f092b897b55318509c6582008b3f912311a", + "total_count": 6, + "repository": { + "id": 1257084, + "name": "phobos", + "full_name": "dlang/phobos", + "owner": { + "login": "dlang", + "id": 565913, + "avatar_url": "https://avatars3.githubusercontent.com/u/565913?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dlang", + "html_url": "https://github.com/dlang", + "followers_url": "https://api.github.com/users/dlang/followers", + "following_url": "https://api.github.com/users/dlang/following{/other_user}", + "gists_url": "https://api.github.com/users/dlang/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dlang/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dlang/subscriptions", + "organizations_url": "https://api.github.com/users/dlang/orgs", + "repos_url": "https://api.github.com/users/dlang/repos", + "events_url": "https://api.github.com/users/dlang/events{/privacy}", + "received_events_url": "https://api.github.com/users/dlang/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/dlang/phobos", + "description": "The standard library of the D programming language", + "fork": false, + "url": "https://api.github.com/repos/dlang/phobos", + "forks_url": "https://api.github.com/repos/dlang/phobos/forks", + "keys_url": "https://api.github.com/repos/dlang/phobos/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/dlang/phobos/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/dlang/phobos/teams", + "hooks_url": "https://api.github.com/repos/dlang/phobos/hooks", + "issue_events_url": "https://api.github.com/repos/dlang/phobos/issues/events{/number}", + "events_url": "https://api.github.com/repos/dlang/phobos/events", + "assignees_url": "https://api.github.com/repos/dlang/phobos/assignees{/user}", + "branches_url": "https://api.github.com/repos/dlang/phobos/branches{/branch}", + "tags_url": "https://api.github.com/repos/dlang/phobos/tags", + "blobs_url": "https://api.github.com/repos/dlang/phobos/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/dlang/phobos/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/dlang/phobos/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/dlang/phobos/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/dlang/phobos/statuses/{sha}", + "languages_url": "https://api.github.com/repos/dlang/phobos/languages", + "stargazers_url": "https://api.github.com/repos/dlang/phobos/stargazers", + "contributors_url": "https://api.github.com/repos/dlang/phobos/contributors", + "subscribers_url": "https://api.github.com/repos/dlang/phobos/subscribers", + "subscription_url": "https://api.github.com/repos/dlang/phobos/subscription", + "commits_url": "https://api.github.com/repos/dlang/phobos/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/dlang/phobos/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/dlang/phobos/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/dlang/phobos/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/dlang/phobos/contents/{+path}", + "compare_url": "https://api.github.com/repos/dlang/phobos/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/dlang/phobos/merges", + "archive_url": "https://api.github.com/repos/dlang/phobos/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/dlang/phobos/downloads", + "issues_url": "https://api.github.com/repos/dlang/phobos/issues{/number}", + "pulls_url": "https://api.github.com/repos/dlang/phobos/pulls{/number}", + "milestones_url": "https://api.github.com/repos/dlang/phobos/milestones{/number}", + "notifications_url": "https://api.github.com/repos/dlang/phobos/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/dlang/phobos/labels{/name}", + "releases_url": "https://api.github.com/repos/dlang/phobos/releases{/id}", + "deployments_url": "https://api.github.com/repos/dlang/phobos/deployments" + }, + "commit_url": "https://api.github.com/repos/dlang/phobos/commits/0fb66f092b897b55318509c6582008b3f912311a", + "url": "https://api.github.com/repos/dlang/phobos/commits/0fb66f092b897b55318509c6582008b3f912311a/status" +} diff --git a/data/payloads/github_repos_dlang_phobos_status_5b8b90e1824cb90635719f6d3b1f6c195a95a47e b/data/payloads/github_repos_dlang_phobos_commits_5b8b90e1824cb90635719f6d3b1f6c195a95a47e_status similarity index 90% rename from data/payloads/github_repos_dlang_phobos_status_5b8b90e1824cb90635719f6d3b1f6c195a95a47e rename to data/payloads/github_repos_dlang_phobos_commits_5b8b90e1824cb90635719f6d3b1f6c195a95a47e_status index 2a627fe..ba132ad 100644 --- a/data/payloads/github_repos_dlang_phobos_status_5b8b90e1824cb90635719f6d3b1f6c195a95a47e +++ b/data/payloads/github_repos_dlang_phobos_commits_5b8b90e1824cb90635719f6d3b1f6c195a95a47e_status @@ -1,5 +1,5 @@ { - "state": "pending", + "state": "failure", "statuses": [ { "url": "https://api.github.com/repos/dlang/phobos/statuses/5b8b90e1824cb90635719f6d3b1f6c195a95a47e", @@ -20,10 +20,20 @@ "context": "CyberShadow/DAutoTest", "created_at": "2016-03-26T23:31:10Z", "updated_at": "2016-03-26T23:31:10Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/5b8b90e1824cb90635719f6d3b1f6c195a95a47e", + "id": 1437337456, + "state": "error", + "description": "This commit cannot be built", + "target_url": "https://ci.dlang.io/job/dlang-org/job/phobos/job/PR-3620/5/display/redirect", + "context": "continuous-integration/jenkins/pr-merge", + "created_at": "2017-08-06T05:30:37Z", + "updated_at": "2017-08-06T05:30:37Z" } ], "sha": "5b8b90e1824cb90635719f6d3b1f6c195a95a47e", - "total_count": 2, + "total_count": 3, "repository": { "id": 1257084, "name": "phobos", @@ -31,7 +41,7 @@ "owner": { "login": "dlang", "id": 565913, - "avatar_url": "https://avatars.githubusercontent.com/u/565913?v=3", + "avatar_url": "https://avatars3.githubusercontent.com/u/565913?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dlang", "html_url": "https://github.com/dlang", diff --git a/data/payloads/github_repos_dlang_phobos_status_a04acd6a2813fb344d3e47369cf7fd64523ece44 b/data/payloads/github_repos_dlang_phobos_commits_a04acd6a2813fb344d3e47369cf7fd64523ece44_status similarity index 90% rename from data/payloads/github_repos_dlang_phobos_status_a04acd6a2813fb344d3e47369cf7fd64523ece44 rename to data/payloads/github_repos_dlang_phobos_commits_a04acd6a2813fb344d3e47369cf7fd64523ece44_status index 5ee95d0..b061e19 100644 --- a/data/payloads/github_repos_dlang_phobos_status_a04acd6a2813fb344d3e47369cf7fd64523ece44 +++ b/data/payloads/github_repos_dlang_phobos_commits_a04acd6a2813fb344d3e47369cf7fd64523ece44_status @@ -1,5 +1,5 @@ { - "state": "pending", + "state": "failure", "statuses": [ { "url": "https://api.github.com/repos/dlang/phobos/statuses/a04acd6a2813fb344d3e47369cf7fd64523ece44", @@ -30,10 +30,20 @@ "context": "CyberShadow/DAutoTest", "created_at": "2016-02-27T00:06:47Z", "updated_at": "2016-02-27T00:06:47Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/a04acd6a2813fb344d3e47369cf7fd64523ece44", + "id": 1169527599, + "state": "error", + "description": "This commit cannot be built", + "target_url": "https://ci.dlang.io/job/dlang-org/job/phobos/job/PR-2526/14/display/redirect", + "context": "continuous-integration/jenkins/pr-merge", + "created_at": "2017-04-21T14:13:38Z", + "updated_at": "2017-04-21T14:13:38Z" } ], "sha": "a04acd6a2813fb344d3e47369cf7fd64523ece44", - "total_count": 3, + "total_count": 4, "repository": { "id": 1257084, "name": "phobos", @@ -41,7 +51,7 @@ "owner": { "login": "dlang", "id": 565913, - "avatar_url": "https://avatars.githubusercontent.com/u/565913?v=3", + "avatar_url": "https://avatars3.githubusercontent.com/u/565913?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dlang", "html_url": "https://github.com/dlang", diff --git a/data/payloads/github_repos_dlang_phobos_status_b7bf452ca52c2a529e79a830eee97310233e3a9c b/data/payloads/github_repos_dlang_phobos_commits_b7bf452ca52c2a529e79a830eee97310233e3a9c_status similarity index 90% rename from data/payloads/github_repos_dlang_phobos_status_b7bf452ca52c2a529e79a830eee97310233e3a9c rename to data/payloads/github_repos_dlang_phobos_commits_b7bf452ca52c2a529e79a830eee97310233e3a9c_status index ea5adb5..e32551c 100644 --- a/data/payloads/github_repos_dlang_phobos_status_b7bf452ca52c2a529e79a830eee97310233e3a9c +++ b/data/payloads/github_repos_dlang_phobos_commits_b7bf452ca52c2a529e79a830eee97310233e3a9c_status @@ -20,10 +20,20 @@ "context": "auto-tester", "created_at": "2016-08-31T11:01:45Z", "updated_at": "2016-08-31T11:01:45Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/b7bf452ca52c2a529e79a830eee97310233e3a9c", + "id": 1169409310, + "state": "error", + "description": "This commit cannot be built", + "target_url": "https://ci.dlang.io/job/dlang-org/job/phobos/job/PR-3534/4/display/redirect", + "context": "continuous-integration/jenkins/pr-merge", + "created_at": "2017-04-21T13:29:52Z", + "updated_at": "2017-04-21T13:29:52Z" } ], "sha": "b7bf452ca52c2a529e79a830eee97310233e3a9c", - "total_count": 2, + "total_count": 3, "repository": { "id": 1257084, "name": "phobos", @@ -31,7 +41,7 @@ "owner": { "login": "dlang", "id": 565913, - "avatar_url": "https://avatars.githubusercontent.com/u/565913?v=3", + "avatar_url": "https://avatars3.githubusercontent.com/u/565913?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dlang", "html_url": "https://github.com/dlang", diff --git a/data/payloads/github_repos_dlang_phobos_status_c4224ad203f5497569452ff05284124eb7030602 b/data/payloads/github_repos_dlang_phobos_commits_c4224ad203f5497569452ff05284124eb7030602_status similarity index 85% rename from data/payloads/github_repos_dlang_phobos_status_c4224ad203f5497569452ff05284124eb7030602 rename to data/payloads/github_repos_dlang_phobos_commits_c4224ad203f5497569452ff05284124eb7030602_status index 14c1854..093a400 100644 --- a/data/payloads/github_repos_dlang_phobos_status_c4224ad203f5497569452ff05284124eb7030602 +++ b/data/payloads/github_repos_dlang_phobos_commits_c4224ad203f5497569452ff05284124eb7030602_status @@ -13,27 +13,37 @@ }, { "url": "https://api.github.com/repos/dlang/phobos/statuses/c4224ad203f5497569452ff05284124eb7030602", - "id": 1027031561, - "state": "error", - "description": "Merge failed", - "target_url": "http://dtest.dlang.io/results/e5a69cd48efa3f00d0534db8cf381268ce548b5f/c4224ad203f5497569452ff05284124eb7030602/", - "context": "CyberShadow/DAutoTest", - "created_at": "2017-02-17T11:50:37Z", - "updated_at": "2017-02-17T11:50:37Z" - }, - { - "url": "https://api.github.com/repos/dlang/phobos/statuses/c4224ad203f5497569452ff05284124eb7030602", - "id": 1027172108, + "id": 1091428402, "state": "failure", "description": "Fail: 1, Pending: 9", "target_url": "https://auto-tester.puremagic.com/pull-history.ghtml?projectid=1&repoid=3&pullid=4551", "context": "auto-tester", - "created_at": "2017-02-17T13:11:43Z", - "updated_at": "2017-02-17T13:11:43Z" + "created_at": "2017-03-19T12:38:56Z", + "updated_at": "2017-03-19T12:38:56Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/c4224ad203f5497569452ff05284124eb7030602", + "id": 1169406386, + "state": "error", + "description": "This commit cannot be built", + "target_url": "https://ci.dlang.io/job/dlang-org/job/phobos/job/PR-4551/5/display/redirect", + "context": "continuous-integration/jenkins/pr-merge", + "created_at": "2017-04-21T13:28:53Z", + "updated_at": "2017-04-21T13:28:53Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/c4224ad203f5497569452ff05284124eb7030602", + "id": 1339826394, + "state": "error", + "description": "Merge failed", + "target_url": "http://dtest.dlang.io/results/63c920e1eb1f1f184784f838badb8b48990afb0f/c4224ad203f5497569452ff05284124eb7030602/", + "context": "CyberShadow/DAutoTest", + "created_at": "2017-06-29T09:41:21Z", + "updated_at": "2017-06-29T09:41:21Z" } ], "sha": "c4224ad203f5497569452ff05284124eb7030602", - "total_count": 3, + "total_count": 4, "repository": { "id": 1257084, "name": "phobos", @@ -41,7 +51,7 @@ "owner": { "login": "dlang", "id": 565913, - "avatar_url": "https://avatars.githubusercontent.com/u/565913?v=3", + "avatar_url": "https://avatars3.githubusercontent.com/u/565913?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dlang", "html_url": "https://github.com/dlang", diff --git a/data/payloads/github_repos_dlang_phobos_commits_d2c7d3761b73405ee39da3fd7fe5030dee35a39e_status b/data/payloads/github_repos_dlang_phobos_commits_d2c7d3761b73405ee39da3fd7fe5030dee35a39e_status new file mode 100644 index 0000000..44f43c1 --- /dev/null +++ b/data/payloads/github_repos_dlang_phobos_commits_d2c7d3761b73405ee39da3fd7fe5030dee35a39e_status @@ -0,0 +1,124 @@ +{ + "state": "success", + "statuses": [ + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/d2c7d3761b73405ee39da3fd7fe5030dee35a39e", + "id": 915017858, + "state": "success", + "description": "Your tests passed on CircleCI!", + "target_url": "https://circleci.com/gh/dlang/phobos/1010?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link", + "context": "ci/circleci", + "created_at": "2016-12-16T09:25:11Z", + "updated_at": "2016-12-16T09:25:11Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/d2c7d3761b73405ee39da3fd7fe5030dee35a39e", + "id": 915018626, + "state": "success", + "description": "100% of diff hit (target 89.397%)", + "target_url": "https://codecov.io/gh/dlang/phobos/compare/72af0090db27e438cfbcd3d1b9a0343a71079d42...d2c7d3761b73405ee39da3fd7fe5030dee35a39e", + "context": "codecov/patch", + "created_at": "2016-12-16T09:25:42Z", + "updated_at": "2016-12-16T09:25:42Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/d2c7d3761b73405ee39da3fd7fe5030dee35a39e", + "id": 915018658, + "state": "success", + "description": "89.411% (+0.013%) compared to 72af009", + "target_url": "https://codecov.io/gh/dlang/phobos/compare/72af0090db27e438cfbcd3d1b9a0343a71079d42...d2c7d3761b73405ee39da3fd7fe5030dee35a39e", + "context": "codecov/project", + "created_at": "2016-12-16T09:25:43Z", + "updated_at": "2016-12-16T09:25:43Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/d2c7d3761b73405ee39da3fd7fe5030dee35a39e", + "id": 915530379, + "state": "success", + "description": "Documentation OK (no changes)", + "target_url": "http://dtest.thecybershadow.net/results/9273e954e7891fbece18eb27cefd375fd0694b8a/d2c7d3761b73405ee39da3fd7fe5030dee35a39e/", + "context": "CyberShadow/DAutoTest", + "created_at": "2016-12-16T14:59:13Z", + "updated_at": "2016-12-16T14:59:13Z" + }, + { + "url": "https://api.github.com/repos/dlang/phobos/statuses/d2c7d3761b73405ee39da3fd7fe5030dee35a39e", + "id": 915565419, + "state": "success", + "description": "Pass: 10", + "target_url": "https://auto-tester.puremagic.com/pull-history.ghtml?projectid=1&repoid=3&pullid=4921", + "context": "auto-tester", + "created_at": "2016-12-16T15:16:46Z", + "updated_at": "2016-12-16T15:16:46Z" + } + ], + "sha": "d2c7d3761b73405ee39da3fd7fe5030dee35a39e", + "total_count": 5, + "repository": { + "id": 1257084, + "name": "phobos", + "full_name": "dlang/phobos", + "owner": { + "login": "dlang", + "id": 565913, + "avatar_url": "https://avatars3.githubusercontent.com/u/565913?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dlang", + "html_url": "https://github.com/dlang", + "followers_url": "https://api.github.com/users/dlang/followers", + "following_url": "https://api.github.com/users/dlang/following{/other_user}", + "gists_url": "https://api.github.com/users/dlang/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dlang/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dlang/subscriptions", + "organizations_url": "https://api.github.com/users/dlang/orgs", + "repos_url": "https://api.github.com/users/dlang/repos", + "events_url": "https://api.github.com/users/dlang/events{/privacy}", + "received_events_url": "https://api.github.com/users/dlang/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/dlang/phobos", + "description": "The standard library of the D programming language", + "fork": false, + "url": "https://api.github.com/repos/dlang/phobos", + "forks_url": "https://api.github.com/repos/dlang/phobos/forks", + "keys_url": "https://api.github.com/repos/dlang/phobos/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/dlang/phobos/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/dlang/phobos/teams", + "hooks_url": "https://api.github.com/repos/dlang/phobos/hooks", + "issue_events_url": "https://api.github.com/repos/dlang/phobos/issues/events{/number}", + "events_url": "https://api.github.com/repos/dlang/phobos/events", + "assignees_url": "https://api.github.com/repos/dlang/phobos/assignees{/user}", + "branches_url": "https://api.github.com/repos/dlang/phobos/branches{/branch}", + "tags_url": "https://api.github.com/repos/dlang/phobos/tags", + "blobs_url": "https://api.github.com/repos/dlang/phobos/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/dlang/phobos/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/dlang/phobos/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/dlang/phobos/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/dlang/phobos/statuses/{sha}", + "languages_url": "https://api.github.com/repos/dlang/phobos/languages", + "stargazers_url": "https://api.github.com/repos/dlang/phobos/stargazers", + "contributors_url": "https://api.github.com/repos/dlang/phobos/contributors", + "subscribers_url": "https://api.github.com/repos/dlang/phobos/subscribers", + "subscription_url": "https://api.github.com/repos/dlang/phobos/subscription", + "commits_url": "https://api.github.com/repos/dlang/phobos/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/dlang/phobos/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/dlang/phobos/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/dlang/phobos/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/dlang/phobos/contents/{+path}", + "compare_url": "https://api.github.com/repos/dlang/phobos/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/dlang/phobos/merges", + "archive_url": "https://api.github.com/repos/dlang/phobos/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/dlang/phobos/downloads", + "issues_url": "https://api.github.com/repos/dlang/phobos/issues{/number}", + "pulls_url": "https://api.github.com/repos/dlang/phobos/pulls{/number}", + "milestones_url": "https://api.github.com/repos/dlang/phobos/milestones{/number}", + "notifications_url": "https://api.github.com/repos/dlang/phobos/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/dlang/phobos/labels{/name}", + "releases_url": "https://api.github.com/repos/dlang/phobos/releases{/id}", + "deployments_url": "https://api.github.com/repos/dlang/phobos/deployments" + }, + "commit_url": "https://api.github.com/repos/dlang/phobos/commits/d2c7d3761b73405ee39da3fd7fe5030dee35a39e", + "url": "https://api.github.com/repos/dlang/phobos/commits/d2c7d3761b73405ee39da3fd7fe5030dee35a39e/status" +} diff --git a/data/payloads/github_repos_vibe-d_vibe-core_commits_04b3575c14dc7ad9971e19f153f3e3d712c1bdde_status b/data/payloads/github_repos_vibe-d_vibe-core_commits_04b3575c14dc7ad9971e19f153f3e3d712c1bdde_status new file mode 100644 index 0000000..36f5ea7 --- /dev/null +++ b/data/payloads/github_repos_vibe-d_vibe-core_commits_04b3575c14dc7ad9971e19f153f3e3d712c1bdde_status @@ -0,0 +1,114 @@ +{ + "state": "success", + "statuses": [ + { + "url": "https://api.github.com/repos/vibe-d/vibe-core/statuses/04b3575c14dc7ad9971e19f153f3e3d712c1bdde", + "id": 1347064349, + "state": "success", + "description": "The Travis CI build passed", + "target_url": "https://travis-ci.org/vibe-d/vibe-core/builds/249443702?utm_source=github_status&utm_medium=notification", + "context": "continuous-integration/travis-ci/pr", + "created_at": "2017-07-03T00:08:40Z", + "updated_at": "2017-07-03T00:08:40Z" + }, + { + "url": "https://api.github.com/repos/vibe-d/vibe-core/statuses/04b3575c14dc7ad9971e19f153f3e3d712c1bdde", + "id": 1347080400, + "state": "success", + "description": "AppVeyor build succeeded", + "target_url": "https://ci.appveyor.com/project/s-ludwig/vibe-core/build/1.0.71", + "context": "continuous-integration/appveyor/pr", + "created_at": "2017-07-03T00:32:18Z", + "updated_at": "2017-07-03T00:32:18Z" + }, + { + "url": "https://api.github.com/repos/vibe-d/vibe-core/statuses/04b3575c14dc7ad9971e19f153f3e3d712c1bdde", + "id": 1347080785, + "state": "success", + "description": "Coverage not affected when comparing 346ce03...04b3575", + "target_url": "https://codecov.io/gh/vibe-d/vibe-core/compare/346ce03cbd1a192d7a5fad3466966f5a340f33bd...04b3575c14dc7ad9971e19f153f3e3d712c1bdde", + "context": "codecov/patch", + "created_at": "2017-07-03T00:32:54Z", + "updated_at": "2017-07-03T00:32:54Z" + }, + { + "url": "https://api.github.com/repos/vibe-d/vibe-core/statuses/04b3575c14dc7ad9971e19f153f3e3d712c1bdde", + "id": 1347080790, + "state": "success", + "description": "56.168% (+0.027%) compared to 346ce03", + "target_url": "https://codecov.io/gh/vibe-d/vibe-core/compare/346ce03cbd1a192d7a5fad3466966f5a340f33bd...04b3575c14dc7ad9971e19f153f3e3d712c1bdde", + "context": "codecov/project", + "created_at": "2017-07-03T00:32:54Z", + "updated_at": "2017-07-03T00:32:54Z" + } + ], + "sha": "04b3575c14dc7ad9971e19f153f3e3d712c1bdde", + "total_count": 4, + "repository": { + "id": 52903464, + "name": "vibe-core", + "full_name": "vibe-d/vibe-core", + "owner": { + "login": "vibe-d", + "id": 17060480, + "avatar_url": "https://avatars0.githubusercontent.com/u/17060480?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vibe-d", + "html_url": "https://github.com/vibe-d", + "followers_url": "https://api.github.com/users/vibe-d/followers", + "following_url": "https://api.github.com/users/vibe-d/following{/other_user}", + "gists_url": "https://api.github.com/users/vibe-d/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vibe-d/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vibe-d/subscriptions", + "organizations_url": "https://api.github.com/users/vibe-d/orgs", + "repos_url": "https://api.github.com/users/vibe-d/repos", + "events_url": "https://api.github.com/users/vibe-d/events{/privacy}", + "received_events_url": "https://api.github.com/users/vibe-d/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/vibe-d/vibe-core", + "description": "Repository for the next generation of vibe.d's core package.", + "fork": false, + "url": "https://api.github.com/repos/vibe-d/vibe-core", + "forks_url": "https://api.github.com/repos/vibe-d/vibe-core/forks", + "keys_url": "https://api.github.com/repos/vibe-d/vibe-core/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/vibe-d/vibe-core/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/vibe-d/vibe-core/teams", + "hooks_url": "https://api.github.com/repos/vibe-d/vibe-core/hooks", + "issue_events_url": "https://api.github.com/repos/vibe-d/vibe-core/issues/events{/number}", + "events_url": "https://api.github.com/repos/vibe-d/vibe-core/events", + "assignees_url": "https://api.github.com/repos/vibe-d/vibe-core/assignees{/user}", + "branches_url": "https://api.github.com/repos/vibe-d/vibe-core/branches{/branch}", + "tags_url": "https://api.github.com/repos/vibe-d/vibe-core/tags", + "blobs_url": "https://api.github.com/repos/vibe-d/vibe-core/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/vibe-d/vibe-core/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/vibe-d/vibe-core/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/vibe-d/vibe-core/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/vibe-d/vibe-core/statuses/{sha}", + "languages_url": "https://api.github.com/repos/vibe-d/vibe-core/languages", + "stargazers_url": "https://api.github.com/repos/vibe-d/vibe-core/stargazers", + "contributors_url": "https://api.github.com/repos/vibe-d/vibe-core/contributors", + "subscribers_url": "https://api.github.com/repos/vibe-d/vibe-core/subscribers", + "subscription_url": "https://api.github.com/repos/vibe-d/vibe-core/subscription", + "commits_url": "https://api.github.com/repos/vibe-d/vibe-core/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/vibe-d/vibe-core/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/vibe-d/vibe-core/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/vibe-d/vibe-core/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/vibe-d/vibe-core/contents/{+path}", + "compare_url": "https://api.github.com/repos/vibe-d/vibe-core/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/vibe-d/vibe-core/merges", + "archive_url": "https://api.github.com/repos/vibe-d/vibe-core/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/vibe-d/vibe-core/downloads", + "issues_url": "https://api.github.com/repos/vibe-d/vibe-core/issues{/number}", + "pulls_url": "https://api.github.com/repos/vibe-d/vibe-core/pulls{/number}", + "milestones_url": "https://api.github.com/repos/vibe-d/vibe-core/milestones{/number}", + "notifications_url": "https://api.github.com/repos/vibe-d/vibe-core/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/vibe-d/vibe-core/labels{/name}", + "releases_url": "https://api.github.com/repos/vibe-d/vibe-core/releases{/id}", + "deployments_url": "https://api.github.com/repos/vibe-d/vibe-core/deployments" + }, + "commit_url": "https://api.github.com/repos/vibe-d/vibe-core/commits/04b3575c14dc7ad9971e19f153f3e3d712c1bdde", + "url": "https://api.github.com/repos/vibe-d/vibe-core/commits/04b3575c14dc7ad9971e19f153f3e3d712c1bdde/status" +} diff --git a/source/dlangbot/app.d b/source/dlangbot/app.d index bfe0e18..97ac80b 100644 --- a/source/dlangbot/app.d +++ b/source/dlangbot/app.d @@ -93,20 +93,22 @@ void githubHook(HTTPServerRequest req, HTTPServerResponse res) { case "ping": return res.writeBody("pong"); + case "status": - string repoSlug = json["name"].get!string; - string state = json["state"].get!string; + auto state = json["state"].get!string; + auto repoSlug = json["name"].get!string; logDebug("[github/pull_request](%s): state=%s, sha=%s, url=%s", repoSlug, state, json["sha"], json["target_url"]); // no need to trigger the checker for failure/pending if (state == "success") prThrottler(repoSlug); return res.writeBody("handled"); - case "pull_request": + case "pull_request": auto action = json["action"].get!string; - string repoSlug = json["repository"]["full_name"].get!string; - logDebug("[github/pull_request](%s/%s): action=%s", repoSlug, json["number"], action); + auto repoSlug = json["repository"]["full_name"].get!string; + auto pullRequest = json["pull_request"].deserializeJson!PullRequest; + logInfo("[github/pull_request](%s#%s): action=%s", repoSlug, pullRequest.number, action); switch (action) { @@ -119,25 +121,21 @@ void githubHook(HTTPServerRequest req, HTTPServerResponse res) goto case; case "opened", "reopened", "synchronize", "labeled", "edited": - auto pullRequest = json["pull_request"].deserializeJson!PullRequest; runTaskHelper(&handlePR, action, &pullRequest); return res.writeBody("handled"); default: return res.writeBody("ignored"); } + case "pull_request_review": - runTaskHelper({ - import std.algorithm : among, filter; - string repoSlug = json["repository"]["full_name"].get!string; - logDebug("[github/pull_request_review](%s/%s): state=%s", repoSlug, json["review"]["state"]); - auto pullRequest = json["pull_request"].deserializeJson!PullRequest; - auto labels = ghGetRequest(pullRequest.labelsURL) - .readJson - .deserializeJson!(GHLabel[]); - if (auto method = autoMergeMethod(labels)) - pullRequest.tryMerge(method); - }); + auto state = json["review"]["state"].get!string; + auto repoSlug = json["repository"]["full_name"].get!string; + auto pullRequest = json["pull_request"].deserializeJson!PullRequest; + logInfo("[github/pull_request_review](%s#%s): state=%s", repoSlug, pullRequest.number, state); + + runTaskHelper(&handleReview, state, &pullRequest); return res.writeBody("handled"); + default: return res.writeVoidBody(); } @@ -248,6 +246,19 @@ void handlePR(string action, PullRequest* _pr) } } +void handleReview(string action, PullRequest* _pr) +{ + import std.algorithm : among, filter; + + const PullRequest pr = *_pr; + + auto labels = ghGetRequest(pr.labelsURL) + .readJson + .deserializeJson!(GHLabel[]); + if (auto method = autoMergeMethod(labels)) + pr.tryMerge(method); +} + void setBotTimer(C)(Duration dur, C callback) { if (runAsync) diff --git a/source/dlangbot/cron.d b/source/dlangbot/cron.d index b67364a..1cde15b 100644 --- a/source/dlangbot/cron.d +++ b/source/dlangbot/cron.d @@ -138,10 +138,11 @@ mergable: auto detectPRWithPersistentCIFailures(PRTuple t) { // label PR with persistent CI failures - auto status = t.pr.status; - auto failCount = status.filter!((e){ - if (e.state == GHCiStatus.State.failure || - e.state == GHCiStatus.State.error) + // TODO: unclear whether we want all statuses for PR commit, or only the latest + auto status = t.pr.combinedStatus; + auto failCount = status.latestStatuses.filter!((e){ + if (e.state == CIState.failure || + e.state == CIState.error) switch (e.context) { case "auto-tester": case "CyberShadow/DAutoTest": diff --git a/source/dlangbot/github.d b/source/dlangbot/github.d index 2a42283..724a252 100644 --- a/source/dlangbot/github.d +++ b/source/dlangbot/github.d @@ -162,17 +162,24 @@ Json[] tryMerge(in ref PullRequest pr, GHMerge.MergeMethod method) { import std.conv : to; + const status = pr.combinedStatus; + if (status.state != CIState.success) + { + logInfo("Can't auto-merge PR %s#%d with combined CI state: %s", pr.repoSlug, pr.number, status.state); + return null; + } + auto commits = ghGetRequest(pr.commitsURL).readJson[]; if (!pr.isOpen) { - logWarn("Can't auto-merge PR %s/%d - it is already closed", pr.repoSlug, pr.number); + logWarn("Can't auto-merge PR %s#%d - it is already closed", pr.repoSlug, pr.number); return commits; } if (commits.length == 0) { - logWarn("Can't auto-merge PR %s/%d has no commits attached", pr.repoSlug, pr.number); + logWarn("Can't auto-merge PR %s#%d has no commits attached", pr.repoSlug, pr.number); return commits; } @@ -262,10 +269,10 @@ void searchForAutoMergePrs(string repoSlug) static immutable labels = ["auto-merge", "auto-merge-squash"]; foreach (issue; getIssuesForLabels(repoSlug, labels)) { - if (!issue.isPullRequest) + if (!issue.isPullRequest) // TODO: query is:pr continue; - auto pr = issue.toPullRequest; + auto pr = issue.pullRequest; if (auto method = autoMergeMethod(issue.labels)) pr.tryMerge(method); } diff --git a/source/dlangbot/github_api.d b/source/dlangbot/github_api.d index f9b7e03..37db950 100644 --- a/source/dlangbot/github_api.d +++ b/source/dlangbot/github_api.d @@ -174,7 +174,7 @@ struct PullRequest string labelsURL() const { return "%s/repos/%s/issues/%d/labels".format(githubAPIURL, repoSlug, number); } string reviewsURL() const { return "%s/repos/%s/pulls/%d/reviews".format(githubAPIURL, repoSlug, number); } string mergeURL() const { return "%s/repos/%s/pulls/%d/merge".format(githubAPIURL, repoSlug, number); } - string statusURL() const { return "%s/repos/%s/status/%s".format(githubAPIURL, repoSlug, head.sha); } + string combinedStatusURL() const { return "%s/repos/%s/commits/%s/status".format(githubAPIURL, repoSlug, head.sha); } string membersURL() const { return "%s/orgs/%s/public_members".format(githubAPIURL, base.repo.owner.login); } string pid() const @@ -202,10 +202,11 @@ struct PullRequest .readJson .deserializeJson!(GHReview[]); } - GHCiStatus[] status() const { - return ghGetRequest(statusURL) - .readJson["statuses"] - .deserializeJson!(GHCiStatus[]); + /// get combined status (contains latest status for each CI context) + GHCombinedCIStatus combinedStatus() const { + return ghGetRequest(combinedStatusURL) + .readJson + .deserializeJson!GHCombinedCIStatus; } GHLabel[] labels() const { @@ -296,10 +297,11 @@ struct GHCommit GHUser committer; } -struct GHCiStatus +enum CIState { error /*default*/, failure, success, pending } + +struct GHCIStatus { - enum State { success, error, failure, pending } - @byName State state; + @byName CIState state; string description; @name("target_url") string targetUrl; string context; // "CyberShadow/DAutoTest", "Project Tester", @@ -307,6 +309,12 @@ struct GHCiStatus // "codecov/patch", "continuous-integration/travis-ci/pr" } +struct GHCombinedCIStatus +{ + @byName CIState state; + @name("statuses") GHCIStatus[] latestStatuses; // latest per context +} + struct GHMerge { enum MergeMethod { none = 0, merge, squash, rebase } @@ -335,7 +343,7 @@ struct GHIssue // this isn't really useful except for detecting whether it's a pull request @name("pull_request") Nullable!SimplifiedGHPullRequest _pullRequest; - bool isPullRequest() + bool isPullRequest() const { return !_pullRequest.isNull; } @@ -378,18 +386,13 @@ struct GHIssue assert(issue.repoSlug == "dlang/phobos"); } - // warning: not all fields can be filled - PullRequest toPullRequest() const + PullRequest pullRequest() const { - PullRequest pr; - pr.base.repo = PullRequest.Repo.init; - pr.base.repo.fullName = repoSlug; - static foreach (symbol; ["number", "state", "title", "user", "assignee", - "createdAt", "updatedAt", "closedAt"]) - { - mixin("pr." ~ symbol ~ " = " ~ symbol ~ ";"); - } - return pr; + assert(isPullRequest); + + return ghGetRequest(_pullRequest.url) + .readJson + .deserializeJson!PullRequest; } } diff --git a/test/cronjob.d b/test/cronjob.d index 34793bd..bcd717d 100644 --- a/test/cronjob.d +++ b/test/cronjob.d @@ -12,7 +12,7 @@ void dontTestStalled(ref Json j) j[$ - 1]["updated_at"] = (Clock.currTime - 2.days).toISOExtString; } -// test the first items of the cron job +@("test-first-items-of-cron-job") unittest { setAPIExpectations( @@ -21,7 +21,7 @@ unittest res.headers["Link"] = `; rel="next", ; rel="last"`; }, "/github/repos/dlang/phobos/pulls/2526", - "/github/repos/dlang/phobos/status/a04acd6a2813fb344d3e47369cf7fd64523ece44", + "/github/repos/dlang/phobos/commits/a04acd6a2813fb344d3e47369cf7fd64523ece44/status", "/github/repos/dlang/phobos/issues/2526/comments", "/github/repos/dlang/phobos/pulls/2526/comments", "/github/repos/dlang/phobos/issues/2526/labels", @@ -30,7 +30,7 @@ unittest assert(req.json[].map!(e => e.get!string).equal(["blocked", "stalled"])); }, "/github/repos/dlang/phobos/pulls/3534", - "/github/repos/dlang/phobos/status/b7bf452ca52c2a529e79a830eee97310233e3a9c", + "/github/repos/dlang/phobos/commits/b7bf452ca52c2a529e79a830eee97310233e3a9c/status", "/github/repos/dlang/phobos/issues/3534/comments", "/github/repos/dlang/phobos/pulls/3534/comments", "/github/repos/dlang/phobos/issues/3534/labels", @@ -41,7 +41,7 @@ unittest )); }, "/github/repos/dlang/phobos/pulls/4551", - "/github/repos/dlang/phobos/status/c4224ad203f5497569452ff05284124eb7030602", + "/github/repos/dlang/phobos/commits/c4224ad203f5497569452ff05284124eb7030602/status", "/github/repos/dlang/phobos/issues/4551/comments", "/github/repos/dlang/phobos/pulls/4551/comments", "/github/repos/dlang/phobos/issues/4551/labels", @@ -52,7 +52,7 @@ unittest )); }, "/github/repos/dlang/phobos/pulls/3620", - "/github/repos/dlang/phobos/status/5b8b90e1824cb90635719f6d3b1f6c195a95a47e", + "/github/repos/dlang/phobos/commits/5b8b90e1824cb90635719f6d3b1f6c195a95a47e/status", "/github/repos/dlang/phobos/issues/3620/comments", "/github/repos/dlang/phobos/pulls/3620/comments", "/github/repos/dlang/phobos/issues/3620/labels", @@ -66,7 +66,7 @@ unittest testCronDaily(repositories); } -// test that stalled isn't falsely removed (e.g. by recent labelling) +@("stalled-sticks-on-labelling") unittest { setAPIExpectations( @@ -79,7 +79,7 @@ unittest // simulate a recent label update j["updated_at"] = (Clock.currTime - 2.days).toISOExtString; }, - "/github/repos/dlang/phobos/status/a04acd6a2813fb344d3e47369cf7fd64523ece44", + "/github/repos/dlang/phobos/commits/a04acd6a2813fb344d3e47369cf7fd64523ece44/status", "/github/repos/dlang/phobos/issues/2526/comments", "/github/repos/dlang/phobos/pulls/2526/comments", "/github/repos/dlang/phobos/issues/2526/labels", @@ -92,7 +92,7 @@ unittest testCronDaily(repositories); } -// test that no label updates are sent if no activity was found +@("no-label-updates-with-inactivity") unittest { setAPIExpectations( @@ -103,7 +103,7 @@ unittest "/github/repos/dlang/phobos/pulls/2526", (ref Json j) { j["mergeable"] = false; }, - "/github/repos/dlang/phobos/status/a04acd6a2813fb344d3e47369cf7fd64523ece44", + "/github/repos/dlang/phobos/commits/a04acd6a2813fb344d3e47369cf7fd64523ece44/status", "/github/repos/dlang/phobos/issues/2526/comments", &dontTestStalled, "/github/repos/dlang/phobos/pulls/2526/comments", ); @@ -111,7 +111,7 @@ unittest testCronDaily(repositories); } -// test that the merge state gets refreshed +@("merge-state-refreshed") unittest { setAPIExpectations( @@ -126,7 +126,7 @@ unittest j["mergeable"] = false; j["mergeable_state"] = "dirty"; }, - "/github/repos/dlang/phobos/status/a04acd6a2813fb344d3e47369cf7fd64523ece44", + "/github/repos/dlang/phobos/commits/a04acd6a2813fb344d3e47369cf7fd64523ece44/status", "/github/repos/dlang/phobos/issues/2526/comments", &dontTestStalled, "/github/repos/dlang/phobos/pulls/2526/comments", "/github/repos/dlang/phobos/issues/2526/labels", @@ -139,8 +139,7 @@ unittest testCronDaily(repositories); } -// for "blocked" PRs, the `mergeable` attribute should be preferred -// if mergeable is true, "needs rebase" should be removed +@("blocked-mergeable-removes-needs-rebase") unittest { setAPIExpectations( @@ -153,7 +152,7 @@ unittest j["mergeable"] = true; j["mergeable_state"] = "blocked"; }, - "/github/repos/dlang/phobos/status/a04acd6a2813fb344d3e47369cf7fd64523ece44", + "/github/repos/dlang/phobos/commits/a04acd6a2813fb344d3e47369cf7fd64523ece44/status", "/github/repos/dlang/phobos/issues/2526/comments", &dontTestStalled, "/github/repos/dlang/phobos/pulls/2526/comments", "/github/repos/dlang/phobos/issues/2526/labels", @@ -166,7 +165,7 @@ unittest testCronDaily(repositories); } -// test that two or more failing CI trigger "needs work" +@("more-than-two-failures-requires-work") unittest { setAPIExpectations( @@ -175,7 +174,7 @@ unittest j = Json([j[0]]); }, "/github/repos/dlang/phobos/pulls/2526", - "/github/repos/dlang/phobos/status/a04acd6a2813fb344d3e47369cf7fd64523ece44", (ref Json j) { + "/github/repos/dlang/phobos/commits/a04acd6a2813fb344d3e47369cf7fd64523ece44/status", (ref Json j) { j["statuses"][1]["state"] = "error"; j["statuses"][2]["state"] = "failure"; }, diff --git a/test/labels.d b/test/labels.d index c725e43..e154c87 100644 --- a/test/labels.d +++ b/test/labels.d @@ -18,6 +18,7 @@ unittest unittest { setAPIExpectations( + "/github/repos/dlang/phobos/commits/d2c7d3761b73405ee39da3fd7fe5030dee35a39e/status", "/github/repos/dlang/phobos/pulls/4921/commits", "/github/repos/dlang/phobos/issues/4921/labels", (ref Json j) { j[0]["name"] = "auto-merge"; @@ -27,10 +28,11 @@ unittest postGitHubHook("dlang_phobos_label_4921.json"); } -@("fail-to-auto-merge") +@("succeed-to-auto-merge") unittest { setAPIExpectations( + "/github/repos/dlang/phobos/commits/d2c7d3761b73405ee39da3fd7fe5030dee35a39e/status", "/github/repos/dlang/phobos/pulls/4921/commits", "/github/repos/dlang/phobos/issues/4921/labels", (ref Json j) { j[0]["name"] = "auto-merge"; @@ -41,7 +43,6 @@ unittest }, "/github/users/9il", "/github/repos/dlang/phobos/pulls/4921/merge", - HTTPStatus.methodNotAllowed, (scope HTTPServerRequest req, scope HTTPServerResponse res) { // https://developer.github.com/v3/pulls/#response-if-merge-cannot-be-performed assert(req.json["sha"] == "d2c7d3761b73405ee39da3fd7fe5030dee35a39e"); @@ -62,6 +63,7 @@ unittest unittest { setAPIExpectations( + "/github/repos/dlang/phobos/commits/d2c7d3761b73405ee39da3fd7fe5030dee35a39e/status", "/github/repos/dlang/phobos/pulls/4921/commits", "/github/repos/dlang/phobos/issues/4921/labels", (ref Json j) { j[0]["name"] = "auto-merge-squash"; @@ -87,6 +89,39 @@ unittest ); } +@("failing-ci-prevents-auto-merge") +unittest +{ + setAPIExpectations( + "/github/repos/dlang/phobos/commits/d2c7d3761b73405ee39da3fd7fe5030dee35a39e/status", (ref Json j) { + j["status"] = "failure"; + }, + "/github/repos/dlang/phobos/pulls/4921/commits", + "/github/repos/dlang/phobos/issues/4921/labels", (ref Json j) { + j[0]["name"] = "auto-merge"; + }, + "/github/repos/dlang/phobos/issues/4921/events", (ref Json j) { + assert(j[1]["event"] == "labeled"); + j[1]["label"]["name"] = "auto-merge"; + }, + "/github/users/9il", + "/github/repos/dlang/phobos/pulls/4921/merge", + (scope HTTPServerRequest req, scope HTTPServerResponse res) { + // https://developer.github.com/v3/pulls/#response-if-merge-cannot-be-performed + assert(req.json["sha"] == "d2c7d3761b73405ee39da3fd7fe5030dee35a39e"); + assert(req.json["merge_method"] == "merge"); + assert(req.json["commit_message"] == "Issue 8573 - A simpler Phobos function that returns the index of the …\n"~ + "merged-on-behalf-of: Ilya Yaroshenko "); + } + ); + + postGitHubHook("dlang_phobos_label_4921.json", "pull_request", + (ref Json j, scope HTTPClientRequest req){ + j["pull_request"]["state"] = "open"; + } + ); +} + @("label-via-title") unittest { @@ -136,6 +171,7 @@ unittest unittest { setAPIExpectations( + "/github/repos/vibe-d/vibe-core/commits/04b3575c14dc7ad9971e19f153f3e3d712c1bdde/status", "/github/repos/vibe-d/vibe-core/pulls/22/commits", "/github/repos/vibe-d/vibe-core/issues/22/labels", "/github/repos/vibe-d/vibe-core/issues/22/events", @@ -156,6 +192,9 @@ unittest unittest { setAPIExpectations( + "/github/repos/dlang-tour/core/commits/4941624d1af77e84565ec86979c21c1d582b1c06/status", (ref Json j) { + j["state"] = "success"; // fake it till you... + }, "/github/repos/dlang-tour/core/pulls/583/commits", "/github/repos/dlang-tour/core/issues/583/labels", "/github/repos/dlang-tour/core/issues/583/events", diff --git a/test/review.d b/test/review.d index 58a56a9..013a224 100644 --- a/test/review.d +++ b/test/review.d @@ -1,10 +1,11 @@ import utils; -// review approved --> look if merge possible --> tryMerge +@("check-auto-merge-on-approval-positive") unittest { setAPIExpectations( "/github/repos/dlang/phobos/issues/5114/labels", + "/github/repos/dlang/phobos/commits/0fb66f092b897b55318509c6582008b3f912311a/status", "/github/repos/dlang/phobos/pulls/5114/commits", "/github/repos/dlang/phobos/issues/5114/events", "/github/users/ZombineDev", @@ -20,6 +21,7 @@ unittest } // review approved --> look if merge possible --> no auto-merge +@("check-auto-merge-on-approval-negative") unittest { setAPIExpectations( diff --git a/test/status.d b/test/status.d index 2d2e00e..540ca37 100644 --- a/test/status.d +++ b/test/status.d @@ -1,6 +1,6 @@ import utils; -// send pending status event -> no action +@("pending-ignored") unittest { setAPIExpectations(); @@ -8,7 +8,7 @@ unittest postGitHubHook("dlang_dmd_status_6324.json", "status"); } -// send failed status event -> no action +@("failed-ignored") unittest { setAPIExpectations(); @@ -20,9 +20,12 @@ unittest ); } -// send success status event -> tryMergeForAllOpenPrs -> no action (no auto-merge PR) +@("trigger-merge-check-on-success") unittest { + prThrottler.reset; + + // success status triggers merge check for all open auto-merge PRs setAPIExpectations( "/github/repos/dlang/dmd/issues?state=open&labels=auto-merge", (ref Json j) { j = Json.emptyArray; @@ -37,11 +40,8 @@ unittest j["state"] = "success"; } ); -} -// send success status event within throttle time -> no action -unittest -{ + // not triggered again within throttle time setAPIExpectations(); postGitHubHook("dlang_dmd_status_6324.json", "status", @@ -51,17 +51,19 @@ unittest ); } -// send success status event -> tryMergeForAllOpenPrs -> merge() -// PR 6237 has the label "auto-merge" +@("trigger-merge-check-and-merge-on-success") unittest { prThrottler.reset; setAPIExpectations( "/github/repos/dlang/dmd/issues?state=open&labels=auto-merge", + // PR 6327 has the label "auto-merge" "/github/repos/dlang/dmd/issues?state=open&labels=auto-merge-squash", (ref Json j) { j = Json.emptyArray; }, + "/github/repos/dlang/dmd/pulls/6327", + "/github/repos/dlang/dmd/commits/782fd3fdd4a9c23e1307b4b963b443ed60517dfe/status", "/github/repos/dlang/dmd/pulls/6327/commits", "/github/repos/dlang/dmd/issues/6327/events", "/github/repos/dlang/dmd/pulls/6327/merge", @@ -80,8 +82,7 @@ unittest ); } -// send success status event -> tryMergeForAllOpenPrs -> merge() -// PR 6237 has the label "auto-merge-squash" +@("trigger-merge-check-and-squash-on-success") unittest { prThrottler.reset; @@ -91,6 +92,11 @@ unittest j = Json.emptyArray; }, "/github/repos/dlang/dmd/issues?state=open&labels=auto-merge-squash", + // PR 6328 has the label "auto-merge-squash" + "/github/repos/dlang/dmd/pulls/6328", + "/github/repos/dlang/dmd/commits/d6fc98058b637f9a558206847e6d7057ab9fb3de/status", (ref Json j) { + j["state"] = "success"; // fake + }, "/github/repos/dlang/dmd/pulls/6328/commits", "/github/repos/dlang/dmd/issues/6328/events", "/github/users/MartinNowak", @@ -110,16 +116,18 @@ unittest ); } -// send success status event -> tryMergeForAllOpenPrs -> merge() -// 6327 has "auto-merge" -// 6328 has "auto-merge-squash" +@("trigger-merge-check-and-merge-and-squash-on-success") unittest { prThrottler.reset; setAPIExpectations( "/github/repos/dlang/dmd/issues?state=open&labels=auto-merge", + // 6327 has "auto-merge" "/github/repos/dlang/dmd/issues?state=open&labels=auto-merge-squash", + // 6328 has "auto-merge-squash" + "/github/repos/dlang/dmd/pulls/6327", + "/github/repos/dlang/dmd/commits/782fd3fdd4a9c23e1307b4b963b443ed60517dfe/status", "/github/repos/dlang/dmd/pulls/6327/commits", "/github/repos/dlang/dmd/issues/6327/events", "/github/repos/dlang/dmd/pulls/6327/merge", @@ -129,6 +137,10 @@ unittest assert(req.json["commit_message"] == "Fix issue 16977 - bad debug info for function default arguments\n"~ "merged-on-behalf-of: unknown"); }, + "/github/repos/dlang/dmd/pulls/6328", + "/github/repos/dlang/dmd/commits/d6fc98058b637f9a558206847e6d7057ab9fb3de/status", (ref Json j) { + j["state"] = "success"; // fake + }, "/github/repos/dlang/dmd/pulls/6328/commits", "/github/repos/dlang/dmd/issues/6328/events", "/github/users/MartinNowak",