From 2e50440925f2253e11dbc6815c102a1d6255e3ba Mon Sep 17 00:00:00 2001 From: Thomas Baccelli Date: Fri, 26 Jun 2020 18:13:04 +0200 Subject: [PATCH] Add tests for the feedback feature --- app/config/services_test.yml | 8 +- src/AppBundle/Organizations/Repository.php | 16 +- .../Organizations/RepositoryInterface.php | 32 ++ src/AppBundle/PullRequests/Listener.php | 2 +- src/AppBundle/PullRequests/Repository.php | 2 +- src/AppBundle/Search/Repository.php | 11 +- src/AppBundle/Search/RepositoryInterface.php | 21 + .../Controller/WebhookControllerTest.php | 20 + .../Organisations/FakeRepository.php | 35 ++ .../AppBundle/PullRequests/FakeRepository.php | 141 ----- tests/AppBundle/Search/FakeRepository.php | 26 + .../pull_request_community_merged.json | 497 ++++++++++++++++++ ...l_request_community_merged_30days_ago.json | 497 ++++++++++++++++++ .../pull_request_organisation_merged.json | 497 ++++++++++++++++++ ...ged_authoratomiix_commenterprestonBot.json | 54 ++ 15 files changed, 1696 insertions(+), 163 deletions(-) create mode 100644 src/AppBundle/Organizations/RepositoryInterface.php create mode 100644 src/AppBundle/Search/RepositoryInterface.php create mode 100644 tests/AppBundle/Organisations/FakeRepository.php delete mode 100644 tests/AppBundle/PullRequests/FakeRepository.php create mode 100644 tests/AppBundle/Search/FakeRepository.php create mode 100644 tests/AppBundle/webhook_examples/pull_request_community_merged.json create mode 100644 tests/AppBundle/webhook_examples/pull_request_community_merged_30days_ago.json create mode 100644 tests/AppBundle/webhook_examples/pull_request_organisation_merged.json create mode 100644 tests/AppBundle/webhook_examples/repoloveOSStest_ispr_ismerged_authoratomiix_commenterprestonBot.json diff --git a/app/config/services_test.yml b/app/config/services_test.yml index a84c0ef..3edb4c4 100644 --- a/app/config/services_test.yml +++ b/app/config/services_test.yml @@ -32,6 +32,12 @@ services: # Integration tests shouldn't post comments to github Psr\Log\NullLogger: + Tests\AppBundle\Search\FakeRepository: + decorates: AppBundle\Search\RepositoryInterface + + Tests\AppBundle\Organisations\FakeRepository: + - ['%repository_username%'] + Tests\AppBundle\Comments\FakeCommentApi: - '@Github\Api\Issue\Comments' - '%repository_username%' @@ -53,7 +59,7 @@ services: - '@Tests\AppBundle\Commits\FakeRepository' - '@validator' - '@AppBundle\PullRequests\Repository' - - '@AppBundle\Organizations\Repository' + - '@Tests\AppBundle\Organisations\FakeRepository' - '@Psr\Log\NullLogger' AppBundle\Issues\Listener: diff --git a/src/AppBundle/Organizations/Repository.php b/src/AppBundle/Organizations/Repository.php index b600b44..bcee015 100644 --- a/src/AppBundle/Organizations/Repository.php +++ b/src/AppBundle/Organizations/Repository.php @@ -5,7 +5,7 @@ use Github\Api\Organization; use Github\Exception\RuntimeException; -class Repository +class Repository implements RepositoryInterface { /** * @var array list of teams (won't change during a request) @@ -28,7 +28,7 @@ public function __construct(Organization $organizationApi, $repositoryOwner) } /** - * @return array + * {@inheritdoc} */ public function getTeams() { @@ -48,7 +48,7 @@ public function getTeams() } /** - * @param string $teamName + * {@inheritdoc} */ public function getTeam(string $teamName) { @@ -58,9 +58,7 @@ public function getTeam(string $teamName) } /** - * @param string $teamName - * - * @return \Guzzle\Http\EntityBodyInterface|mixed|string + * {@inheritdoc} */ public function getTeamMembers(string $teamName) { @@ -77,11 +75,7 @@ public function getTeamMembers(string $teamName) } /** - * Check if a user is a member of the organisation. - * - * @param string $userLogin - * - * @return bool + * {@inheritdoc} */ public function isMember(string $userLogin) { diff --git a/src/AppBundle/Organizations/RepositoryInterface.php b/src/AppBundle/Organizations/RepositoryInterface.php new file mode 100644 index 0000000..3a9b823 --- /dev/null +++ b/src/AppBundle/Organizations/RepositoryInterface.php @@ -0,0 +1,32 @@ + 'pr_merged', + 'action' => 'ask for feedback', + ], + ], + ]; + $tests['Pull request from community merged less that 30 days ago'] = [ + 'pull_request', + 'pull_request_community_merged_30days_ago.json', + [], + ]; + $tests['Pull request from ps organisation merged'] = [ + 'pull_request', + 'pull_request_organisation_merged.json', + [], + ]; $tests['Pull request creation for critical bug'] = [ 'issues', 'issues.labeled.bug.json', diff --git a/tests/AppBundle/Organisations/FakeRepository.php b/tests/AppBundle/Organisations/FakeRepository.php new file mode 100644 index 0000000..a3595c9 --- /dev/null +++ b/tests/AppBundle/Organisations/FakeRepository.php @@ -0,0 +1,35 @@ +members = $members; + } + + public function getTeams() + { + // TODO: Implement getTeams() method. + } + + public function getTeam(string $teamName) + { + // TODO: Implement getTeam() method. + } + + public function getTeamMembers(string $teamName) + { + // TODO: Implement getTeamMembers() method. + } + + public function isMember(string $userLogin) + { + return \in_array($userLogin, $this->members, true); + } +} diff --git a/tests/AppBundle/PullRequests/FakeRepository.php b/tests/AppBundle/PullRequests/FakeRepository.php deleted file mode 100644 index a543878..0000000 --- a/tests/AppBundle/PullRequests/FakeRepository.php +++ /dev/null @@ -1,141 +0,0 @@ -searchRepository = $searchRepository; - $this->knpCommentsApi = $knpCommentsApi; - $this->repositoryUsername = $repositoryUsername; - $this->repositoryName = $repositoryName; - } - - public function findAll(string $base = 'develop') - { - $pullRequests = []; - $search = $this->searchRepository->getPullRequests(['base' => $base]); - - foreach ($search['items'] as $pullRequest) { - $pullRequests[] = PullRequest::createFromData($pullRequest); - } - - return $pullRequests; - } - - public function findAllWithLabel(string $label, string $base = 'develop') - { - $pullRequests = []; - $search = $this->searchRepository->getPullRequests( - [ - 'label' => $this->parseLabel($label), - 'base' => $base, - ] - ); - - foreach ($search['items'] as $pullRequest) { - $pullRequests[] = PullRequest::createFromData($pullRequest); - } - - return $pullRequests; - } - - public function getComments(PullRequest $pullRequest) - { - $commentsApi = $this->knpCommentsApi - ->all( - $this->repositoryUsername, - $this->repositoryName, - $pullRequest->getNumber() - ) - ; - - $comments = []; - foreach ($commentsApi as $comment) { - $comments[] = Comment::createFromData($comment); - } - - return $comments; - } - - /** - * {@inheritdoc} - */ - public function getCommentsFrom(PullRequest $pullRequest, $userLogin) - { - $comments = $this->getComments($pullRequest); - $userComments = []; - - foreach ($comments as $comment) { - if ($userLogin === $comment->getUserLogin()) { - $userComments[] = $comment; - } - } - - return $userComments; - } - - /** - * {@inheritdoc} - */ - public function getCommentsByExpressionFrom( - PullRequest $pullRequest, - $expression, - $userLogin - ) { - $userCommentsByExpression = []; - $userComments = $this->getCommentsFrom($pullRequest, $userLogin); - - foreach ($userComments as $userComment) { - if (false !== strpos($userComment->getBody(), $expression)) { - $userCommentsByExpression[] = $userComment; - } - } - - return $userCommentsByExpression; - } - - /** - * {@inheritdoc} - */ - public function removeCommentsIfExists(PullRequest $pullRequest, $pattern, $userLogin) - { - $comments = $this->getCommentsByExpressionFrom( - $pullRequest, - $pattern, - $userLogin - ) - ; - - if (count($comments) > 0) { - return true; - } - } - - private function parseLabel($label) - { - return '"'.$label.'"'; - } -} diff --git a/tests/AppBundle/Search/FakeRepository.php b/tests/AppBundle/Search/FakeRepository.php new file mode 100644 index 0000000..4b71997 --- /dev/null +++ b/tests/AppBundle/Search/FakeRepository.php @@ -0,0 +1,26 @@ +\r\n\r\n| Questions | Answers\r\n| ------------- | -------------------------------------------------------\r\n| Branch? | develop / 1.7.7.x\r\n| Description? | Please be specific when describing the PR.
Every detail helps: versions, browser/server configuration, specific module/theme, etc. Feel free to add more information below this table.\r\n| Type? | bug fix / improvement / new feature / refacto / critical\r\n| Category? | FO / BO / CO / IN / WS / TE / LO / ME / PM\r\n| BC breaks? | yes / no\r\n| Deprecations? | yes / no\r\n| Fixed ticket? | Fixes #{issue number here}.\r\n| How to test? | Please indicate how to best verify that this PR is correct.\r\n\r\n\r\n", + "created_at": "2020-06-23T10:35:26Z", + "updated_at": "2020-06-23T13:20:34Z", + "closed_at": "2020-06-23T13:20:34Z", + "merged_at": "2020-06-23T13:20:33Z", + "merge_commit_sha": "4722f85a5108a39cb64d27ef3e06c9ce6971a91e", + "assignee": null, + "assignees": [ + ], + "requested_reviewers": [ + ], + "requested_teams": [ + ], + "labels": [ + { + "id": 1618024322, + "node_id": "MDU6TGFiZWwxNjE4MDI0MzIy", + "url": "https://api.github.com/repos/atomiix/PrestaShop/labels/bug", + "name": "bug", + "color": "d73a4a", + "default": true, + "description": "Something isn't working" + } + ], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14/commits", + "review_comments_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14/comments", + "review_comment_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/14/comments", + "statuses_url": "https://api.github.com/repos/atomiix/PrestaShop/statuses/3c232adce8b71a77e4d4a51b30bfe7bdd68fbc51", + "head": { + "label": "atomiix:sample-pr", + "ref": "sample-pr", + "sha": "3c232adce8b71a77e4d4a51b30bfe7bdd68fbc51", + "user": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 215322337, + "node_id": "MDEwOlJlcG9zaXRvcnkyMTUzMjIzMzc=", + "name": "PrestaShop", + "full_name": "atomiix/PrestaShop", + "private": false, + "owner": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/atomiix/PrestaShop", + "description": "PrestaShop offers a fully scalable open source ecommerce solution.", + "fork": true, + "url": "https://api.github.com/repos/atomiix/PrestaShop", + "forks_url": "https://api.github.com/repos/atomiix/PrestaShop/forks", + "keys_url": "https://api.github.com/repos/atomiix/PrestaShop/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/atomiix/PrestaShop/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/atomiix/PrestaShop/teams", + "hooks_url": "https://api.github.com/repos/atomiix/PrestaShop/hooks", + "issue_events_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/events{/number}", + "events_url": "https://api.github.com/repos/atomiix/PrestaShop/events", + "assignees_url": "https://api.github.com/repos/atomiix/PrestaShop/assignees{/user}", + "branches_url": "https://api.github.com/repos/atomiix/PrestaShop/branches{/branch}", + "tags_url": "https://api.github.com/repos/atomiix/PrestaShop/tags", + "blobs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/atomiix/PrestaShop/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/atomiix/PrestaShop/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/atomiix/PrestaShop/statuses/{sha}", + "languages_url": "https://api.github.com/repos/atomiix/PrestaShop/languages", + "stargazers_url": "https://api.github.com/repos/atomiix/PrestaShop/stargazers", + "contributors_url": "https://api.github.com/repos/atomiix/PrestaShop/contributors", + "subscribers_url": "https://api.github.com/repos/atomiix/PrestaShop/subscribers", + "subscription_url": "https://api.github.com/repos/atomiix/PrestaShop/subscription", + "commits_url": "https://api.github.com/repos/atomiix/PrestaShop/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/atomiix/PrestaShop/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/atomiix/PrestaShop/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/atomiix/PrestaShop/contents/{+path}", + "compare_url": "https://api.github.com/repos/atomiix/PrestaShop/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/atomiix/PrestaShop/merges", + "archive_url": "https://api.github.com/repos/atomiix/PrestaShop/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/atomiix/PrestaShop/downloads", + "issues_url": "https://api.github.com/repos/atomiix/PrestaShop/issues{/number}", + "pulls_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls{/number}", + "milestones_url": "https://api.github.com/repos/atomiix/PrestaShop/milestones{/number}", + "notifications_url": "https://api.github.com/repos/atomiix/PrestaShop/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/atomiix/PrestaShop/labels{/name}", + "releases_url": "https://api.github.com/repos/atomiix/PrestaShop/releases{/id}", + "deployments_url": "https://api.github.com/repos/atomiix/PrestaShop/deployments", + "created_at": "2019-10-15T14:40:02Z", + "updated_at": "2020-06-23T09:52:47Z", + "pushed_at": "2020-06-23T13:20:33Z", + "git_url": "git://github.com/atomiix/PrestaShop.git", + "ssh_url": "git@github.com:atomiix/PrestaShop.git", + "clone_url": "https://github.com/atomiix/PrestaShop.git", + "svn_url": "https://github.com/atomiix/PrestaShop", + "homepage": "https://www.prestashop.com/", + "size": 438421, + "stargazers_count": 1, + "watchers_count": 1, + "language": "PHP", + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": { + "key": "other", + "name": "Other", + "spdx_id": "NOASSERTION", + "url": null, + "node_id": "MDc6TGljZW5zZTA=" + }, + "forks": 0, + "open_issues": 1, + "watchers": 1, + "default_branch": "develop" + } + }, + "base": { + "label": "atomiix:1.7.7.x", + "ref": "1.7.7.x", + "sha": "47b194e10ffec9bf49f34ad57a458d37f0a4dbec", + "user": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 215322337, + "node_id": "MDEwOlJlcG9zaXRvcnkyMTUzMjIzMzc=", + "name": "PrestaShop", + "full_name": "atomiix/PrestaShop", + "private": false, + "owner": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/atomiix/PrestaShop", + "description": "PrestaShop offers a fully scalable open source ecommerce solution.", + "fork": true, + "url": "https://api.github.com/repos/atomiix/PrestaShop", + "forks_url": "https://api.github.com/repos/atomiix/PrestaShop/forks", + "keys_url": "https://api.github.com/repos/atomiix/PrestaShop/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/atomiix/PrestaShop/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/atomiix/PrestaShop/teams", + "hooks_url": "https://api.github.com/repos/atomiix/PrestaShop/hooks", + "issue_events_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/events{/number}", + "events_url": "https://api.github.com/repos/atomiix/PrestaShop/events", + "assignees_url": "https://api.github.com/repos/atomiix/PrestaShop/assignees{/user}", + "branches_url": "https://api.github.com/repos/atomiix/PrestaShop/branches{/branch}", + "tags_url": "https://api.github.com/repos/atomiix/PrestaShop/tags", + "blobs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/atomiix/PrestaShop/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/atomiix/PrestaShop/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/atomiix/PrestaShop/statuses/{sha}", + "languages_url": "https://api.github.com/repos/atomiix/PrestaShop/languages", + "stargazers_url": "https://api.github.com/repos/atomiix/PrestaShop/stargazers", + "contributors_url": "https://api.github.com/repos/atomiix/PrestaShop/contributors", + "subscribers_url": "https://api.github.com/repos/atomiix/PrestaShop/subscribers", + "subscription_url": "https://api.github.com/repos/atomiix/PrestaShop/subscription", + "commits_url": "https://api.github.com/repos/atomiix/PrestaShop/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/atomiix/PrestaShop/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/atomiix/PrestaShop/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/atomiix/PrestaShop/contents/{+path}", + "compare_url": "https://api.github.com/repos/atomiix/PrestaShop/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/atomiix/PrestaShop/merges", + "archive_url": "https://api.github.com/repos/atomiix/PrestaShop/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/atomiix/PrestaShop/downloads", + "issues_url": "https://api.github.com/repos/atomiix/PrestaShop/issues{/number}", + "pulls_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls{/number}", + "milestones_url": "https://api.github.com/repos/atomiix/PrestaShop/milestones{/number}", + "notifications_url": "https://api.github.com/repos/atomiix/PrestaShop/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/atomiix/PrestaShop/labels{/name}", + "releases_url": "https://api.github.com/repos/atomiix/PrestaShop/releases{/id}", + "deployments_url": "https://api.github.com/repos/atomiix/PrestaShop/deployments", + "created_at": "2019-10-15T14:40:02Z", + "updated_at": "2020-06-23T09:52:47Z", + "pushed_at": "2020-06-23T13:20:33Z", + "git_url": "git://github.com/atomiix/PrestaShop.git", + "ssh_url": "git@github.com:atomiix/PrestaShop.git", + "clone_url": "https://github.com/atomiix/PrestaShop.git", + "svn_url": "https://github.com/atomiix/PrestaShop", + "homepage": "https://www.prestashop.com/", + "size": 438421, + "stargazers_count": 1, + "watchers_count": 1, + "language": "PHP", + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": { + "key": "other", + "name": "Other", + "spdx_id": "NOASSERTION", + "url": null, + "node_id": "MDc6TGljZW5zZTA=" + }, + "forks": 0, + "open_issues": 1, + "watchers": 1, + "default_branch": "develop" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14" + }, + "html": { + "href": "https://github.com/atomiix/PrestaShop/pull/14" + }, + "issue": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/issues/14" + }, + "comments": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/issues/14/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/statuses/3c232adce8b71a77e4d4a51b30bfe7bdd68fbc51" + } + }, + "author_association": "OWNER", + "active_lock_reason": null, + "merged": true, + "mergeable": null, + "rebaseable": null, + "mergeable_state": "unknown", + "merged_by": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "comments": 1, + "review_comments": 0, + "maintainer_can_modify": false, + "commits": 1, + "additions": 2, + "deletions": 2, + "changed_files": 1 + }, + "repository": { + "id": 215322337, + "node_id": "MDEwOlJlcG9zaXRvcnkyMTUzMjIzMzc=", + "name": "test", + "full_name": "loveOSS/test", + "private": false, + "owner": { + "login": "loveOSS", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/atomiix/PrestaShop", + "description": "PrestaShop offers a fully scalable open source ecommerce solution.", + "fork": true, + "url": "https://api.github.com/repos/atomiix/PrestaShop", + "forks_url": "https://api.github.com/repos/atomiix/PrestaShop/forks", + "keys_url": "https://api.github.com/repos/atomiix/PrestaShop/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/atomiix/PrestaShop/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/atomiix/PrestaShop/teams", + "hooks_url": "https://api.github.com/repos/atomiix/PrestaShop/hooks", + "issue_events_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/events{/number}", + "events_url": "https://api.github.com/repos/atomiix/PrestaShop/events", + "assignees_url": "https://api.github.com/repos/atomiix/PrestaShop/assignees{/user}", + "branches_url": "https://api.github.com/repos/atomiix/PrestaShop/branches{/branch}", + "tags_url": "https://api.github.com/repos/atomiix/PrestaShop/tags", + "blobs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/atomiix/PrestaShop/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/atomiix/PrestaShop/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/atomiix/PrestaShop/statuses/{sha}", + "languages_url": "https://api.github.com/repos/atomiix/PrestaShop/languages", + "stargazers_url": "https://api.github.com/repos/atomiix/PrestaShop/stargazers", + "contributors_url": "https://api.github.com/repos/atomiix/PrestaShop/contributors", + "subscribers_url": "https://api.github.com/repos/atomiix/PrestaShop/subscribers", + "subscription_url": "https://api.github.com/repos/atomiix/PrestaShop/subscription", + "commits_url": "https://api.github.com/repos/atomiix/PrestaShop/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/atomiix/PrestaShop/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/atomiix/PrestaShop/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/atomiix/PrestaShop/contents/{+path}", + "compare_url": "https://api.github.com/repos/atomiix/PrestaShop/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/atomiix/PrestaShop/merges", + "archive_url": "https://api.github.com/repos/atomiix/PrestaShop/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/atomiix/PrestaShop/downloads", + "issues_url": "https://api.github.com/repos/atomiix/PrestaShop/issues{/number}", + "pulls_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls{/number}", + "milestones_url": "https://api.github.com/repos/atomiix/PrestaShop/milestones{/number}", + "notifications_url": "https://api.github.com/repos/atomiix/PrestaShop/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/atomiix/PrestaShop/labels{/name}", + "releases_url": "https://api.github.com/repos/atomiix/PrestaShop/releases{/id}", + "deployments_url": "https://api.github.com/repos/atomiix/PrestaShop/deployments", + "created_at": "2019-10-15T14:40:02Z", + "updated_at": "2020-06-23T09:52:47Z", + "pushed_at": "2020-06-23T13:20:33Z", + "git_url": "git://github.com/atomiix/PrestaShop.git", + "ssh_url": "git@github.com:atomiix/PrestaShop.git", + "clone_url": "https://github.com/atomiix/PrestaShop.git", + "svn_url": "https://github.com/atomiix/PrestaShop", + "homepage": "https://www.prestashop.com/", + "size": 438421, + "stargazers_count": 1, + "watchers_count": 1, + "language": "PHP", + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": { + "key": "other", + "name": "Other", + "spdx_id": "NOASSERTION", + "url": null, + "node_id": "MDc6TGljZW5zZTA=" + }, + "forks": 0, + "open_issues": 1, + "watchers": 1, + "default_branch": "develop" + }, + "sender": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + } +} \ No newline at end of file diff --git a/tests/AppBundle/webhook_examples/pull_request_community_merged_30days_ago.json b/tests/AppBundle/webhook_examples/pull_request_community_merged_30days_ago.json new file mode 100644 index 0000000..2037137 --- /dev/null +++ b/tests/AppBundle/webhook_examples/pull_request_community_merged_30days_ago.json @@ -0,0 +1,497 @@ +{ + "action": "closed", + "number": 14, + "pull_request": { + "url": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14", + "id": 438479699, + "node_id": "MDExOlB1bGxSZXF1ZXN0NDM4NDc5Njk5", + "html_url": "https://github.com/atomiix/PrestaShop/pull/14", + "diff_url": "https://github.com/atomiix/PrestaShop/pull/14.diff", + "patch_url": "https://github.com/atomiix/PrestaShop/pull/14.patch", + "issue_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/14", + "number": 14, + "state": "closed", + "locked": false, + "title": "Change MD title syntax", + "user": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "body": "\r\n\r\n| Questions | Answers\r\n| ------------- | -------------------------------------------------------\r\n| Branch? | develop / 1.7.7.x\r\n| Description? | Please be specific when describing the PR.
Every detail helps: versions, browser/server configuration, specific module/theme, etc. Feel free to add more information below this table.\r\n| Type? | bug fix / improvement / new feature / refacto / critical\r\n| Category? | FO / BO / CO / IN / WS / TE / LO / ME / PM\r\n| BC breaks? | yes / no\r\n| Deprecations? | yes / no\r\n| Fixed ticket? | Fixes #{issue number here}.\r\n| How to test? | Please indicate how to best verify that this PR is correct.\r\n\r\n\r\n", + "created_at": "2020-06-23T10:35:26Z", + "updated_at": "2020-06-23T13:20:34Z", + "closed_at": "2020-06-23T13:20:34Z", + "merged_at": "2020-06-23T13:20:33Z", + "merge_commit_sha": "4722f85a5108a39cb64d27ef3e06c9ce6971a91e", + "assignee": null, + "assignees": [ + ], + "requested_reviewers": [ + ], + "requested_teams": [ + ], + "labels": [ + { + "id": 1618024322, + "node_id": "MDU6TGFiZWwxNjE4MDI0MzIy", + "url": "https://api.github.com/repos/atomiix/PrestaShop/labels/bug", + "name": "bug", + "color": "d73a4a", + "default": true, + "description": "Something isn't working" + } + ], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14/commits", + "review_comments_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14/comments", + "review_comment_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/14/comments", + "statuses_url": "https://api.github.com/repos/atomiix/PrestaShop/statuses/3c232adce8b71a77e4d4a51b30bfe7bdd68fbc51", + "head": { + "label": "atomiix:sample-pr", + "ref": "sample-pr", + "sha": "3c232adce8b71a77e4d4a51b30bfe7bdd68fbc51", + "user": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 215322337, + "node_id": "MDEwOlJlcG9zaXRvcnkyMTUzMjIzMzc=", + "name": "PrestaShop", + "full_name": "atomiix/PrestaShop", + "private": false, + "owner": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/atomiix/PrestaShop", + "description": "PrestaShop offers a fully scalable open source ecommerce solution.", + "fork": true, + "url": "https://api.github.com/repos/atomiix/PrestaShop", + "forks_url": "https://api.github.com/repos/atomiix/PrestaShop/forks", + "keys_url": "https://api.github.com/repos/atomiix/PrestaShop/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/atomiix/PrestaShop/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/atomiix/PrestaShop/teams", + "hooks_url": "https://api.github.com/repos/atomiix/PrestaShop/hooks", + "issue_events_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/events{/number}", + "events_url": "https://api.github.com/repos/atomiix/PrestaShop/events", + "assignees_url": "https://api.github.com/repos/atomiix/PrestaShop/assignees{/user}", + "branches_url": "https://api.github.com/repos/atomiix/PrestaShop/branches{/branch}", + "tags_url": "https://api.github.com/repos/atomiix/PrestaShop/tags", + "blobs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/atomiix/PrestaShop/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/atomiix/PrestaShop/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/atomiix/PrestaShop/statuses/{sha}", + "languages_url": "https://api.github.com/repos/atomiix/PrestaShop/languages", + "stargazers_url": "https://api.github.com/repos/atomiix/PrestaShop/stargazers", + "contributors_url": "https://api.github.com/repos/atomiix/PrestaShop/contributors", + "subscribers_url": "https://api.github.com/repos/atomiix/PrestaShop/subscribers", + "subscription_url": "https://api.github.com/repos/atomiix/PrestaShop/subscription", + "commits_url": "https://api.github.com/repos/atomiix/PrestaShop/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/atomiix/PrestaShop/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/atomiix/PrestaShop/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/atomiix/PrestaShop/contents/{+path}", + "compare_url": "https://api.github.com/repos/atomiix/PrestaShop/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/atomiix/PrestaShop/merges", + "archive_url": "https://api.github.com/repos/atomiix/PrestaShop/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/atomiix/PrestaShop/downloads", + "issues_url": "https://api.github.com/repos/atomiix/PrestaShop/issues{/number}", + "pulls_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls{/number}", + "milestones_url": "https://api.github.com/repos/atomiix/PrestaShop/milestones{/number}", + "notifications_url": "https://api.github.com/repos/atomiix/PrestaShop/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/atomiix/PrestaShop/labels{/name}", + "releases_url": "https://api.github.com/repos/atomiix/PrestaShop/releases{/id}", + "deployments_url": "https://api.github.com/repos/atomiix/PrestaShop/deployments", + "created_at": "2019-10-15T14:40:02Z", + "updated_at": "2020-06-23T09:52:47Z", + "pushed_at": "2020-06-23T13:20:33Z", + "git_url": "git://github.com/atomiix/PrestaShop.git", + "ssh_url": "git@github.com:atomiix/PrestaShop.git", + "clone_url": "https://github.com/atomiix/PrestaShop.git", + "svn_url": "https://github.com/atomiix/PrestaShop", + "homepage": "https://www.prestashop.com/", + "size": 438421, + "stargazers_count": 1, + "watchers_count": 1, + "language": "PHP", + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": { + "key": "other", + "name": "Other", + "spdx_id": "NOASSERTION", + "url": null, + "node_id": "MDc6TGljZW5zZTA=" + }, + "forks": 0, + "open_issues": 1, + "watchers": 1, + "default_branch": "develop" + } + }, + "base": { + "label": "atomiix:1.7.7.x", + "ref": "1.7.7.x", + "sha": "47b194e10ffec9bf49f34ad57a458d37f0a4dbec", + "user": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 215322337, + "node_id": "MDEwOlJlcG9zaXRvcnkyMTUzMjIzMzc=", + "name": "PrestaShop", + "full_name": "atomiix/PrestaShop", + "private": false, + "owner": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/atomiix/PrestaShop", + "description": "PrestaShop offers a fully scalable open source ecommerce solution.", + "fork": true, + "url": "https://api.github.com/repos/atomiix/PrestaShop", + "forks_url": "https://api.github.com/repos/atomiix/PrestaShop/forks", + "keys_url": "https://api.github.com/repos/atomiix/PrestaShop/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/atomiix/PrestaShop/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/atomiix/PrestaShop/teams", + "hooks_url": "https://api.github.com/repos/atomiix/PrestaShop/hooks", + "issue_events_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/events{/number}", + "events_url": "https://api.github.com/repos/atomiix/PrestaShop/events", + "assignees_url": "https://api.github.com/repos/atomiix/PrestaShop/assignees{/user}", + "branches_url": "https://api.github.com/repos/atomiix/PrestaShop/branches{/branch}", + "tags_url": "https://api.github.com/repos/atomiix/PrestaShop/tags", + "blobs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/atomiix/PrestaShop/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/atomiix/PrestaShop/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/atomiix/PrestaShop/statuses/{sha}", + "languages_url": "https://api.github.com/repos/atomiix/PrestaShop/languages", + "stargazers_url": "https://api.github.com/repos/atomiix/PrestaShop/stargazers", + "contributors_url": "https://api.github.com/repos/atomiix/PrestaShop/contributors", + "subscribers_url": "https://api.github.com/repos/atomiix/PrestaShop/subscribers", + "subscription_url": "https://api.github.com/repos/atomiix/PrestaShop/subscription", + "commits_url": "https://api.github.com/repos/atomiix/PrestaShop/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/atomiix/PrestaShop/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/atomiix/PrestaShop/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/atomiix/PrestaShop/contents/{+path}", + "compare_url": "https://api.github.com/repos/atomiix/PrestaShop/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/atomiix/PrestaShop/merges", + "archive_url": "https://api.github.com/repos/atomiix/PrestaShop/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/atomiix/PrestaShop/downloads", + "issues_url": "https://api.github.com/repos/atomiix/PrestaShop/issues{/number}", + "pulls_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls{/number}", + "milestones_url": "https://api.github.com/repos/atomiix/PrestaShop/milestones{/number}", + "notifications_url": "https://api.github.com/repos/atomiix/PrestaShop/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/atomiix/PrestaShop/labels{/name}", + "releases_url": "https://api.github.com/repos/atomiix/PrestaShop/releases{/id}", + "deployments_url": "https://api.github.com/repos/atomiix/PrestaShop/deployments", + "created_at": "2019-10-15T14:40:02Z", + "updated_at": "2020-06-23T09:52:47Z", + "pushed_at": "2020-06-23T13:20:33Z", + "git_url": "git://github.com/atomiix/PrestaShop.git", + "ssh_url": "git@github.com:atomiix/PrestaShop.git", + "clone_url": "https://github.com/atomiix/PrestaShop.git", + "svn_url": "https://github.com/atomiix/PrestaShop", + "homepage": "https://www.prestashop.com/", + "size": 438421, + "stargazers_count": 1, + "watchers_count": 1, + "language": "PHP", + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": { + "key": "other", + "name": "Other", + "spdx_id": "NOASSERTION", + "url": null, + "node_id": "MDc6TGljZW5zZTA=" + }, + "forks": 0, + "open_issues": 1, + "watchers": 1, + "default_branch": "develop" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14" + }, + "html": { + "href": "https://github.com/atomiix/PrestaShop/pull/14" + }, + "issue": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/issues/14" + }, + "comments": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/issues/14/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/statuses/3c232adce8b71a77e4d4a51b30bfe7bdd68fbc51" + } + }, + "author_association": "OWNER", + "active_lock_reason": null, + "merged": true, + "mergeable": null, + "rebaseable": null, + "mergeable_state": "unknown", + "merged_by": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "comments": 1, + "review_comments": 0, + "maintainer_can_modify": false, + "commits": 1, + "additions": 2, + "deletions": 2, + "changed_files": 1 + }, + "repository": { + "id": 215322337, + "node_id": "MDEwOlJlcG9zaXRvcnkyMTUzMjIzMzc=", + "name": "test", + "full_name": "loveOSS/test", + "private": false, + "owner": { + "login": "loveOSS", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/atomiix/PrestaShop", + "description": "PrestaShop offers a fully scalable open source ecommerce solution.", + "fork": true, + "url": "https://api.github.com/repos/atomiix/PrestaShop", + "forks_url": "https://api.github.com/repos/atomiix/PrestaShop/forks", + "keys_url": "https://api.github.com/repos/atomiix/PrestaShop/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/atomiix/PrestaShop/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/atomiix/PrestaShop/teams", + "hooks_url": "https://api.github.com/repos/atomiix/PrestaShop/hooks", + "issue_events_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/events{/number}", + "events_url": "https://api.github.com/repos/atomiix/PrestaShop/events", + "assignees_url": "https://api.github.com/repos/atomiix/PrestaShop/assignees{/user}", + "branches_url": "https://api.github.com/repos/atomiix/PrestaShop/branches{/branch}", + "tags_url": "https://api.github.com/repos/atomiix/PrestaShop/tags", + "blobs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/atomiix/PrestaShop/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/atomiix/PrestaShop/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/atomiix/PrestaShop/statuses/{sha}", + "languages_url": "https://api.github.com/repos/atomiix/PrestaShop/languages", + "stargazers_url": "https://api.github.com/repos/atomiix/PrestaShop/stargazers", + "contributors_url": "https://api.github.com/repos/atomiix/PrestaShop/contributors", + "subscribers_url": "https://api.github.com/repos/atomiix/PrestaShop/subscribers", + "subscription_url": "https://api.github.com/repos/atomiix/PrestaShop/subscription", + "commits_url": "https://api.github.com/repos/atomiix/PrestaShop/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/atomiix/PrestaShop/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/atomiix/PrestaShop/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/atomiix/PrestaShop/contents/{+path}", + "compare_url": "https://api.github.com/repos/atomiix/PrestaShop/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/atomiix/PrestaShop/merges", + "archive_url": "https://api.github.com/repos/atomiix/PrestaShop/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/atomiix/PrestaShop/downloads", + "issues_url": "https://api.github.com/repos/atomiix/PrestaShop/issues{/number}", + "pulls_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls{/number}", + "milestones_url": "https://api.github.com/repos/atomiix/PrestaShop/milestones{/number}", + "notifications_url": "https://api.github.com/repos/atomiix/PrestaShop/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/atomiix/PrestaShop/labels{/name}", + "releases_url": "https://api.github.com/repos/atomiix/PrestaShop/releases{/id}", + "deployments_url": "https://api.github.com/repos/atomiix/PrestaShop/deployments", + "created_at": "2019-10-15T14:40:02Z", + "updated_at": "2020-06-23T09:52:47Z", + "pushed_at": "2020-06-23T13:20:33Z", + "git_url": "git://github.com/atomiix/PrestaShop.git", + "ssh_url": "git@github.com:atomiix/PrestaShop.git", + "clone_url": "https://github.com/atomiix/PrestaShop.git", + "svn_url": "https://github.com/atomiix/PrestaShop", + "homepage": "https://www.prestashop.com/", + "size": 438421, + "stargazers_count": 1, + "watchers_count": 1, + "language": "PHP", + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": { + "key": "other", + "name": "Other", + "spdx_id": "NOASSERTION", + "url": null, + "node_id": "MDc6TGljZW5zZTA=" + }, + "forks": 0, + "open_issues": 1, + "watchers": 1, + "default_branch": "develop" + }, + "sender": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + } +} \ No newline at end of file diff --git a/tests/AppBundle/webhook_examples/pull_request_organisation_merged.json b/tests/AppBundle/webhook_examples/pull_request_organisation_merged.json new file mode 100644 index 0000000..b5c3ca1 --- /dev/null +++ b/tests/AppBundle/webhook_examples/pull_request_organisation_merged.json @@ -0,0 +1,497 @@ +{ + "action": "closed", + "number": 14, + "pull_request": { + "url": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14", + "id": 438479699, + "node_id": "MDExOlB1bGxSZXF1ZXN0NDM4NDc5Njk5", + "html_url": "https://github.com/atomiix/PrestaShop/pull/14", + "diff_url": "https://github.com/atomiix/PrestaShop/pull/14.diff", + "patch_url": "https://github.com/atomiix/PrestaShop/pull/14.patch", + "issue_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/14", + "number": 14, + "state": "closed", + "locked": false, + "title": "Change MD title syntax", + "user": { + "login": "loveOSS", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "body": "\r\n\r\n| Questions | Answers\r\n| ------------- | -------------------------------------------------------\r\n| Branch? | develop / 1.7.7.x\r\n| Description? | Please be specific when describing the PR.
Every detail helps: versions, browser/server configuration, specific module/theme, etc. Feel free to add more information below this table.\r\n| Type? | bug fix / improvement / new feature / refacto / critical\r\n| Category? | FO / BO / CO / IN / WS / TE / LO / ME / PM\r\n| BC breaks? | yes / no\r\n| Deprecations? | yes / no\r\n| Fixed ticket? | Fixes #{issue number here}.\r\n| How to test? | Please indicate how to best verify that this PR is correct.\r\n\r\n\r\n", + "created_at": "2020-06-23T10:35:26Z", + "updated_at": "2020-06-23T13:20:34Z", + "closed_at": "2020-06-23T13:20:34Z", + "merged_at": "2020-06-23T13:20:33Z", + "merge_commit_sha": "4722f85a5108a39cb64d27ef3e06c9ce6971a91e", + "assignee": null, + "assignees": [ + ], + "requested_reviewers": [ + ], + "requested_teams": [ + ], + "labels": [ + { + "id": 1618024322, + "node_id": "MDU6TGFiZWwxNjE4MDI0MzIy", + "url": "https://api.github.com/repos/atomiix/PrestaShop/labels/bug", + "name": "bug", + "color": "d73a4a", + "default": true, + "description": "Something isn't working" + } + ], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14/commits", + "review_comments_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14/comments", + "review_comment_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/14/comments", + "statuses_url": "https://api.github.com/repos/atomiix/PrestaShop/statuses/3c232adce8b71a77e4d4a51b30bfe7bdd68fbc51", + "head": { + "label": "atomiix:sample-pr", + "ref": "sample-pr", + "sha": "3c232adce8b71a77e4d4a51b30bfe7bdd68fbc51", + "user": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 215322337, + "node_id": "MDEwOlJlcG9zaXRvcnkyMTUzMjIzMzc=", + "name": "PrestaShop", + "full_name": "atomiix/PrestaShop", + "private": false, + "owner": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/atomiix/PrestaShop", + "description": "PrestaShop offers a fully scalable open source ecommerce solution.", + "fork": true, + "url": "https://api.github.com/repos/atomiix/PrestaShop", + "forks_url": "https://api.github.com/repos/atomiix/PrestaShop/forks", + "keys_url": "https://api.github.com/repos/atomiix/PrestaShop/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/atomiix/PrestaShop/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/atomiix/PrestaShop/teams", + "hooks_url": "https://api.github.com/repos/atomiix/PrestaShop/hooks", + "issue_events_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/events{/number}", + "events_url": "https://api.github.com/repos/atomiix/PrestaShop/events", + "assignees_url": "https://api.github.com/repos/atomiix/PrestaShop/assignees{/user}", + "branches_url": "https://api.github.com/repos/atomiix/PrestaShop/branches{/branch}", + "tags_url": "https://api.github.com/repos/atomiix/PrestaShop/tags", + "blobs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/atomiix/PrestaShop/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/atomiix/PrestaShop/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/atomiix/PrestaShop/statuses/{sha}", + "languages_url": "https://api.github.com/repos/atomiix/PrestaShop/languages", + "stargazers_url": "https://api.github.com/repos/atomiix/PrestaShop/stargazers", + "contributors_url": "https://api.github.com/repos/atomiix/PrestaShop/contributors", + "subscribers_url": "https://api.github.com/repos/atomiix/PrestaShop/subscribers", + "subscription_url": "https://api.github.com/repos/atomiix/PrestaShop/subscription", + "commits_url": "https://api.github.com/repos/atomiix/PrestaShop/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/atomiix/PrestaShop/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/atomiix/PrestaShop/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/atomiix/PrestaShop/contents/{+path}", + "compare_url": "https://api.github.com/repos/atomiix/PrestaShop/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/atomiix/PrestaShop/merges", + "archive_url": "https://api.github.com/repos/atomiix/PrestaShop/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/atomiix/PrestaShop/downloads", + "issues_url": "https://api.github.com/repos/atomiix/PrestaShop/issues{/number}", + "pulls_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls{/number}", + "milestones_url": "https://api.github.com/repos/atomiix/PrestaShop/milestones{/number}", + "notifications_url": "https://api.github.com/repos/atomiix/PrestaShop/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/atomiix/PrestaShop/labels{/name}", + "releases_url": "https://api.github.com/repos/atomiix/PrestaShop/releases{/id}", + "deployments_url": "https://api.github.com/repos/atomiix/PrestaShop/deployments", + "created_at": "2019-10-15T14:40:02Z", + "updated_at": "2020-06-23T09:52:47Z", + "pushed_at": "2020-06-23T13:20:33Z", + "git_url": "git://github.com/atomiix/PrestaShop.git", + "ssh_url": "git@github.com:atomiix/PrestaShop.git", + "clone_url": "https://github.com/atomiix/PrestaShop.git", + "svn_url": "https://github.com/atomiix/PrestaShop", + "homepage": "https://www.prestashop.com/", + "size": 438421, + "stargazers_count": 1, + "watchers_count": 1, + "language": "PHP", + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": { + "key": "other", + "name": "Other", + "spdx_id": "NOASSERTION", + "url": null, + "node_id": "MDc6TGljZW5zZTA=" + }, + "forks": 0, + "open_issues": 1, + "watchers": 1, + "default_branch": "develop" + } + }, + "base": { + "label": "atomiix:1.7.7.x", + "ref": "1.7.7.x", + "sha": "47b194e10ffec9bf49f34ad57a458d37f0a4dbec", + "user": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 215322337, + "node_id": "MDEwOlJlcG9zaXRvcnkyMTUzMjIzMzc=", + "name": "PrestaShop", + "full_name": "atomiix/PrestaShop", + "private": false, + "owner": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/atomiix/PrestaShop", + "description": "PrestaShop offers a fully scalable open source ecommerce solution.", + "fork": true, + "url": "https://api.github.com/repos/atomiix/PrestaShop", + "forks_url": "https://api.github.com/repos/atomiix/PrestaShop/forks", + "keys_url": "https://api.github.com/repos/atomiix/PrestaShop/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/atomiix/PrestaShop/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/atomiix/PrestaShop/teams", + "hooks_url": "https://api.github.com/repos/atomiix/PrestaShop/hooks", + "issue_events_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/events{/number}", + "events_url": "https://api.github.com/repos/atomiix/PrestaShop/events", + "assignees_url": "https://api.github.com/repos/atomiix/PrestaShop/assignees{/user}", + "branches_url": "https://api.github.com/repos/atomiix/PrestaShop/branches{/branch}", + "tags_url": "https://api.github.com/repos/atomiix/PrestaShop/tags", + "blobs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/atomiix/PrestaShop/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/atomiix/PrestaShop/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/atomiix/PrestaShop/statuses/{sha}", + "languages_url": "https://api.github.com/repos/atomiix/PrestaShop/languages", + "stargazers_url": "https://api.github.com/repos/atomiix/PrestaShop/stargazers", + "contributors_url": "https://api.github.com/repos/atomiix/PrestaShop/contributors", + "subscribers_url": "https://api.github.com/repos/atomiix/PrestaShop/subscribers", + "subscription_url": "https://api.github.com/repos/atomiix/PrestaShop/subscription", + "commits_url": "https://api.github.com/repos/atomiix/PrestaShop/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/atomiix/PrestaShop/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/atomiix/PrestaShop/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/atomiix/PrestaShop/contents/{+path}", + "compare_url": "https://api.github.com/repos/atomiix/PrestaShop/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/atomiix/PrestaShop/merges", + "archive_url": "https://api.github.com/repos/atomiix/PrestaShop/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/atomiix/PrestaShop/downloads", + "issues_url": "https://api.github.com/repos/atomiix/PrestaShop/issues{/number}", + "pulls_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls{/number}", + "milestones_url": "https://api.github.com/repos/atomiix/PrestaShop/milestones{/number}", + "notifications_url": "https://api.github.com/repos/atomiix/PrestaShop/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/atomiix/PrestaShop/labels{/name}", + "releases_url": "https://api.github.com/repos/atomiix/PrestaShop/releases{/id}", + "deployments_url": "https://api.github.com/repos/atomiix/PrestaShop/deployments", + "created_at": "2019-10-15T14:40:02Z", + "updated_at": "2020-06-23T09:52:47Z", + "pushed_at": "2020-06-23T13:20:33Z", + "git_url": "git://github.com/atomiix/PrestaShop.git", + "ssh_url": "git@github.com:atomiix/PrestaShop.git", + "clone_url": "https://github.com/atomiix/PrestaShop.git", + "svn_url": "https://github.com/atomiix/PrestaShop", + "homepage": "https://www.prestashop.com/", + "size": 438421, + "stargazers_count": 1, + "watchers_count": 1, + "language": "PHP", + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": { + "key": "other", + "name": "Other", + "spdx_id": "NOASSERTION", + "url": null, + "node_id": "MDc6TGljZW5zZTA=" + }, + "forks": 0, + "open_issues": 1, + "watchers": 1, + "default_branch": "develop" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14" + }, + "html": { + "href": "https://github.com/atomiix/PrestaShop/pull/14" + }, + "issue": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/issues/14" + }, + "comments": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/issues/14/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/pulls/14/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/atomiix/PrestaShop/statuses/3c232adce8b71a77e4d4a51b30bfe7bdd68fbc51" + } + }, + "author_association": "OWNER", + "active_lock_reason": null, + "merged": true, + "mergeable": null, + "rebaseable": null, + "mergeable_state": "unknown", + "merged_by": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "comments": 1, + "review_comments": 0, + "maintainer_can_modify": false, + "commits": 1, + "additions": 2, + "deletions": 2, + "changed_files": 1 + }, + "repository": { + "id": 215322337, + "node_id": "MDEwOlJlcG9zaXRvcnkyMTUzMjIzMzc=", + "name": "test", + "full_name": "loveOSS/test", + "private": false, + "owner": { + "login": "loveOSS", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/atomiix/PrestaShop", + "description": "PrestaShop offers a fully scalable open source ecommerce solution.", + "fork": true, + "url": "https://api.github.com/repos/atomiix/PrestaShop", + "forks_url": "https://api.github.com/repos/atomiix/PrestaShop/forks", + "keys_url": "https://api.github.com/repos/atomiix/PrestaShop/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/atomiix/PrestaShop/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/atomiix/PrestaShop/teams", + "hooks_url": "https://api.github.com/repos/atomiix/PrestaShop/hooks", + "issue_events_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/events{/number}", + "events_url": "https://api.github.com/repos/atomiix/PrestaShop/events", + "assignees_url": "https://api.github.com/repos/atomiix/PrestaShop/assignees{/user}", + "branches_url": "https://api.github.com/repos/atomiix/PrestaShop/branches{/branch}", + "tags_url": "https://api.github.com/repos/atomiix/PrestaShop/tags", + "blobs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/atomiix/PrestaShop/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/atomiix/PrestaShop/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/atomiix/PrestaShop/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/atomiix/PrestaShop/statuses/{sha}", + "languages_url": "https://api.github.com/repos/atomiix/PrestaShop/languages", + "stargazers_url": "https://api.github.com/repos/atomiix/PrestaShop/stargazers", + "contributors_url": "https://api.github.com/repos/atomiix/PrestaShop/contributors", + "subscribers_url": "https://api.github.com/repos/atomiix/PrestaShop/subscribers", + "subscription_url": "https://api.github.com/repos/atomiix/PrestaShop/subscription", + "commits_url": "https://api.github.com/repos/atomiix/PrestaShop/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/atomiix/PrestaShop/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/atomiix/PrestaShop/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/atomiix/PrestaShop/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/atomiix/PrestaShop/contents/{+path}", + "compare_url": "https://api.github.com/repos/atomiix/PrestaShop/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/atomiix/PrestaShop/merges", + "archive_url": "https://api.github.com/repos/atomiix/PrestaShop/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/atomiix/PrestaShop/downloads", + "issues_url": "https://api.github.com/repos/atomiix/PrestaShop/issues{/number}", + "pulls_url": "https://api.github.com/repos/atomiix/PrestaShop/pulls{/number}", + "milestones_url": "https://api.github.com/repos/atomiix/PrestaShop/milestones{/number}", + "notifications_url": "https://api.github.com/repos/atomiix/PrestaShop/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/atomiix/PrestaShop/labels{/name}", + "releases_url": "https://api.github.com/repos/atomiix/PrestaShop/releases{/id}", + "deployments_url": "https://api.github.com/repos/atomiix/PrestaShop/deployments", + "created_at": "2019-10-15T14:40:02Z", + "updated_at": "2020-06-23T09:52:47Z", + "pushed_at": "2020-06-23T13:20:33Z", + "git_url": "git://github.com/atomiix/PrestaShop.git", + "ssh_url": "git@github.com:atomiix/PrestaShop.git", + "clone_url": "https://github.com/atomiix/PrestaShop.git", + "svn_url": "https://github.com/atomiix/PrestaShop", + "homepage": "https://www.prestashop.com/", + "size": 438421, + "stargazers_count": 1, + "watchers_count": 1, + "language": "PHP", + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": { + "key": "other", + "name": "Other", + "spdx_id": "NOASSERTION", + "url": null, + "node_id": "MDc6TGljZW5zZTA=" + }, + "forks": 0, + "open_issues": 1, + "watchers": 1, + "default_branch": "develop" + }, + "sender": { + "login": "atomiix", + "id": 2168836, + "node_id": "MDQ6VXNlcjIxNjg4MzY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/2168836?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atomiix", + "html_url": "https://github.com/atomiix", + "followers_url": "https://api.github.com/users/atomiix/followers", + "following_url": "https://api.github.com/users/atomiix/following{/other_user}", + "gists_url": "https://api.github.com/users/atomiix/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atomiix/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atomiix/subscriptions", + "organizations_url": "https://api.github.com/users/atomiix/orgs", + "repos_url": "https://api.github.com/users/atomiix/repos", + "events_url": "https://api.github.com/users/atomiix/events{/privacy}", + "received_events_url": "https://api.github.com/users/atomiix/received_events", + "type": "User", + "site_admin": false + } +} \ No newline at end of file diff --git a/tests/AppBundle/webhook_examples/repoloveOSStest_ispr_ismerged_authoratomiix_commenterprestonBot.json b/tests/AppBundle/webhook_examples/repoloveOSStest_ispr_ismerged_authoratomiix_commenterprestonBot.json new file mode 100644 index 0000000..3a5f3d0 --- /dev/null +++ b/tests/AppBundle/webhook_examples/repoloveOSStest_ispr_ismerged_authoratomiix_commenterprestonBot.json @@ -0,0 +1,54 @@ +{ + "data": { + "search": { + "edges": [ + { + "node": { + "id": "MDExOlB1bGxSZXF1ZXN0NDQwMDYyNzM0", + "title": "Cast changelogs to array for twig - Backport of #19778", + "author": { + "login": "atomiix" + }, + "mergedAt": "2020-06-26T08:28:26Z", + "updatedAt": "2020-06-26T08:36:50Z", + "comments": { + "edges": [] + } + } + }, + { + "node": { + "id": "MDExOlB1bGxSZXF1ZXN0NDM3ODA5ODQ1", + "title": "Add missing comma", + "author": { + "login": "atomiix" + }, + "mergedAt": "2020-06-23T08:47:52Z", + "updatedAt": "2020-06-23T09:00:42Z", + "comments": { + "edges": [ + { + "node": { + "body": "Hi @atomiix ! The 1 click Upgrade from 1765 to 177 is now OK with your PR.\r\n\r\n![upgrade pr19887](https://user-images.githubusercontent.com/55688534/85379432-0f71c180-b53c-11ea-91e3-92101e0fe78a.png)\r\n\r\nThanks ! QA :heavy_check_mark: ", + "author": { + "login": "Robin-Fischer-PS" + } + } + }, + { + "node": { + "body": "\nContribution merged, congratulations!\n\nWould you mind answering our [quick 1-minute survey](https://forms-prestashop.typeform.com/to/hNaeFP)? We would love to hear about your experience so far, it will help us improve our process for the community involved, like you. ;-)", + "author": { + "login": "prestonBot" + } + } + } + ] + } + } + } + ], + "issueCount": 11 + } + } +} \ No newline at end of file