diff --git a/fixtures/pulls/closed.json b/fixtures/pulls/closed.json index 966845a..3eaa57f 100644 --- a/fixtures/pulls/closed.json +++ b/fixtures/pulls/closed.json @@ -483,506 +483,4 @@ "type": "User", "site_admin": false } -} - 8746b300-153c-11ea-86a3-18caf7cdab35 … 2019-12-02 14:47:10 - d9d39f80-153b-11ea-88aa-9bd89985ed9f … 2019-12-02 14:42:19 - Completed in 0.04 seconds. -Redeliver -Request 200 Response -Headers -Request URL: https://webhooks.gitter.im/e/008443913e05aa22a5fa -Request method: POST -content-type: application/json -Expect: -User-Agent: GitHub-Hookshot/b6210f6 -X-GitHub-Delivery: d9d39f80-153b-11ea-88aa-9bd89985ed9f -X-GitHub-Event: pull_request -Payload -{ - "action": "synchronize", - "number": 15575, - "pull_request": { - "url": "https://api.github.com/repos/microsoft/TypeScript/pulls/15575", - "id": 118897737, - "node_id": "MDExOlB1bGxSZXF1ZXN0MTE4ODk3NzM3", - "html_url": "https://github.com/microsoft/TypeScript/pull/15575", - "diff_url": "https://github.com/microsoft/TypeScript/pull/15575.diff", - "patch_url": "https://github.com/microsoft/TypeScript/pull/15575.patch", - "issue_url": "https://api.github.com/repos/microsoft/TypeScript/issues/15575", - "number": 15575, - "state": "open", - "locked": false, - "title": "Add Javascript Semantic Errors To Syntatic Errors", - "user": { - "login": "RahmadaniBayuAji", - "id": 21698520, - "node_id": "MDQ6VXNlcjIxNjk4NTIw", - "avatar_url": "https://avatars2.githubusercontent.com/u/21698520?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/RahmadaniBayuAji", - "html_url": "https://github.com/RahmadaniBayuAji", - "followers_url": "https://api.github.com/users/RahmadaniBayuAji/followers", - "following_url": "https://api.github.com/users/RahmadaniBayuAji/following{/other_user}", - "gists_url": "https://api.github.com/users/RahmadaniBayuAji/gists{/gist_id}", - "starred_url": "https://api.github.com/users/RahmadaniBayuAji/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/RahmadaniBayuAji/subscriptions", - "organizations_url": "https://api.github.com/users/RahmadaniBayuAji/orgs", - "repos_url": "https://api.github.com/users/RahmadaniBayuAji/repos", - "events_url": "https://api.github.com/users/RahmadaniBayuAji/events{/privacy}", - "received_events_url": "https://api.github.com/users/RahmadaniBayuAji/received_events", - "type": "User", - "site_admin": false - }, - "body": "\r\n\r\nFixes #\r\n", - "created_at": "2017-05-04T04:20:08Z", - "updated_at": "2019-12-02T19:42:19Z", - "closed_at": null, - "merged_at": null, - "merge_commit_sha": "a59937eff970624467de06a577712fdcc570444e", - "assignee": null, - "assignees": [ - - ], - "requested_reviewers": [ - - ], - "requested_teams": [ - - ], - "labels": [ - - ], - "milestone": null, - "commits_url": "https://api.github.com/repos/microsoft/TypeScript/pulls/15575/commits", - "review_comments_url": "https://api.github.com/repos/microsoft/TypeScript/pulls/15575/comments", - "review_comment_url": "https://api.github.com/repos/microsoft/TypeScript/pulls/comments{/number}", - "comments_url": "https://api.github.com/repos/microsoft/TypeScript/issues/15575/comments", - "statuses_url": "https://api.github.com/repos/microsoft/TypeScript/statuses/facafc7cb0490938e99ff2dbed1cdade7a9b3c40", - "head": { - "label": "microsoft:master", - "ref": "master", - "sha": "facafc7cb0490938e99ff2dbed1cdade7a9b3c40", - "user": { - "login": "microsoft", - "id": 6154722, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=", - "avatar_url": "https://avatars2.githubusercontent.com/u/6154722?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/microsoft", - "html_url": "https://github.com/microsoft", - "followers_url": "https://api.github.com/users/microsoft/followers", - "following_url": "https://api.github.com/users/microsoft/following{/other_user}", - "gists_url": "https://api.github.com/users/microsoft/gists{/gist_id}", - "starred_url": "https://api.github.com/users/microsoft/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/microsoft/subscriptions", - "organizations_url": "https://api.github.com/users/microsoft/orgs", - "repos_url": "https://api.github.com/users/microsoft/repos", - "events_url": "https://api.github.com/users/microsoft/events{/privacy}", - "received_events_url": "https://api.github.com/users/microsoft/received_events", - "type": "Organization", - "site_admin": false - }, - "repo": { - "id": 20929025, - "node_id": "MDEwOlJlcG9zaXRvcnkyMDkyOTAyNQ==", - "name": "TypeScript", - "full_name": "microsoft/TypeScript", - "private": false, - "owner": { - "login": "microsoft", - "id": 6154722, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=", - "avatar_url": "https://avatars2.githubusercontent.com/u/6154722?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/microsoft", - "html_url": "https://github.com/microsoft", - "followers_url": "https://api.github.com/users/microsoft/followers", - "following_url": "https://api.github.com/users/microsoft/following{/other_user}", - "gists_url": "https://api.github.com/users/microsoft/gists{/gist_id}", - "starred_url": "https://api.github.com/users/microsoft/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/microsoft/subscriptions", - "organizations_url": "https://api.github.com/users/microsoft/orgs", - "repos_url": "https://api.github.com/users/microsoft/repos", - "events_url": "https://api.github.com/users/microsoft/events{/privacy}", - "received_events_url": "https://api.github.com/users/microsoft/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/microsoft/TypeScript", - "description": "TypeScript is a superset of JavaScript that compiles to clean JavaScript output.", - "fork": false, - "url": "https://api.github.com/repos/microsoft/TypeScript", - "forks_url": "https://api.github.com/repos/microsoft/TypeScript/forks", - "keys_url": "https://api.github.com/repos/microsoft/TypeScript/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/microsoft/TypeScript/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/microsoft/TypeScript/teams", - "hooks_url": "https://api.github.com/repos/microsoft/TypeScript/hooks", - "issue_events_url": "https://api.github.com/repos/microsoft/TypeScript/issues/events{/number}", - "events_url": "https://api.github.com/repos/microsoft/TypeScript/events", - "assignees_url": "https://api.github.com/repos/microsoft/TypeScript/assignees{/user}", - "branches_url": "https://api.github.com/repos/microsoft/TypeScript/branches{/branch}", - "tags_url": "https://api.github.com/repos/microsoft/TypeScript/tags", - "blobs_url": "https://api.github.com/repos/microsoft/TypeScript/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/microsoft/TypeScript/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/microsoft/TypeScript/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/microsoft/TypeScript/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/microsoft/TypeScript/statuses/{sha}", - "languages_url": "https://api.github.com/repos/microsoft/TypeScript/languages", - "stargazers_url": "https://api.github.com/repos/microsoft/TypeScript/stargazers", - "contributors_url": "https://api.github.com/repos/microsoft/TypeScript/contributors", - "subscribers_url": "https://api.github.com/repos/microsoft/TypeScript/subscribers", - "subscription_url": "https://api.github.com/repos/microsoft/TypeScript/subscription", - "commits_url": "https://api.github.com/repos/microsoft/TypeScript/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/microsoft/TypeScript/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/microsoft/TypeScript/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/microsoft/TypeScript/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/microsoft/TypeScript/contents/{+path}", - "compare_url": "https://api.github.com/repos/microsoft/TypeScript/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/microsoft/TypeScript/merges", - "archive_url": "https://api.github.com/repos/microsoft/TypeScript/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/microsoft/TypeScript/downloads", - "issues_url": "https://api.github.com/repos/microsoft/TypeScript/issues{/number}", - "pulls_url": "https://api.github.com/repos/microsoft/TypeScript/pulls{/number}", - "milestones_url": "https://api.github.com/repos/microsoft/TypeScript/milestones{/number}", - "notifications_url": "https://api.github.com/repos/microsoft/TypeScript/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/microsoft/TypeScript/labels{/name}", - "releases_url": "https://api.github.com/repos/microsoft/TypeScript/releases{/id}", - "deployments_url": "https://api.github.com/repos/microsoft/TypeScript/deployments", - "created_at": "2014-06-17T15:28:39Z", - "updated_at": "2019-12-02T19:41:41Z", - "pushed_at": "2019-12-02T19:42:12Z", - "git_url": "git://github.com/microsoft/TypeScript.git", - "ssh_url": "git@github.com:microsoft/TypeScript.git", - "clone_url": "https://github.com/microsoft/TypeScript.git", - "svn_url": "https://github.com/microsoft/TypeScript", - "homepage": "https://www.typescriptlang.org", - "size": 1194156, - "stargazers_count": 56141, - "watchers_count": 56141, - "language": "TypeScript", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "forks_count": 7643, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 4096, - "license": { - "key": "apache-2.0", - "name": "Apache License 2.0", - "spdx_id": "Apache-2.0", - "url": "https://api.github.com/licenses/apache-2.0", - "node_id": "MDc6TGljZW5zZTI=" - }, - "forks": 7643, - "open_issues": 4096, - "watchers": 56141, - "default_branch": "master" - } - }, - "base": { - "label": "microsoft:AddJavaScriptSemanticErrorsToSyntacticErrors", - "ref": "AddJavaScriptSemanticErrorsToSyntacticErrors", - "sha": "05c2c9b67bdbdda06ca11d9b5c81604a6209caf8", - "user": { - "login": "microsoft", - "id": 6154722, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=", - "avatar_url": "https://avatars2.githubusercontent.com/u/6154722?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/microsoft", - "html_url": "https://github.com/microsoft", - "followers_url": "https://api.github.com/users/microsoft/followers", - "following_url": "https://api.github.com/users/microsoft/following{/other_user}", - "gists_url": "https://api.github.com/users/microsoft/gists{/gist_id}", - "starred_url": "https://api.github.com/users/microsoft/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/microsoft/subscriptions", - "organizations_url": "https://api.github.com/users/microsoft/orgs", - "repos_url": "https://api.github.com/users/microsoft/repos", - "events_url": "https://api.github.com/users/microsoft/events{/privacy}", - "received_events_url": "https://api.github.com/users/microsoft/received_events", - "type": "Organization", - "site_admin": false - }, - "repo": { - "id": 20929025, - "node_id": "MDEwOlJlcG9zaXRvcnkyMDkyOTAyNQ==", - "name": "TypeScript", - "full_name": "microsoft/TypeScript", - "private": false, - "owner": { - "login": "microsoft", - "id": 6154722, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=", - "avatar_url": "https://avatars2.githubusercontent.com/u/6154722?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/microsoft", - "html_url": "https://github.com/microsoft", - "followers_url": "https://api.github.com/users/microsoft/followers", - "following_url": "https://api.github.com/users/microsoft/following{/other_user}", - "gists_url": "https://api.github.com/users/microsoft/gists{/gist_id}", - "starred_url": "https://api.github.com/users/microsoft/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/microsoft/subscriptions", - "organizations_url": "https://api.github.com/users/microsoft/orgs", - "repos_url": "https://api.github.com/users/microsoft/repos", - "events_url": "https://api.github.com/users/microsoft/events{/privacy}", - "received_events_url": "https://api.github.com/users/microsoft/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/microsoft/TypeScript", - "description": "TypeScript is a superset of JavaScript that compiles to clean JavaScript output.", - "fork": false, - "url": "https://api.github.com/repos/microsoft/TypeScript", - "forks_url": "https://api.github.com/repos/microsoft/TypeScript/forks", - "keys_url": "https://api.github.com/repos/microsoft/TypeScript/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/microsoft/TypeScript/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/microsoft/TypeScript/teams", - "hooks_url": "https://api.github.com/repos/microsoft/TypeScript/hooks", - "issue_events_url": "https://api.github.com/repos/microsoft/TypeScript/issues/events{/number}", - "events_url": "https://api.github.com/repos/microsoft/TypeScript/events", - "assignees_url": "https://api.github.com/repos/microsoft/TypeScript/assignees{/user}", - "branches_url": "https://api.github.com/repos/microsoft/TypeScript/branches{/branch}", - "tags_url": "https://api.github.com/repos/microsoft/TypeScript/tags", - "blobs_url": "https://api.github.com/repos/microsoft/TypeScript/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/microsoft/TypeScript/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/microsoft/TypeScript/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/microsoft/TypeScript/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/microsoft/TypeScript/statuses/{sha}", - "languages_url": "https://api.github.com/repos/microsoft/TypeScript/languages", - "stargazers_url": "https://api.github.com/repos/microsoft/TypeScript/stargazers", - "contributors_url": "https://api.github.com/repos/microsoft/TypeScript/contributors", - "subscribers_url": "https://api.github.com/repos/microsoft/TypeScript/subscribers", - "subscription_url": "https://api.github.com/repos/microsoft/TypeScript/subscription", - "commits_url": "https://api.github.com/repos/microsoft/TypeScript/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/microsoft/TypeScript/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/microsoft/TypeScript/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/microsoft/TypeScript/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/microsoft/TypeScript/contents/{+path}", - "compare_url": "https://api.github.com/repos/microsoft/TypeScript/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/microsoft/TypeScript/merges", - "archive_url": "https://api.github.com/repos/microsoft/TypeScript/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/microsoft/TypeScript/downloads", - "issues_url": "https://api.github.com/repos/microsoft/TypeScript/issues{/number}", - "pulls_url": "https://api.github.com/repos/microsoft/TypeScript/pulls{/number}", - "milestones_url": "https://api.github.com/repos/microsoft/TypeScript/milestones{/number}", - "notifications_url": "https://api.github.com/repos/microsoft/TypeScript/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/microsoft/TypeScript/labels{/name}", - "releases_url": "https://api.github.com/repos/microsoft/TypeScript/releases{/id}", - "deployments_url": "https://api.github.com/repos/microsoft/TypeScript/deployments", - "created_at": "2014-06-17T15:28:39Z", - "updated_at": "2019-12-02T19:41:41Z", - "pushed_at": "2019-12-02T19:42:12Z", - "git_url": "git://github.com/microsoft/TypeScript.git", - "ssh_url": "git@github.com:microsoft/TypeScript.git", - "clone_url": "https://github.com/microsoft/TypeScript.git", - "svn_url": "https://github.com/microsoft/TypeScript", - "homepage": "https://www.typescriptlang.org", - "size": 1194156, - "stargazers_count": 56141, - "watchers_count": 56141, - "language": "TypeScript", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "forks_count": 7643, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 4096, - "license": { - "key": "apache-2.0", - "name": "Apache License 2.0", - "spdx_id": "Apache-2.0", - "url": "https://api.github.com/licenses/apache-2.0", - "node_id": "MDc6TGljZW5zZTI=" - }, - "forks": 7643, - "open_issues": 4096, - "watchers": 56141, - "default_branch": "master" - } - }, - "_links": { - "self": { - "href": "https://api.github.com/repos/microsoft/TypeScript/pulls/15575" - }, - "html": { - "href": "https://github.com/microsoft/TypeScript/pull/15575" - }, - "issue": { - "href": "https://api.github.com/repos/microsoft/TypeScript/issues/15575" - }, - "comments": { - "href": "https://api.github.com/repos/microsoft/TypeScript/issues/15575/comments" - }, - "review_comments": { - "href": "https://api.github.com/repos/microsoft/TypeScript/pulls/15575/comments" - }, - "review_comment": { - "href": "https://api.github.com/repos/microsoft/TypeScript/pulls/comments{/number}" - }, - "commits": { - "href": "https://api.github.com/repos/microsoft/TypeScript/pulls/15575/commits" - }, - "statuses": { - "href": "https://api.github.com/repos/microsoft/TypeScript/statuses/facafc7cb0490938e99ff2dbed1cdade7a9b3c40" - } - }, - "author_association": "NONE", - "draft": false, - "merged": false, - "mergeable": null, - "rebaseable": null, - "mergeable_state": "unknown", - "merged_by": null, - "comments": 0, - "review_comments": 0, - "maintainer_can_modify": false, - "commits": 10000, - "additions": 3420633, - "deletions": 754871, - "changed_files": 36468 - }, - "before": "97aba45d6fae62210400b65c1e029550d6a3e973", - "after": "facafc7cb0490938e99ff2dbed1cdade7a9b3c40", - "repository": { - "id": 20929025, - "node_id": "MDEwOlJlcG9zaXRvcnkyMDkyOTAyNQ==", - "name": "TypeScript", - "full_name": "microsoft/TypeScript", - "private": false, - "owner": { - "login": "microsoft", - "id": 6154722, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=", - "avatar_url": "https://avatars2.githubusercontent.com/u/6154722?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/microsoft", - "html_url": "https://github.com/microsoft", - "followers_url": "https://api.github.com/users/microsoft/followers", - "following_url": "https://api.github.com/users/microsoft/following{/other_user}", - "gists_url": "https://api.github.com/users/microsoft/gists{/gist_id}", - "starred_url": "https://api.github.com/users/microsoft/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/microsoft/subscriptions", - "organizations_url": "https://api.github.com/users/microsoft/orgs", - "repos_url": "https://api.github.com/users/microsoft/repos", - "events_url": "https://api.github.com/users/microsoft/events{/privacy}", - "received_events_url": "https://api.github.com/users/microsoft/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/microsoft/TypeScript", - "description": "TypeScript is a superset of JavaScript that compiles to clean JavaScript output.", - "fork": false, - "url": "https://api.github.com/repos/microsoft/TypeScript", - "forks_url": "https://api.github.com/repos/microsoft/TypeScript/forks", - "keys_url": "https://api.github.com/repos/microsoft/TypeScript/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/microsoft/TypeScript/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/microsoft/TypeScript/teams", - "hooks_url": "https://api.github.com/repos/microsoft/TypeScript/hooks", - "issue_events_url": "https://api.github.com/repos/microsoft/TypeScript/issues/events{/number}", - "events_url": "https://api.github.com/repos/microsoft/TypeScript/events", - "assignees_url": "https://api.github.com/repos/microsoft/TypeScript/assignees{/user}", - "branches_url": "https://api.github.com/repos/microsoft/TypeScript/branches{/branch}", - "tags_url": "https://api.github.com/repos/microsoft/TypeScript/tags", - "blobs_url": "https://api.github.com/repos/microsoft/TypeScript/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/microsoft/TypeScript/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/microsoft/TypeScript/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/microsoft/TypeScript/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/microsoft/TypeScript/statuses/{sha}", - "languages_url": "https://api.github.com/repos/microsoft/TypeScript/languages", - "stargazers_url": "https://api.github.com/repos/microsoft/TypeScript/stargazers", - "contributors_url": "https://api.github.com/repos/microsoft/TypeScript/contributors", - "subscribers_url": "https://api.github.com/repos/microsoft/TypeScript/subscribers", - "subscription_url": "https://api.github.com/repos/microsoft/TypeScript/subscription", - "commits_url": "https://api.github.com/repos/microsoft/TypeScript/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/microsoft/TypeScript/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/microsoft/TypeScript/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/microsoft/TypeScript/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/microsoft/TypeScript/contents/{+path}", - "compare_url": "https://api.github.com/repos/microsoft/TypeScript/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/microsoft/TypeScript/merges", - "archive_url": "https://api.github.com/repos/microsoft/TypeScript/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/microsoft/TypeScript/downloads", - "issues_url": "https://api.github.com/repos/microsoft/TypeScript/issues{/number}", - "pulls_url": "https://api.github.com/repos/microsoft/TypeScript/pulls{/number}", - "milestones_url": "https://api.github.com/repos/microsoft/TypeScript/milestones{/number}", - "notifications_url": "https://api.github.com/repos/microsoft/TypeScript/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/microsoft/TypeScript/labels{/name}", - "releases_url": "https://api.github.com/repos/microsoft/TypeScript/releases{/id}", - "deployments_url": "https://api.github.com/repos/microsoft/TypeScript/deployments", - "created_at": "2014-06-17T15:28:39Z", - "updated_at": "2019-12-02T19:41:41Z", - "pushed_at": "2019-12-02T19:42:12Z", - "git_url": "git://github.com/microsoft/TypeScript.git", - "ssh_url": "git@github.com:microsoft/TypeScript.git", - "clone_url": "https://github.com/microsoft/TypeScript.git", - "svn_url": "https://github.com/microsoft/TypeScript", - "homepage": "https://www.typescriptlang.org", - "size": 1194156, - "stargazers_count": 56141, - "watchers_count": 56141, - "language": "TypeScript", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "forks_count": 7643, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 4096, - "license": { - "key": "apache-2.0", - "name": "Apache License 2.0", - "spdx_id": "Apache-2.0", - "url": "https://api.github.com/licenses/apache-2.0", - "node_id": "MDc6TGljZW5zZTI=" - }, - "forks": 7643, - "open_issues": 4096, - "watchers": 56141, - "default_branch": "master" - }, - "organization": { - "login": "microsoft", - "id": 6154722, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=", - "url": "https://api.github.com/orgs/microsoft", - "repos_url": "https://api.github.com/orgs/microsoft/repos", - "events_url": "https://api.github.com/orgs/microsoft/events", - "hooks_url": "https://api.github.com/orgs/microsoft/hooks", - "issues_url": "https://api.github.com/orgs/microsoft/issues", - "members_url": "https://api.github.com/orgs/microsoft/members{/member}", - "public_members_url": "https://api.github.com/orgs/microsoft/public_members{/member}", - "avatar_url": "https://avatars2.githubusercontent.com/u/6154722?v=4", - "description": "Open source, from Microsoft with love" - }, - "sender": { - "login": "weswigham", - "id": 2932786, - "node_id": "MDQ6VXNlcjI5MzI3ODY=", - "avatar_url": "https://avatars3.githubusercontent.com/u/2932786?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/weswigham", - "html_url": "https://github.com/weswigham", - "followers_url": "https://api.github.com/users/weswigham/followers", - "following_url": "https://api.github.com/users/weswigham/following{/other_user}", - "gists_url": "https://api.github.com/users/weswigham/gists{/gist_id}", - "starred_url": "https://api.github.com/users/weswigham/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/weswigham/subscriptions", - "organizations_url": "https://api.github.com/users/weswigham/orgs", - "repos_url": "https://api.github.com/users/weswigham/repos", - "events_url": "https://api.github.com/users/weswigham/events{/privacy}", - "received_events_url": "https://api.github.com/users/weswigham/received_events", - "type": "User", - "site_admin": false - } } diff --git a/src/checks/addLabelForTeamMember.test.ts b/src/checks/addLabelForTeamMember.test.ts index 646f001..3a1f730 100644 --- a/src/checks/addLabelForTeamMember.test.ts +++ b/src/checks/addLabelForTeamMember.test.ts @@ -28,6 +28,14 @@ describe(addLabelForTeamMember, () => { const info = createPRInfo({ authorIsMemberOfTSTeam: false }) await addLabelForTeamMember(api, getPRFixture("opened"), getFakeLogger(), info) + expect(mockAPI.issues.addAssignees).not.toHaveBeenCalled() + }) + it("Does not label a closed PR", async () => { + const { mockAPI, api } = createMockGitHubClient() + + const info = createPRInfo({ authorIsMemberOfTSTeam: true }) + await addLabelForTeamMember(api, getPRFixture("closed"), getFakeLogger(), info) + expect(mockAPI.issues.addAssignees).not.toHaveBeenCalled() }) }) diff --git a/src/checks/addLabelForTeamMember.ts b/src/checks/addLabelForTeamMember.ts index f54c085..91b47ff 100644 --- a/src/checks/addLabelForTeamMember.ts +++ b/src/checks/addLabelForTeamMember.ts @@ -11,7 +11,10 @@ export const addLabelForTeamMember = async (api: Octokit, payload: WebhookPayloa // Check the access level of the user if (!info.authorIsMemberOfTSTeam) { - return logger.info(`Skipping because ${pull_request.user.login} is not a member of the TS team`) + return logger.info(`Skipping because ${pull_request.user.login} is not a member of the TS team.`) + } + if(pull_request.state === "closed") { + return logger.info(`Skipping because the pull request is already closed.`) } // Add the label diff --git a/src/checks/addMilestoneLabelsToPRs.test.ts b/src/checks/addMilestoneLabelsToPRs.test.ts index fe0f69c..b9a0467 100644 --- a/src/checks/addMilestoneLabelsToPRs.test.ts +++ b/src/checks/addMilestoneLabelsToPRs.test.ts @@ -93,4 +93,15 @@ describe(addMilestoneLabelsToPRs, () => { labels: ["For Milestone Bug"], }) }) + it("Doesn't do anything for closed PRs", async () => { + const { mockAPI, api } = createMockGitHubClient() + mockGetRelatedIssues.mockResolvedValue([{ assignees: [] }]) + + const pr = getPRFixture("closed") + pr.pull_request.body = `fixes #1123` + + await addMilestoneLabelsToPRs(api, pr, getFakeLogger()) + + expect(mockAPI.issues.addLabels).not.toHaveBeenCalled() + }) }) diff --git a/src/checks/addMilestoneLabelsToPRs.ts b/src/checks/addMilestoneLabelsToPRs.ts index 48fb351..a2b22e4 100644 --- a/src/checks/addMilestoneLabelsToPRs.ts +++ b/src/checks/addMilestoneLabelsToPRs.ts @@ -9,6 +9,10 @@ import { getRelatedIssues } from "../pr_meta/getRelatedIssues" export const addMilestoneLabelsToPRs = async (api: Octokit, payload: WebhookPayloadPullRequest, logger: Logger) => { const { repository: repo, pull_request } = payload + if(pull_request.state === "closed") { + return logger.info(`Skipping because the pull request is already closed.`) + } + const relatedIssues = await getRelatedIssues(pull_request.body, repo.owner.login, repo.name, api) const houseKeepingLabels = {