From 98180d2845d1f118582e34c6a8ca003ba46473cc Mon Sep 17 00:00:00 2001 From: "raoha.rh" Date: Sat, 24 Aug 2024 20:16:26 +0800 Subject: [PATCH 1/4] fix: filter robot created issue --- server/event_handler/issue.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/event_handler/issue.py b/server/event_handler/issue.py index 4fc207fe..a095e73b 100644 --- a/server/event_handler/issue.py +++ b/server/event_handler/issue.py @@ -33,6 +33,9 @@ def get_issue(self) -> Tuple[Issue, Repository]: async def execute(self): try: print("actions:", self.event["action"]) + if self.event['sender']['type'] == "Bot": + return {"success": True} + if self.event["action"] == "opened": issue, repo = self.get_issue() From cbc002c3a03cc06d2732090caaec9668002b40dd Mon Sep 17 00:00:00 2001 From: "raoha.rh" Date: Sat, 24 Aug 2024 20:16:33 +0800 Subject: [PATCH 2/4] fix: filter robot created issue --- .../github/events/issue/issue_comment.json | 249 ++++++++++++++++++ .../issue/issue_comment_with_metion.json | 249 ++++++++++++++++++ .../issue/issue_comment_with_quote.json | 249 ++++++++++++++++++ .../github/events/issue/issue_create.json | 205 ++++++++++++++ 4 files changed, 952 insertions(+) create mode 100644 server/tests/fixtures/github/events/issue/issue_comment.json create mode 100644 server/tests/fixtures/github/events/issue/issue_comment_with_metion.json create mode 100644 server/tests/fixtures/github/events/issue/issue_comment_with_quote.json create mode 100644 server/tests/fixtures/github/events/issue/issue_create.json diff --git a/server/tests/fixtures/github/events/issue/issue_comment.json b/server/tests/fixtures/github/events/issue/issue_comment.json new file mode 100644 index 00000000..f2313a72 --- /dev/null +++ b/server/tests/fixtures/github/events/issue/issue_comment.json @@ -0,0 +1,249 @@ +{ + "event": "issue_comment", + "payload": { + "action": "created", + "issue": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/33", + "repository_url": "https://api.github.com/repos/petercat-ai/demo", + "labels_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/labels{/name}", + "comments_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/comments", + "events_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/events", + "html_url": "https://github.com/petercat-ai/demo/issues/33", + "id": 2484539296, + "node_id": "I_kwDOMl4Nsc6UFw-g", + "number": 33, + "title": "Demo 用例 1: 新建 issue", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 1, + "created_at": "2024-08-24T12:02:40Z", + "updated_at": "2024-08-24T12:03:57Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "这是 issue 内容", + "reactions": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/33/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/timeline", + "performed_via_github_app": null, + "state_reason": null + }, + "comment": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308371015", + "html_url": "https://github.com/petercat-ai/demo/issues/33#issuecomment-2308371015", + "issue_url": "https://api.github.com/repos/petercat-ai/demo/issues/33", + "id": 2308371015, + "node_id": "IC_kwDOMl4Nsc6JlvJH", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2024-08-24T12:03:56Z", + "updated_at": "2024-08-24T12:03:56Z", + "author_association": "NONE", + "body": "这是普通的评论", + "reactions": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308371015/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + }, + "repository": { + "id": 845024689, + "node_id": "R_kgDOMl4NsQ", + "name": "demo", + "full_name": "petercat-ai/demo", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/demo", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/demo", + "forks_url": "https://api.github.com/repos/petercat-ai/demo/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/demo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/demo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/demo/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/demo/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/demo/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/demo/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/demo/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/demo/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/demo/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/demo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/demo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/demo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/demo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/demo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/demo/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/demo/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/demo/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/demo/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/demo/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/demo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/demo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/demo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/demo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/demo/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/demo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/demo/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/demo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/demo/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/demo/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/demo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/demo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/demo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/demo/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/demo/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/demo/deployments", + "created_at": "2024-08-20T12:41:42Z", + "updated_at": "2024-08-24T07:13:52Z", + "pushed_at": "2024-08-20T12:41:42Z", + "git_url": "git://github.com/petercat-ai/demo.git", + "ssh_url": "git@github.com:petercat-ai/demo.git", + "clone_url": "https://github.com/petercat-ai/demo.git", + "svn_url": "https://github.com/petercat-ai/demo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 4, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 4, + "watchers": 0, + "default_branch": "main", + "custom_properties": {} + }, + "organization": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "url": "https://api.github.com/orgs/petercat-ai", + "repos_url": "https://api.github.com/orgs/petercat-ai/repos", + "events_url": "https://api.github.com/orgs/petercat-ai/events", + "hooks_url": "https://api.github.com/orgs/petercat-ai/hooks", + "issues_url": "https://api.github.com/orgs/petercat-ai/issues", + "members_url": "https://api.github.com/orgs/petercat-ai/members{/member}", + "public_members_url": "https://api.github.com/orgs/petercat-ai/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "description": null + }, + "sender": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 54106016, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTQxMDYwMTY=" + } + } +} \ No newline at end of file diff --git a/server/tests/fixtures/github/events/issue/issue_comment_with_metion.json b/server/tests/fixtures/github/events/issue/issue_comment_with_metion.json new file mode 100644 index 00000000..504f247d --- /dev/null +++ b/server/tests/fixtures/github/events/issue/issue_comment_with_metion.json @@ -0,0 +1,249 @@ +{ + "event": "issue_comment", + "payload": { + "action": "created", + "issue": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/33", + "repository_url": "https://api.github.com/repos/petercat-ai/demo", + "labels_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/labels{/name}", + "comments_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/comments", + "events_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/events", + "html_url": "https://github.com/petercat-ai/demo/issues/33", + "id": 2484539296, + "node_id": "I_kwDOMl4Nsc6UFw-g", + "number": 33, + "title": "Demo 用例 1: 新建 issue", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 2, + "created_at": "2024-08-24T12:02:40Z", + "updated_at": "2024-08-24T12:13:47Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "这是 issue 内容", + "reactions": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/33/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/timeline", + "performed_via_github_app": null, + "state_reason": null + }, + "comment": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308374057", + "html_url": "https://github.com/petercat-ai/demo/issues/33#issuecomment-2308374057", + "issue_url": "https://api.github.com/repos/petercat-ai/demo/issues/33", + "id": 2308374057, + "node_id": "IC_kwDOMl4Nsc6Jlv4p", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2024-08-24T12:13:46Z", + "updated_at": "2024-08-24T12:13:46Z", + "author_association": "NONE", + "body": "这是 at 了人的评论 @RaoHai ", + "reactions": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308374057/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + }, + "repository": { + "id": 845024689, + "node_id": "R_kgDOMl4NsQ", + "name": "demo", + "full_name": "petercat-ai/demo", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/demo", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/demo", + "forks_url": "https://api.github.com/repos/petercat-ai/demo/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/demo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/demo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/demo/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/demo/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/demo/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/demo/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/demo/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/demo/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/demo/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/demo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/demo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/demo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/demo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/demo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/demo/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/demo/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/demo/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/demo/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/demo/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/demo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/demo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/demo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/demo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/demo/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/demo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/demo/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/demo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/demo/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/demo/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/demo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/demo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/demo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/demo/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/demo/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/demo/deployments", + "created_at": "2024-08-20T12:41:42Z", + "updated_at": "2024-08-24T07:13:52Z", + "pushed_at": "2024-08-20T12:41:42Z", + "git_url": "git://github.com/petercat-ai/demo.git", + "ssh_url": "git@github.com:petercat-ai/demo.git", + "clone_url": "https://github.com/petercat-ai/demo.git", + "svn_url": "https://github.com/petercat-ai/demo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 4, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 4, + "watchers": 0, + "default_branch": "main", + "custom_properties": {} + }, + "organization": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "url": "https://api.github.com/orgs/petercat-ai", + "repos_url": "https://api.github.com/orgs/petercat-ai/repos", + "events_url": "https://api.github.com/orgs/petercat-ai/events", + "hooks_url": "https://api.github.com/orgs/petercat-ai/hooks", + "issues_url": "https://api.github.com/orgs/petercat-ai/issues", + "members_url": "https://api.github.com/orgs/petercat-ai/members{/member}", + "public_members_url": "https://api.github.com/orgs/petercat-ai/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "description": null + }, + "sender": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 54106016, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTQxMDYwMTY=" + } + } +} \ No newline at end of file diff --git a/server/tests/fixtures/github/events/issue/issue_comment_with_quote.json b/server/tests/fixtures/github/events/issue/issue_comment_with_quote.json new file mode 100644 index 00000000..1110f1b0 --- /dev/null +++ b/server/tests/fixtures/github/events/issue/issue_comment_with_quote.json @@ -0,0 +1,249 @@ +{ + "event": "issue_comment", + "payload": { + "action": "created", + "issue": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/33", + "repository_url": "https://api.github.com/repos/petercat-ai/demo", + "labels_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/labels{/name}", + "comments_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/comments", + "events_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/events", + "html_url": "https://github.com/petercat-ai/demo/issues/33", + "id": 2484539296, + "node_id": "I_kwDOMl4Nsc6UFw-g", + "number": 33, + "title": "Demo 用例 1: 新建 issue", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 3, + "created_at": "2024-08-24T12:02:40Z", + "updated_at": "2024-08-24T12:15:28Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "这是 issue 内容", + "reactions": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/33/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/timeline", + "performed_via_github_app": null, + "state_reason": null + }, + "comment": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308374504", + "html_url": "https://github.com/petercat-ai/demo/issues/33#issuecomment-2308374504", + "issue_url": "https://api.github.com/repos/petercat-ai/demo/issues/33", + "id": 2308374504, + "node_id": "IC_kwDOMl4Nsc6Jlv_o", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2024-08-24T12:15:27Z", + "updated_at": "2024-08-24T12:15:27Z", + "author_association": "NONE", + "body": "> 这是 at 了人的评论 @RaoHai\r\n\r\n????", + "reactions": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308374504/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + }, + "repository": { + "id": 845024689, + "node_id": "R_kgDOMl4NsQ", + "name": "demo", + "full_name": "petercat-ai/demo", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/demo", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/demo", + "forks_url": "https://api.github.com/repos/petercat-ai/demo/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/demo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/demo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/demo/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/demo/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/demo/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/demo/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/demo/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/demo/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/demo/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/demo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/demo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/demo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/demo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/demo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/demo/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/demo/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/demo/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/demo/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/demo/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/demo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/demo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/demo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/demo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/demo/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/demo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/demo/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/demo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/demo/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/demo/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/demo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/demo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/demo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/demo/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/demo/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/demo/deployments", + "created_at": "2024-08-20T12:41:42Z", + "updated_at": "2024-08-24T07:13:52Z", + "pushed_at": "2024-08-20T12:41:42Z", + "git_url": "git://github.com/petercat-ai/demo.git", + "ssh_url": "git@github.com:petercat-ai/demo.git", + "clone_url": "https://github.com/petercat-ai/demo.git", + "svn_url": "https://github.com/petercat-ai/demo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 4, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 4, + "watchers": 0, + "default_branch": "main", + "custom_properties": {} + }, + "organization": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "url": "https://api.github.com/orgs/petercat-ai", + "repos_url": "https://api.github.com/orgs/petercat-ai/repos", + "events_url": "https://api.github.com/orgs/petercat-ai/events", + "hooks_url": "https://api.github.com/orgs/petercat-ai/hooks", + "issues_url": "https://api.github.com/orgs/petercat-ai/issues", + "members_url": "https://api.github.com/orgs/petercat-ai/members{/member}", + "public_members_url": "https://api.github.com/orgs/petercat-ai/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "description": null + }, + "sender": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 54106016, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTQxMDYwMTY=" + } + } +} \ No newline at end of file diff --git a/server/tests/fixtures/github/events/issue/issue_create.json b/server/tests/fixtures/github/events/issue/issue_create.json new file mode 100644 index 00000000..bcb8cbd9 --- /dev/null +++ b/server/tests/fixtures/github/events/issue/issue_create.json @@ -0,0 +1,205 @@ +{ + "event": "issues", + "payload": { + "action": "opened", + "issue": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/33", + "repository_url": "https://api.github.com/repos/petercat-ai/demo", + "labels_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/labels{/name}", + "comments_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/comments", + "events_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/events", + "html_url": "https://github.com/petercat-ai/demo/issues/33", + "id": 2484539296, + "node_id": "I_kwDOMl4Nsc6UFw-g", + "number": 33, + "title": "Demo 用例 1: 新建 issue", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2024-08-24T12:02:40Z", + "updated_at": "2024-08-24T12:02:40Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "这是 issue 内容", + "reactions": { + "url": "https://api.github.com/repos/petercat-ai/demo/issues/33/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/timeline", + "performed_via_github_app": null, + "state_reason": null + }, + "repository": { + "id": 845024689, + "node_id": "R_kgDOMl4NsQ", + "name": "demo", + "full_name": "petercat-ai/demo", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/demo", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/demo", + "forks_url": "https://api.github.com/repos/petercat-ai/demo/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/demo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/demo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/demo/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/demo/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/demo/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/demo/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/demo/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/demo/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/demo/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/demo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/demo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/demo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/demo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/demo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/demo/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/demo/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/demo/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/demo/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/demo/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/demo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/demo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/demo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/demo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/demo/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/demo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/demo/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/demo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/demo/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/demo/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/demo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/demo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/demo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/demo/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/demo/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/demo/deployments", + "created_at": "2024-08-20T12:41:42Z", + "updated_at": "2024-08-24T07:13:52Z", + "pushed_at": "2024-08-20T12:41:42Z", + "git_url": "git://github.com/petercat-ai/demo.git", + "ssh_url": "git@github.com:petercat-ai/demo.git", + "clone_url": "https://github.com/petercat-ai/demo.git", + "svn_url": "https://github.com/petercat-ai/demo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 4, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 4, + "watchers": 0, + "default_branch": "main", + "custom_properties": {} + }, + "organization": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "url": "https://api.github.com/orgs/petercat-ai", + "repos_url": "https://api.github.com/orgs/petercat-ai/repos", + "events_url": "https://api.github.com/orgs/petercat-ai/events", + "hooks_url": "https://api.github.com/orgs/petercat-ai/hooks", + "issues_url": "https://api.github.com/orgs/petercat-ai/issues", + "members_url": "https://api.github.com/orgs/petercat-ai/members{/member}", + "public_members_url": "https://api.github.com/orgs/petercat-ai/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "description": null + }, + "sender": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 54106016, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTQxMDYwMTY=" + } + } +} \ No newline at end of file From b7ad0c64b14a72ecc893974e8093b94acaaa34bd Mon Sep 17 00:00:00 2001 From: "raoha.rh" Date: Sat, 24 Aug 2024 20:23:05 +0800 Subject: [PATCH 3/4] feat: add more fixtures --- .../{issue_comment.json => comment.json} | 0 .../issue/{issue_create.json => create.json} | 0 .../issue/issue_comment_with_metion.json | 249 ------- .../issue/issue_comment_with_quote.json | 249 ------- .../github/events/pull_request/create.json | 528 +++++++++++++++ .../events/pull_request/review_comment.json | 584 ++++++++++++++++ .../events/pull_request/review_edit.json | 555 +++++++++++++++ .../events/pull_request/review_submit.json | 554 +++++++++++++++ .../events/pull_request/review_thread.json | 635 ++++++++++++++++++ 9 files changed, 2856 insertions(+), 498 deletions(-) rename server/tests/fixtures/github/events/issue/{issue_comment.json => comment.json} (100%) rename server/tests/fixtures/github/events/issue/{issue_create.json => create.json} (100%) delete mode 100644 server/tests/fixtures/github/events/issue/issue_comment_with_metion.json delete mode 100644 server/tests/fixtures/github/events/issue/issue_comment_with_quote.json create mode 100644 server/tests/fixtures/github/events/pull_request/create.json create mode 100644 server/tests/fixtures/github/events/pull_request/review_comment.json create mode 100644 server/tests/fixtures/github/events/pull_request/review_edit.json create mode 100644 server/tests/fixtures/github/events/pull_request/review_submit.json create mode 100644 server/tests/fixtures/github/events/pull_request/review_thread.json diff --git a/server/tests/fixtures/github/events/issue/issue_comment.json b/server/tests/fixtures/github/events/issue/comment.json similarity index 100% rename from server/tests/fixtures/github/events/issue/issue_comment.json rename to server/tests/fixtures/github/events/issue/comment.json diff --git a/server/tests/fixtures/github/events/issue/issue_create.json b/server/tests/fixtures/github/events/issue/create.json similarity index 100% rename from server/tests/fixtures/github/events/issue/issue_create.json rename to server/tests/fixtures/github/events/issue/create.json diff --git a/server/tests/fixtures/github/events/issue/issue_comment_with_metion.json b/server/tests/fixtures/github/events/issue/issue_comment_with_metion.json deleted file mode 100644 index 504f247d..00000000 --- a/server/tests/fixtures/github/events/issue/issue_comment_with_metion.json +++ /dev/null @@ -1,249 +0,0 @@ -{ - "event": "issue_comment", - "payload": { - "action": "created", - "issue": { - "url": "https://api.github.com/repos/petercat-ai/demo/issues/33", - "repository_url": "https://api.github.com/repos/petercat-ai/demo", - "labels_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/labels{/name}", - "comments_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/comments", - "events_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/events", - "html_url": "https://github.com/petercat-ai/demo/issues/33", - "id": 2484539296, - "node_id": "I_kwDOMl4Nsc6UFw-g", - "number": 33, - "title": "Demo 用例 1: 新建 issue", - "user": { - "login": "RaoHai", - "id": 566097, - "node_id": "MDQ6VXNlcjU2NjA5Nw==", - "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/RaoHai", - "html_url": "https://github.com/RaoHai", - "followers_url": "https://api.github.com/users/RaoHai/followers", - "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", - "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", - "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", - "organizations_url": "https://api.github.com/users/RaoHai/orgs", - "repos_url": "https://api.github.com/users/RaoHai/repos", - "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", - "received_events_url": "https://api.github.com/users/RaoHai/received_events", - "type": "User", - "site_admin": false - }, - "labels": [], - "state": "open", - "locked": false, - "assignee": null, - "assignees": [], - "milestone": null, - "comments": 2, - "created_at": "2024-08-24T12:02:40Z", - "updated_at": "2024-08-24T12:13:47Z", - "closed_at": null, - "author_association": "NONE", - "active_lock_reason": null, - "body": "这是 issue 内容", - "reactions": { - "url": "https://api.github.com/repos/petercat-ai/demo/issues/33/reactions", - "total_count": 0, - "+1": 0, - "-1": 0, - "laugh": 0, - "hooray": 0, - "confused": 0, - "heart": 0, - "rocket": 0, - "eyes": 0 - }, - "timeline_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/timeline", - "performed_via_github_app": null, - "state_reason": null - }, - "comment": { - "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308374057", - "html_url": "https://github.com/petercat-ai/demo/issues/33#issuecomment-2308374057", - "issue_url": "https://api.github.com/repos/petercat-ai/demo/issues/33", - "id": 2308374057, - "node_id": "IC_kwDOMl4Nsc6Jlv4p", - "user": { - "login": "RaoHai", - "id": 566097, - "node_id": "MDQ6VXNlcjU2NjA5Nw==", - "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/RaoHai", - "html_url": "https://github.com/RaoHai", - "followers_url": "https://api.github.com/users/RaoHai/followers", - "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", - "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", - "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", - "organizations_url": "https://api.github.com/users/RaoHai/orgs", - "repos_url": "https://api.github.com/users/RaoHai/repos", - "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", - "received_events_url": "https://api.github.com/users/RaoHai/received_events", - "type": "User", - "site_admin": false - }, - "created_at": "2024-08-24T12:13:46Z", - "updated_at": "2024-08-24T12:13:46Z", - "author_association": "NONE", - "body": "这是 at 了人的评论 @RaoHai ", - "reactions": { - "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308374057/reactions", - "total_count": 0, - "+1": 0, - "-1": 0, - "laugh": 0, - "hooray": 0, - "confused": 0, - "heart": 0, - "rocket": 0, - "eyes": 0 - }, - "performed_via_github_app": null - }, - "repository": { - "id": 845024689, - "node_id": "R_kgDOMl4NsQ", - "name": "demo", - "full_name": "petercat-ai/demo", - "private": true, - "owner": { - "login": "petercat-ai", - "id": 169796403, - "node_id": "O_kgDOCh7jMw", - "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/petercat-ai", - "html_url": "https://github.com/petercat-ai", - "followers_url": "https://api.github.com/users/petercat-ai/followers", - "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", - "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", - "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", - "organizations_url": "https://api.github.com/users/petercat-ai/orgs", - "repos_url": "https://api.github.com/users/petercat-ai/repos", - "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", - "received_events_url": "https://api.github.com/users/petercat-ai/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/petercat-ai/demo", - "description": null, - "fork": false, - "url": "https://api.github.com/repos/petercat-ai/demo", - "forks_url": "https://api.github.com/repos/petercat-ai/demo/forks", - "keys_url": "https://api.github.com/repos/petercat-ai/demo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/petercat-ai/demo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/petercat-ai/demo/teams", - "hooks_url": "https://api.github.com/repos/petercat-ai/demo/hooks", - "issue_events_url": "https://api.github.com/repos/petercat-ai/demo/issues/events{/number}", - "events_url": "https://api.github.com/repos/petercat-ai/demo/events", - "assignees_url": "https://api.github.com/repos/petercat-ai/demo/assignees{/user}", - "branches_url": "https://api.github.com/repos/petercat-ai/demo/branches{/branch}", - "tags_url": "https://api.github.com/repos/petercat-ai/demo/tags", - "blobs_url": "https://api.github.com/repos/petercat-ai/demo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/petercat-ai/demo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/petercat-ai/demo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/petercat-ai/demo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/petercat-ai/demo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/petercat-ai/demo/languages", - "stargazers_url": "https://api.github.com/repos/petercat-ai/demo/stargazers", - "contributors_url": "https://api.github.com/repos/petercat-ai/demo/contributors", - "subscribers_url": "https://api.github.com/repos/petercat-ai/demo/subscribers", - "subscription_url": "https://api.github.com/repos/petercat-ai/demo/subscription", - "commits_url": "https://api.github.com/repos/petercat-ai/demo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/petercat-ai/demo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/petercat-ai/demo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/petercat-ai/demo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/petercat-ai/demo/contents/{+path}", - "compare_url": "https://api.github.com/repos/petercat-ai/demo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/petercat-ai/demo/merges", - "archive_url": "https://api.github.com/repos/petercat-ai/demo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/petercat-ai/demo/downloads", - "issues_url": "https://api.github.com/repos/petercat-ai/demo/issues{/number}", - "pulls_url": "https://api.github.com/repos/petercat-ai/demo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/petercat-ai/demo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/petercat-ai/demo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/petercat-ai/demo/labels{/name}", - "releases_url": "https://api.github.com/repos/petercat-ai/demo/releases{/id}", - "deployments_url": "https://api.github.com/repos/petercat-ai/demo/deployments", - "created_at": "2024-08-20T12:41:42Z", - "updated_at": "2024-08-24T07:13:52Z", - "pushed_at": "2024-08-20T12:41:42Z", - "git_url": "git://github.com/petercat-ai/demo.git", - "ssh_url": "git@github.com:petercat-ai/demo.git", - "clone_url": "https://github.com/petercat-ai/demo.git", - "svn_url": "https://github.com/petercat-ai/demo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": false, - "has_pages": false, - "has_discussions": true, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 4, - "license": null, - "allow_forking": false, - "is_template": false, - "web_commit_signoff_required": false, - "topics": [], - "visibility": "private", - "forks": 0, - "open_issues": 4, - "watchers": 0, - "default_branch": "main", - "custom_properties": {} - }, - "organization": { - "login": "petercat-ai", - "id": 169796403, - "node_id": "O_kgDOCh7jMw", - "url": "https://api.github.com/orgs/petercat-ai", - "repos_url": "https://api.github.com/orgs/petercat-ai/repos", - "events_url": "https://api.github.com/orgs/petercat-ai/events", - "hooks_url": "https://api.github.com/orgs/petercat-ai/hooks", - "issues_url": "https://api.github.com/orgs/petercat-ai/issues", - "members_url": "https://api.github.com/orgs/petercat-ai/members{/member}", - "public_members_url": "https://api.github.com/orgs/petercat-ai/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", - "description": null - }, - "sender": { - "login": "RaoHai", - "id": 566097, - "node_id": "MDQ6VXNlcjU2NjA5Nw==", - "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/RaoHai", - "html_url": "https://github.com/RaoHai", - "followers_url": "https://api.github.com/users/RaoHai/followers", - "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", - "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", - "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", - "organizations_url": "https://api.github.com/users/RaoHai/orgs", - "repos_url": "https://api.github.com/users/RaoHai/repos", - "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", - "received_events_url": "https://api.github.com/users/RaoHai/received_events", - "type": "User", - "site_admin": false - }, - "installation": { - "id": 54106016, - "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTQxMDYwMTY=" - } - } -} \ No newline at end of file diff --git a/server/tests/fixtures/github/events/issue/issue_comment_with_quote.json b/server/tests/fixtures/github/events/issue/issue_comment_with_quote.json deleted file mode 100644 index 1110f1b0..00000000 --- a/server/tests/fixtures/github/events/issue/issue_comment_with_quote.json +++ /dev/null @@ -1,249 +0,0 @@ -{ - "event": "issue_comment", - "payload": { - "action": "created", - "issue": { - "url": "https://api.github.com/repos/petercat-ai/demo/issues/33", - "repository_url": "https://api.github.com/repos/petercat-ai/demo", - "labels_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/labels{/name}", - "comments_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/comments", - "events_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/events", - "html_url": "https://github.com/petercat-ai/demo/issues/33", - "id": 2484539296, - "node_id": "I_kwDOMl4Nsc6UFw-g", - "number": 33, - "title": "Demo 用例 1: 新建 issue", - "user": { - "login": "RaoHai", - "id": 566097, - "node_id": "MDQ6VXNlcjU2NjA5Nw==", - "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/RaoHai", - "html_url": "https://github.com/RaoHai", - "followers_url": "https://api.github.com/users/RaoHai/followers", - "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", - "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", - "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", - "organizations_url": "https://api.github.com/users/RaoHai/orgs", - "repos_url": "https://api.github.com/users/RaoHai/repos", - "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", - "received_events_url": "https://api.github.com/users/RaoHai/received_events", - "type": "User", - "site_admin": false - }, - "labels": [], - "state": "open", - "locked": false, - "assignee": null, - "assignees": [], - "milestone": null, - "comments": 3, - "created_at": "2024-08-24T12:02:40Z", - "updated_at": "2024-08-24T12:15:28Z", - "closed_at": null, - "author_association": "NONE", - "active_lock_reason": null, - "body": "这是 issue 内容", - "reactions": { - "url": "https://api.github.com/repos/petercat-ai/demo/issues/33/reactions", - "total_count": 0, - "+1": 0, - "-1": 0, - "laugh": 0, - "hooray": 0, - "confused": 0, - "heart": 0, - "rocket": 0, - "eyes": 0 - }, - "timeline_url": "https://api.github.com/repos/petercat-ai/demo/issues/33/timeline", - "performed_via_github_app": null, - "state_reason": null - }, - "comment": { - "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308374504", - "html_url": "https://github.com/petercat-ai/demo/issues/33#issuecomment-2308374504", - "issue_url": "https://api.github.com/repos/petercat-ai/demo/issues/33", - "id": 2308374504, - "node_id": "IC_kwDOMl4Nsc6Jlv_o", - "user": { - "login": "RaoHai", - "id": 566097, - "node_id": "MDQ6VXNlcjU2NjA5Nw==", - "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/RaoHai", - "html_url": "https://github.com/RaoHai", - "followers_url": "https://api.github.com/users/RaoHai/followers", - "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", - "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", - "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", - "organizations_url": "https://api.github.com/users/RaoHai/orgs", - "repos_url": "https://api.github.com/users/RaoHai/repos", - "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", - "received_events_url": "https://api.github.com/users/RaoHai/received_events", - "type": "User", - "site_admin": false - }, - "created_at": "2024-08-24T12:15:27Z", - "updated_at": "2024-08-24T12:15:27Z", - "author_association": "NONE", - "body": "> 这是 at 了人的评论 @RaoHai\r\n\r\n????", - "reactions": { - "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308374504/reactions", - "total_count": 0, - "+1": 0, - "-1": 0, - "laugh": 0, - "hooray": 0, - "confused": 0, - "heart": 0, - "rocket": 0, - "eyes": 0 - }, - "performed_via_github_app": null - }, - "repository": { - "id": 845024689, - "node_id": "R_kgDOMl4NsQ", - "name": "demo", - "full_name": "petercat-ai/demo", - "private": true, - "owner": { - "login": "petercat-ai", - "id": 169796403, - "node_id": "O_kgDOCh7jMw", - "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/petercat-ai", - "html_url": "https://github.com/petercat-ai", - "followers_url": "https://api.github.com/users/petercat-ai/followers", - "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", - "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", - "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", - "organizations_url": "https://api.github.com/users/petercat-ai/orgs", - "repos_url": "https://api.github.com/users/petercat-ai/repos", - "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", - "received_events_url": "https://api.github.com/users/petercat-ai/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/petercat-ai/demo", - "description": null, - "fork": false, - "url": "https://api.github.com/repos/petercat-ai/demo", - "forks_url": "https://api.github.com/repos/petercat-ai/demo/forks", - "keys_url": "https://api.github.com/repos/petercat-ai/demo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/petercat-ai/demo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/petercat-ai/demo/teams", - "hooks_url": "https://api.github.com/repos/petercat-ai/demo/hooks", - "issue_events_url": "https://api.github.com/repos/petercat-ai/demo/issues/events{/number}", - "events_url": "https://api.github.com/repos/petercat-ai/demo/events", - "assignees_url": "https://api.github.com/repos/petercat-ai/demo/assignees{/user}", - "branches_url": "https://api.github.com/repos/petercat-ai/demo/branches{/branch}", - "tags_url": "https://api.github.com/repos/petercat-ai/demo/tags", - "blobs_url": "https://api.github.com/repos/petercat-ai/demo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/petercat-ai/demo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/petercat-ai/demo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/petercat-ai/demo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/petercat-ai/demo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/petercat-ai/demo/languages", - "stargazers_url": "https://api.github.com/repos/petercat-ai/demo/stargazers", - "contributors_url": "https://api.github.com/repos/petercat-ai/demo/contributors", - "subscribers_url": "https://api.github.com/repos/petercat-ai/demo/subscribers", - "subscription_url": "https://api.github.com/repos/petercat-ai/demo/subscription", - "commits_url": "https://api.github.com/repos/petercat-ai/demo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/petercat-ai/demo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/petercat-ai/demo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/petercat-ai/demo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/petercat-ai/demo/contents/{+path}", - "compare_url": "https://api.github.com/repos/petercat-ai/demo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/petercat-ai/demo/merges", - "archive_url": "https://api.github.com/repos/petercat-ai/demo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/petercat-ai/demo/downloads", - "issues_url": "https://api.github.com/repos/petercat-ai/demo/issues{/number}", - "pulls_url": "https://api.github.com/repos/petercat-ai/demo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/petercat-ai/demo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/petercat-ai/demo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/petercat-ai/demo/labels{/name}", - "releases_url": "https://api.github.com/repos/petercat-ai/demo/releases{/id}", - "deployments_url": "https://api.github.com/repos/petercat-ai/demo/deployments", - "created_at": "2024-08-20T12:41:42Z", - "updated_at": "2024-08-24T07:13:52Z", - "pushed_at": "2024-08-20T12:41:42Z", - "git_url": "git://github.com/petercat-ai/demo.git", - "ssh_url": "git@github.com:petercat-ai/demo.git", - "clone_url": "https://github.com/petercat-ai/demo.git", - "svn_url": "https://github.com/petercat-ai/demo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": false, - "has_pages": false, - "has_discussions": true, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 4, - "license": null, - "allow_forking": false, - "is_template": false, - "web_commit_signoff_required": false, - "topics": [], - "visibility": "private", - "forks": 0, - "open_issues": 4, - "watchers": 0, - "default_branch": "main", - "custom_properties": {} - }, - "organization": { - "login": "petercat-ai", - "id": 169796403, - "node_id": "O_kgDOCh7jMw", - "url": "https://api.github.com/orgs/petercat-ai", - "repos_url": "https://api.github.com/orgs/petercat-ai/repos", - "events_url": "https://api.github.com/orgs/petercat-ai/events", - "hooks_url": "https://api.github.com/orgs/petercat-ai/hooks", - "issues_url": "https://api.github.com/orgs/petercat-ai/issues", - "members_url": "https://api.github.com/orgs/petercat-ai/members{/member}", - "public_members_url": "https://api.github.com/orgs/petercat-ai/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", - "description": null - }, - "sender": { - "login": "RaoHai", - "id": 566097, - "node_id": "MDQ6VXNlcjU2NjA5Nw==", - "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/RaoHai", - "html_url": "https://github.com/RaoHai", - "followers_url": "https://api.github.com/users/RaoHai/followers", - "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", - "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", - "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", - "organizations_url": "https://api.github.com/users/RaoHai/orgs", - "repos_url": "https://api.github.com/users/RaoHai/repos", - "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", - "received_events_url": "https://api.github.com/users/RaoHai/received_events", - "type": "User", - "site_admin": false - }, - "installation": { - "id": 54106016, - "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTQxMDYwMTY=" - } - } -} \ No newline at end of file diff --git a/server/tests/fixtures/github/events/pull_request/create.json b/server/tests/fixtures/github/events/pull_request/create.json new file mode 100644 index 00000000..d950725b --- /dev/null +++ b/server/tests/fixtures/github/events/pull_request/create.json @@ -0,0 +1,528 @@ +{ + "event": "pull_request", + "payload": { + "action": "opened", + "number": 258, + "pull_request": { + "url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258", + "id": 2035421682, + "node_id": "PR_kwDOKy6oz855UhHy", + "html_url": "https://github.com/petercat-ai/petercat/pull/258", + "diff_url": "https://github.com/petercat-ai/petercat/pull/258.diff", + "patch_url": "https://github.com/petercat-ai/petercat/pull/258.patch", + "issue_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258", + "number": 258, + "state": "open", + "locked": false, + "title": "Fix/filter robot created issue", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "body": "- 如果 issue 是机器人创建的,也不要评论。", + "created_at": "2024-08-24T12:17:20Z", + "updated_at": "2024-08-24T12:17:20Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": null, + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/commits", + "review_comments_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/comments", + "review_comment_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258/comments", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/cbc002c3a03cc06d2732090caaec9668002b40dd", + "head": { + "label": "petercat-ai:fix/filter-robot-created-issue", + "ref": "fix/filter-robot-created-issue", + "sha": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "user": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": true, + "allow_update_branch": false, + "use_squash_pr_title_as_default": true, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "PR_TITLE", + "merge_commit_message": "PR_BODY", + "merge_commit_title": "PR_TITLE" + } + }, + "base": { + "label": "petercat-ai:main", + "ref": "main", + "sha": "6d1a8ee3ee93ff65009aa3090adae26749933945", + "user": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": true, + "allow_update_branch": false, + "use_squash_pr_title_as_default": true, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "PR_TITLE", + "merge_commit_message": "PR_BODY", + "merge_commit_title": "PR_TITLE" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258" + }, + "html": { + "href": "https://github.com/petercat-ai/petercat/pull/258" + }, + "issue": { + "href": "https://api.github.com/repos/petercat-ai/petercat/issues/258" + }, + "comments": { + "href": "https://api.github.com/repos/petercat-ai/petercat/issues/258/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/petercat-ai/petercat/statuses/cbc002c3a03cc06d2732090caaec9668002b40dd" + } + }, + "author_association": "CONTRIBUTOR", + "auto_merge": null, + "active_lock_reason": null, + "merged": false, + "mergeable": null, + "rebaseable": null, + "mergeable_state": "unknown", + "merged_by": null, + "comments": 0, + "review_comments": 0, + "maintainer_can_modify": false, + "commits": 2, + "additions": 955, + "deletions": 0, + "changed_files": 5 + }, + "repository": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "custom_properties": {} + }, + "organization": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "url": "https://api.github.com/orgs/petercat-ai", + "repos_url": "https://api.github.com/orgs/petercat-ai/repos", + "events_url": "https://api.github.com/orgs/petercat-ai/events", + "hooks_url": "https://api.github.com/orgs/petercat-ai/hooks", + "issues_url": "https://api.github.com/orgs/petercat-ai/issues", + "members_url": "https://api.github.com/orgs/petercat-ai/members{/member}", + "public_members_url": "https://api.github.com/orgs/petercat-ai/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "description": null + }, + "sender": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 54106016, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTQxMDYwMTY=" + } + } +} \ No newline at end of file diff --git a/server/tests/fixtures/github/events/pull_request/review_comment.json b/server/tests/fixtures/github/events/pull_request/review_comment.json new file mode 100644 index 00000000..db7f8121 --- /dev/null +++ b/server/tests/fixtures/github/events/pull_request/review_comment.json @@ -0,0 +1,584 @@ +{ + "event": "pull_request_review_comment", + "payload": { + "action": "created", + "comment": { + "url": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments/1729951387", + "pull_request_review_id": 2258685303, + "id": 1729951387, + "node_id": "PRRC_kwDOKy6oz85nHPab", + "diff_hunk": "@@ -33,6 +33,9 @@ def get_issue(self) -> Tuple[Issue, Repository]:\n async def execute(self):\n try:\n print(\"actions:\", self.event[\"action\"])\n+ if self.event['sender']['type'] == \"Bot\":\n+ return {\"success\": True}\n+", + "path": "server/event_handler/issue.py", + "commit_id": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "original_commit_id": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "body": "知道了。但是不想改。", + "created_at": "2024-08-24T12:21:20Z", + "updated_at": "2024-08-24T12:21:20Z", + "html_url": "https://github.com/petercat-ai/petercat/pull/258#discussion_r1729951387", + "pull_request_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258", + "author_association": "CONTRIBUTOR", + "_links": { + "self": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments/1729951387" + }, + "html": { + "href": "https://github.com/petercat-ai/petercat/pull/258#discussion_r1729951387" + }, + "pull_request": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258" + } + }, + "reactions": { + "url": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments/1729951387/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 38, + "original_line": 38, + "side": "RIGHT", + "in_reply_to_id": 1729951181, + "original_position": 6, + "position": 6, + "subject_type": "line" + }, + "pull_request": { + "url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258", + "id": 2035421682, + "node_id": "PR_kwDOKy6oz855UhHy", + "html_url": "https://github.com/petercat-ai/petercat/pull/258", + "diff_url": "https://github.com/petercat-ai/petercat/pull/258.diff", + "patch_url": "https://github.com/petercat-ai/petercat/pull/258.patch", + "issue_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258", + "number": 258, + "state": "open", + "locked": false, + "title": "Fix/filter robot created issue", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "body": "- 如果 issue 是机器人创建的,也不要评论。", + "created_at": "2024-08-24T12:17:20Z", + "updated_at": "2024-08-24T12:21:20Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "5881a41dc798ed3d1522648b3889a85ed7632abb", + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/commits", + "review_comments_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/comments", + "review_comment_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258/comments", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/cbc002c3a03cc06d2732090caaec9668002b40dd", + "head": { + "label": "petercat-ai:fix/filter-robot-created-issue", + "ref": "fix/filter-robot-created-issue", + "sha": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "user": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": true, + "allow_update_branch": false, + "use_squash_pr_title_as_default": true, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "PR_TITLE", + "merge_commit_message": "PR_BODY", + "merge_commit_title": "PR_TITLE" + } + }, + "base": { + "label": "petercat-ai:main", + "ref": "main", + "sha": "6d1a8ee3ee93ff65009aa3090adae26749933945", + "user": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": true, + "allow_update_branch": false, + "use_squash_pr_title_as_default": true, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "PR_TITLE", + "merge_commit_message": "PR_BODY", + "merge_commit_title": "PR_TITLE" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258" + }, + "html": { + "href": "https://github.com/petercat-ai/petercat/pull/258" + }, + "issue": { + "href": "https://api.github.com/repos/petercat-ai/petercat/issues/258" + }, + "comments": { + "href": "https://api.github.com/repos/petercat-ai/petercat/issues/258/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/petercat-ai/petercat/statuses/cbc002c3a03cc06d2732090caaec9668002b40dd" + } + }, + "author_association": "CONTRIBUTOR", + "auto_merge": null, + "active_lock_reason": null + }, + "repository": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "custom_properties": {} + }, + "organization": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "url": "https://api.github.com/orgs/petercat-ai", + "repos_url": "https://api.github.com/orgs/petercat-ai/repos", + "events_url": "https://api.github.com/orgs/petercat-ai/events", + "hooks_url": "https://api.github.com/orgs/petercat-ai/hooks", + "issues_url": "https://api.github.com/orgs/petercat-ai/issues", + "members_url": "https://api.github.com/orgs/petercat-ai/members{/member}", + "public_members_url": "https://api.github.com/orgs/petercat-ai/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "description": null + }, + "sender": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 54106016, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTQxMDYwMTY=" + } + } +} \ No newline at end of file diff --git a/server/tests/fixtures/github/events/pull_request/review_edit.json b/server/tests/fixtures/github/events/pull_request/review_edit.json new file mode 100644 index 00000000..7e303570 --- /dev/null +++ b/server/tests/fixtures/github/events/pull_request/review_edit.json @@ -0,0 +1,555 @@ +{ + "event": "pull_request_review", + "payload": { + "action": "edited", + "review": { + "id": 2258685061, + "node_id": "PRR_kwDOKy6oz86GoMyF", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "body": "按上面说的改吧", + "commit_id": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "submitted_at": "2024-08-24T12:19:28Z", + "state": "commented", + "html_url": "https://github.com/petercat-ai/petercat/pull/258#pullrequestreview-2258685061", + "pull_request_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258", + "author_association": "CONTRIBUTOR", + "_links": { + "html": { + "href": "https://github.com/petercat-ai/petercat/pull/258#pullrequestreview-2258685061" + }, + "pull_request": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258" + } + } + }, + "pull_request": { + "url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258", + "id": 2035421682, + "node_id": "PR_kwDOKy6oz855UhHy", + "html_url": "https://github.com/petercat-ai/petercat/pull/258", + "diff_url": "https://github.com/petercat-ai/petercat/pull/258.diff", + "patch_url": "https://github.com/petercat-ai/petercat/pull/258.patch", + "issue_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258", + "number": 258, + "state": "open", + "locked": false, + "title": "Fix/filter robot created issue", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "body": "- 如果 issue 是机器人创建的,也不要评论。", + "created_at": "2024-08-24T12:17:20Z", + "updated_at": "2024-08-24T12:19:28Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "5881a41dc798ed3d1522648b3889a85ed7632abb", + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/commits", + "review_comments_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/comments", + "review_comment_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258/comments", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/cbc002c3a03cc06d2732090caaec9668002b40dd", + "head": { + "label": "petercat-ai:fix/filter-robot-created-issue", + "ref": "fix/filter-robot-created-issue", + "sha": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "user": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": true, + "allow_update_branch": false, + "use_squash_pr_title_as_default": true, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "PR_TITLE", + "merge_commit_message": "PR_BODY", + "merge_commit_title": "PR_TITLE" + } + }, + "base": { + "label": "petercat-ai:main", + "ref": "main", + "sha": "6d1a8ee3ee93ff65009aa3090adae26749933945", + "user": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": true, + "allow_update_branch": false, + "use_squash_pr_title_as_default": true, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "PR_TITLE", + "merge_commit_message": "PR_BODY", + "merge_commit_title": "PR_TITLE" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258" + }, + "html": { + "href": "https://github.com/petercat-ai/petercat/pull/258" + }, + "issue": { + "href": "https://api.github.com/repos/petercat-ai/petercat/issues/258" + }, + "comments": { + "href": "https://api.github.com/repos/petercat-ai/petercat/issues/258/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/petercat-ai/petercat/statuses/cbc002c3a03cc06d2732090caaec9668002b40dd" + } + }, + "author_association": "CONTRIBUTOR", + "auto_merge": null, + "active_lock_reason": null + }, + "changes": {}, + "repository": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "custom_properties": {} + }, + "organization": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "url": "https://api.github.com/orgs/petercat-ai", + "repos_url": "https://api.github.com/orgs/petercat-ai/repos", + "events_url": "https://api.github.com/orgs/petercat-ai/events", + "hooks_url": "https://api.github.com/orgs/petercat-ai/hooks", + "issues_url": "https://api.github.com/orgs/petercat-ai/issues", + "members_url": "https://api.github.com/orgs/petercat-ai/members{/member}", + "public_members_url": "https://api.github.com/orgs/petercat-ai/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "description": null + }, + "sender": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 54106016, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTQxMDYwMTY=" + } + } +} \ No newline at end of file diff --git a/server/tests/fixtures/github/events/pull_request/review_submit.json b/server/tests/fixtures/github/events/pull_request/review_submit.json new file mode 100644 index 00000000..db59051b --- /dev/null +++ b/server/tests/fixtures/github/events/pull_request/review_submit.json @@ -0,0 +1,554 @@ +{ + "event": "pull_request_review", + "payload": { + "action": "submitted", + "review": { + "id": 2258685061, + "node_id": "PRR_kwDOKy6oz86GoMyF", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "body": "按上面说的改吧", + "commit_id": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "submitted_at": "2024-08-24T12:19:28Z", + "state": "commented", + "html_url": "https://github.com/petercat-ai/petercat/pull/258#pullrequestreview-2258685061", + "pull_request_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258", + "author_association": "CONTRIBUTOR", + "_links": { + "html": { + "href": "https://github.com/petercat-ai/petercat/pull/258#pullrequestreview-2258685061" + }, + "pull_request": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258" + } + } + }, + "pull_request": { + "url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258", + "id": 2035421682, + "node_id": "PR_kwDOKy6oz855UhHy", + "html_url": "https://github.com/petercat-ai/petercat/pull/258", + "diff_url": "https://github.com/petercat-ai/petercat/pull/258.diff", + "patch_url": "https://github.com/petercat-ai/petercat/pull/258.patch", + "issue_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258", + "number": 258, + "state": "open", + "locked": false, + "title": "Fix/filter robot created issue", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "body": "- 如果 issue 是机器人创建的,也不要评论。", + "created_at": "2024-08-24T12:17:20Z", + "updated_at": "2024-08-24T12:19:28Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "5881a41dc798ed3d1522648b3889a85ed7632abb", + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/commits", + "review_comments_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/comments", + "review_comment_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258/comments", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/cbc002c3a03cc06d2732090caaec9668002b40dd", + "head": { + "label": "petercat-ai:fix/filter-robot-created-issue", + "ref": "fix/filter-robot-created-issue", + "sha": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "user": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": true, + "allow_update_branch": false, + "use_squash_pr_title_as_default": true, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "PR_TITLE", + "merge_commit_message": "PR_BODY", + "merge_commit_title": "PR_TITLE" + } + }, + "base": { + "label": "petercat-ai:main", + "ref": "main", + "sha": "6d1a8ee3ee93ff65009aa3090adae26749933945", + "user": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": true, + "allow_update_branch": false, + "use_squash_pr_title_as_default": true, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "PR_TITLE", + "merge_commit_message": "PR_BODY", + "merge_commit_title": "PR_TITLE" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258" + }, + "html": { + "href": "https://github.com/petercat-ai/petercat/pull/258" + }, + "issue": { + "href": "https://api.github.com/repos/petercat-ai/petercat/issues/258" + }, + "comments": { + "href": "https://api.github.com/repos/petercat-ai/petercat/issues/258/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/petercat-ai/petercat/statuses/cbc002c3a03cc06d2732090caaec9668002b40dd" + } + }, + "author_association": "CONTRIBUTOR", + "auto_merge": null, + "active_lock_reason": null + }, + "repository": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "custom_properties": {} + }, + "organization": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "url": "https://api.github.com/orgs/petercat-ai", + "repos_url": "https://api.github.com/orgs/petercat-ai/repos", + "events_url": "https://api.github.com/orgs/petercat-ai/events", + "hooks_url": "https://api.github.com/orgs/petercat-ai/hooks", + "issues_url": "https://api.github.com/orgs/petercat-ai/issues", + "members_url": "https://api.github.com/orgs/petercat-ai/members{/member}", + "public_members_url": "https://api.github.com/orgs/petercat-ai/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "description": null + }, + "sender": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 54106016, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTQxMDYwMTY=" + } + } +} \ No newline at end of file diff --git a/server/tests/fixtures/github/events/pull_request/review_thread.json b/server/tests/fixtures/github/events/pull_request/review_thread.json new file mode 100644 index 00000000..078b949b --- /dev/null +++ b/server/tests/fixtures/github/events/pull_request/review_thread.json @@ -0,0 +1,635 @@ +{ + "event": "pull_request_review_thread", + "payload": { + "action": "resolved", + "pull_request": { + "url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258", + "id": 2035421682, + "node_id": "PR_kwDOKy6oz855UhHy", + "html_url": "https://github.com/petercat-ai/petercat/pull/258", + "diff_url": "https://github.com/petercat-ai/petercat/pull/258.diff", + "patch_url": "https://github.com/petercat-ai/petercat/pull/258.patch", + "issue_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258", + "number": 258, + "state": "open", + "locked": false, + "title": "Fix/filter robot created issue", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "body": "- 如果 issue 是机器人创建的,也不要评论。", + "created_at": "2024-08-24T12:17:20Z", + "updated_at": "2024-08-24T12:21:20Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "5881a41dc798ed3d1522648b3889a85ed7632abb", + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/commits", + "review_comments_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/comments", + "review_comment_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258/comments", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/cbc002c3a03cc06d2732090caaec9668002b40dd", + "head": { + "label": "petercat-ai:fix/filter-robot-created-issue", + "ref": "fix/filter-robot-created-issue", + "sha": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "user": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main" + } + }, + "base": { + "label": "petercat-ai:main", + "ref": "main", + "sha": "6d1a8ee3ee93ff65009aa3090adae26749933945", + "user": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258" + }, + "html": { + "href": "https://github.com/petercat-ai/petercat/pull/258" + }, + "issue": { + "href": "https://api.github.com/repos/petercat-ai/petercat/issues/258" + }, + "comments": { + "href": "https://api.github.com/repos/petercat-ai/petercat/issues/258/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/petercat-ai/petercat/statuses/cbc002c3a03cc06d2732090caaec9668002b40dd" + } + }, + "author_association": "CONTRIBUTOR", + "auto_merge": null, + "active_lock_reason": null + }, + "thread": { + "node_id": "PRRT_kwDOKy6oz85B6aMb", + "comments": [ + { + "url": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments/1729951181", + "pull_request_review_id": 2258685061, + "id": 1729951181, + "node_id": "PRRC_kwDOKy6oz85nHPXN", + "diff_hunk": "@@ -33,6 +33,9 @@ def get_issue(self) -> Tuple[Issue, Repository]:\n async def execute(self):\n try:\n print(\"actions:\", self.event[\"action\"])\n+ if self.event['sender']['type'] == \"Bot\":\n+ return {\"success\": True}\n+", + "path": "server/event_handler/issue.py", + "commit_id": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "original_commit_id": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "body": "考虑做成通用函数", + "created_at": "2024-08-24T12:19:18Z", + "updated_at": "2024-08-24T12:19:28Z", + "html_url": "https://github.com/petercat-ai/petercat/pull/258#discussion_r1729951181", + "pull_request_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258", + "author_association": "CONTRIBUTOR", + "_links": { + "self": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments/1729951181" + }, + "html": { + "href": "https://github.com/petercat-ai/petercat/pull/258#discussion_r1729951181" + }, + "pull_request": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258" + } + }, + "reactions": { + "url": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments/1729951181/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 38, + "original_line": 38, + "side": "RIGHT", + "original_position": 6, + "position": 6, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments/1729951387", + "pull_request_review_id": 2258685303, + "id": 1729951387, + "node_id": "PRRC_kwDOKy6oz85nHPab", + "diff_hunk": "@@ -33,6 +33,9 @@ def get_issue(self) -> Tuple[Issue, Repository]:\n async def execute(self):\n try:\n print(\"actions:\", self.event[\"action\"])\n+ if self.event['sender']['type'] == \"Bot\":\n+ return {\"success\": True}\n+", + "path": "server/event_handler/issue.py", + "commit_id": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "original_commit_id": "cbc002c3a03cc06d2732090caaec9668002b40dd", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "body": "知道了。但是不想改。", + "created_at": "2024-08-24T12:21:20Z", + "updated_at": "2024-08-24T12:21:20Z", + "html_url": "https://github.com/petercat-ai/petercat/pull/258#discussion_r1729951387", + "pull_request_url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258", + "author_association": "CONTRIBUTOR", + "_links": { + "self": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments/1729951387" + }, + "html": { + "href": "https://github.com/petercat-ai/petercat/pull/258#discussion_r1729951387" + }, + "pull_request": { + "href": "https://api.github.com/repos/petercat-ai/petercat/pulls/258" + } + }, + "reactions": { + "url": "https://api.github.com/repos/petercat-ai/petercat/pulls/comments/1729951387/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 38, + "original_line": 38, + "side": "RIGHT", + "in_reply_to_id": 1729951181, + "original_position": 6, + "position": 6, + "subject_type": "line" + } + ] + }, + "repository": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:16:44Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "custom_properties": {} + }, + "organization": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "url": "https://api.github.com/orgs/petercat-ai", + "repos_url": "https://api.github.com/orgs/petercat-ai/repos", + "events_url": "https://api.github.com/orgs/petercat-ai/events", + "hooks_url": "https://api.github.com/orgs/petercat-ai/hooks", + "issues_url": "https://api.github.com/orgs/petercat-ai/issues", + "members_url": "https://api.github.com/orgs/petercat-ai/members{/member}", + "public_members_url": "https://api.github.com/orgs/petercat-ai/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "description": null + }, + "sender": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 54106016, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTQxMDYwMTY=" + } + } +} \ No newline at end of file From c1900090741bb97f01d5b04ae27da519ea2ba237 Mon Sep 17 00:00:00 2001 From: "raoha.rh" Date: Sat, 24 Aug 2024 20:23:56 +0800 Subject: [PATCH 4/4] feat: add more fixtures --- .../fixtures/github/events/issue/comment.json | 20 +- .../github/events/pull_request/edit.json | 325 ++++++++++++++++++ 2 files changed, 335 insertions(+), 10 deletions(-) create mode 100644 server/tests/fixtures/github/events/pull_request/edit.json diff --git a/server/tests/fixtures/github/events/issue/comment.json b/server/tests/fixtures/github/events/issue/comment.json index f2313a72..504f247d 100644 --- a/server/tests/fixtures/github/events/issue/comment.json +++ b/server/tests/fixtures/github/events/issue/comment.json @@ -39,9 +39,9 @@ "assignee": null, "assignees": [], "milestone": null, - "comments": 1, + "comments": 2, "created_at": "2024-08-24T12:02:40Z", - "updated_at": "2024-08-24T12:03:57Z", + "updated_at": "2024-08-24T12:13:47Z", "closed_at": null, "author_association": "NONE", "active_lock_reason": null, @@ -63,11 +63,11 @@ "state_reason": null }, "comment": { - "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308371015", - "html_url": "https://github.com/petercat-ai/demo/issues/33#issuecomment-2308371015", + "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308374057", + "html_url": "https://github.com/petercat-ai/demo/issues/33#issuecomment-2308374057", "issue_url": "https://api.github.com/repos/petercat-ai/demo/issues/33", - "id": 2308371015, - "node_id": "IC_kwDOMl4Nsc6JlvJH", + "id": 2308374057, + "node_id": "IC_kwDOMl4Nsc6Jlv4p", "user": { "login": "RaoHai", "id": 566097, @@ -88,12 +88,12 @@ "type": "User", "site_admin": false }, - "created_at": "2024-08-24T12:03:56Z", - "updated_at": "2024-08-24T12:03:56Z", + "created_at": "2024-08-24T12:13:46Z", + "updated_at": "2024-08-24T12:13:46Z", "author_association": "NONE", - "body": "这是普通的评论", + "body": "这是 at 了人的评论 @RaoHai ", "reactions": { - "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308371015/reactions", + "url": "https://api.github.com/repos/petercat-ai/demo/issues/comments/2308374057/reactions", "total_count": 0, "+1": 0, "-1": 0, diff --git a/server/tests/fixtures/github/events/pull_request/edit.json b/server/tests/fixtures/github/events/pull_request/edit.json new file mode 100644 index 00000000..0d13a3c0 --- /dev/null +++ b/server/tests/fixtures/github/events/pull_request/edit.json @@ -0,0 +1,325 @@ +{ + "event": "issue_comment", + "payload": { + "action": "edited", + "changes": { + "body": { + "from": "[vc]: #GbkWlt4N+g7/i39gPqxh54mvq1UiEJjEmO0KMpGBJyE=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJwZXRlcmNhdCIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9wZXRlcmNhdC1haS9wZXRlcmNhdC9YUFA4Z3p0c3A4U0c3V3ZacEZvcWlYZEpaeFlFIiwicHJldmlld1VybCI6InBldGVyY2F0LWdpdC1maXgtZmlsdGVyLXJvYm90LWNyZWF0ZWQtaXNzdWUtcGV0ZXJjYXQtYWkudmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJERVBMT1lFRCIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJwZXRlcmNhdC1naXQtZml4LWZpbHRlci1yb2JvdC1jcmVhdGVkLWlzc3VlLXBldGVyY2F0LWFpLnZlcmNlbC5hcHAifSwicm9vdERpcmVjdG9yeSI6ImNsaWVudCJ9XX0=\n**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)\n\n| Name | Status | Preview | Comments | Updated (UTC) |\n| :--- | :----- | :------ | :------- | :------ |\n| **petercat** | ✅ Ready ([Inspect](https://vercel.com/petercat-ai/petercat/XPP8gztsp8SG7WvZpFoqiXdJZxYE)) | [Visit Preview](https://vercel.live/open-feedback/petercat-git-fix-filter-robot-created-issue-petercat-ai.vercel.app?via=pr-comment-visit-preview-link&passThrough=1) | 💬 [**Add feedback**](https://vercel.live/open-feedback/petercat-git-fix-filter-robot-created-issue-petercat-ai.vercel.app?via=pr-comment-feedback-link) | Aug 24, 2024 0:18am |\n\n" + } + }, + "issue": { + "url": "https://api.github.com/repos/petercat-ai/petercat/issues/258", + "repository_url": "https://api.github.com/repos/petercat-ai/petercat", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258/labels{/name}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258/comments", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258/events", + "html_url": "https://github.com/petercat-ai/petercat/pull/258", + "id": 2484547567, + "node_id": "PR_kwDOKy6oz855UhHy", + "number": 258, + "title": "Fix/filter robot created issue", + "user": { + "login": "RaoHai", + "id": 566097, + "node_id": "MDQ6VXNlcjU2NjA5Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/566097?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/RaoHai", + "html_url": "https://github.com/RaoHai", + "followers_url": "https://api.github.com/users/RaoHai/followers", + "following_url": "https://api.github.com/users/RaoHai/following{/other_user}", + "gists_url": "https://api.github.com/users/RaoHai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/RaoHai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/RaoHai/subscriptions", + "organizations_url": "https://api.github.com/users/RaoHai/orgs", + "repos_url": "https://api.github.com/users/RaoHai/repos", + "events_url": "https://api.github.com/users/RaoHai/events{/privacy}", + "received_events_url": "https://api.github.com/users/RaoHai/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 2, + "created_at": "2024-08-24T12:17:20Z", + "updated_at": "2024-08-24T12:23:13Z", + "closed_at": null, + "author_association": "CONTRIBUTOR", + "active_lock_reason": null, + "draft": false, + "pull_request": { + "url": "https://api.github.com/repos/petercat-ai/petercat/pulls/258", + "html_url": "https://github.com/petercat-ai/petercat/pull/258", + "diff_url": "https://github.com/petercat-ai/petercat/pull/258.diff", + "patch_url": "https://github.com/petercat-ai/petercat/pull/258.patch", + "merged_at": null + }, + "body": "- 如果 issue 是机器人创建的,也不要评论。", + "reactions": { + "url": "https://api.github.com/repos/petercat-ai/petercat/issues/258/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258/timeline", + "performed_via_github_app": null, + "state_reason": null + }, + "comment": { + "url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments/2308375096", + "html_url": "https://github.com/petercat-ai/petercat/pull/258#issuecomment-2308375096", + "issue_url": "https://api.github.com/repos/petercat-ai/petercat/issues/258", + "id": 2308375096, + "node_id": "IC_kwDOKy6oz86JlwI4", + "user": { + "login": "vercel[bot]", + "id": 35613825, + "node_id": "MDM6Qm90MzU2MTM4MjU=", + "avatar_url": "https://avatars.githubusercontent.com/in/8329?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vercel%5Bbot%5D", + "html_url": "https://github.com/apps/vercel", + "followers_url": "https://api.github.com/users/vercel%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/vercel%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/vercel%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vercel%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vercel%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/vercel%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/vercel%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/vercel%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/vercel%5Bbot%5D/received_events", + "type": "Bot", + "site_admin": false + }, + "created_at": "2024-08-24T12:17:24Z", + "updated_at": "2024-08-24T12:23:13Z", + "author_association": "NONE", + "body": "[vc]: #xyq5jn1ng//YmvrzNsEcF6a7PlYOGxa380LHtY6Bzqw=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJwZXRlcmNhdCIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9wZXRlcmNhdC1haS9wZXRlcmNhdC81a25xRG5iYmZFd3I4Y05kdk1lMXRkVnhUNUhKIiwicHJldmlld1VybCI6InBldGVyY2F0LWdpdC1maXgtZmlsdGVyLXJvYm90LWNyZWF0ZWQtaXNzdWUtcGV0ZXJjYXQtYWkudmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJQRU5ESU5HIiwibGl2ZUZlZWRiYWNrIjp7InJlc29sdmVkIjowLCJ1bnJlc29sdmVkIjowLCJ0b3RhbCI6MCwibGluayI6InBldGVyY2F0LWdpdC1maXgtZmlsdGVyLXJvYm90LWNyZWF0ZWQtaXNzdWUtcGV0ZXJjYXQtYWkudmVyY2VsLmFwcCJ9LCJyb290RGlyZWN0b3J5IjoiY2xpZW50In1dfQ==\n**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)\n\n| Name | Status | Preview | Comments | Updated (UTC) |\n| :--- | :----- | :------ | :------- | :------ |\n| **petercat** | 🔄 Building ([Inspect](https://vercel.com/petercat-ai/petercat/5knqDnbbfEwr8cNdvMe1tdVxT5HJ)) | [Visit Preview](https://vercel.live/open-feedback/petercat-git-fix-filter-robot-created-issue-petercat-ai.vercel.app?via=pr-comment-visit-preview-link&passThrough=1) | 💬 [**Add feedback**](https://vercel.live/open-feedback/petercat-git-fix-filter-robot-created-issue-petercat-ai.vercel.app?via=pr-comment-feedback-link) | Aug 24, 2024 0:23am |\n\n", + "reactions": { + "url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments/2308375096/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": { + "id": 8329, + "client_id": "Iv1.9d7d662ea00b8481", + "slug": "vercel", + "node_id": "MDM6QXBwODMyOQ==", + "owner": { + "login": "vercel", + "id": 14985020, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjE0OTg1MDIw", + "avatar_url": "https://avatars.githubusercontent.com/u/14985020?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vercel", + "html_url": "https://github.com/vercel", + "followers_url": "https://api.github.com/users/vercel/followers", + "following_url": "https://api.github.com/users/vercel/following{/other_user}", + "gists_url": "https://api.github.com/users/vercel/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vercel/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vercel/subscriptions", + "organizations_url": "https://api.github.com/users/vercel/orgs", + "repos_url": "https://api.github.com/users/vercel/repos", + "events_url": "https://api.github.com/users/vercel/events{/privacy}", + "received_events_url": "https://api.github.com/users/vercel/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "Vercel", + "description": "Vercel for GitHub automatically deploys your PRs to Vercel.\r\nPreview every PR live, without any configuration required.\r\n\r\nFor more information, see our [documentation](https://vercel.com/docs/github?utm_source=github&utm_medium=marketplace&utm_campaign=vercel-app).\r\n\r\n![](https://assets.vercel.com/image/upload/v1597943727/front/github/github-comment-monorepo.png)", + "external_url": "https://vercel.com/github", + "html_url": "https://github.com/apps/vercel", + "created_at": "2018-01-19T21:51:06Z", + "updated_at": "2024-04-09T21:33:15Z", + "permissions": { + "administration": "write", + "checks": "write", + "contents": "write", + "deployments": "write", + "emails": "read", + "issues": "write", + "members": "read", + "metadata": "read", + "pull_requests": "write", + "repository_hooks": "write", + "statuses": "write" + }, + "events": [ + "branch_protection_rule", + "check_run", + "deployment", + "membership", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "push", + "repository", + "status", + "team" + ] + } + }, + "repository": { + "id": 724478159, + "node_id": "R_kgDOKy6ozw", + "name": "petercat", + "full_name": "petercat-ai/petercat", + "private": true, + "owner": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/petercat-ai", + "html_url": "https://github.com/petercat-ai", + "followers_url": "https://api.github.com/users/petercat-ai/followers", + "following_url": "https://api.github.com/users/petercat-ai/following{/other_user}", + "gists_url": "https://api.github.com/users/petercat-ai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/petercat-ai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/petercat-ai/subscriptions", + "organizations_url": "https://api.github.com/users/petercat-ai/orgs", + "repos_url": "https://api.github.com/users/petercat-ai/repos", + "events_url": "https://api.github.com/users/petercat-ai/events{/privacy}", + "received_events_url": "https://api.github.com/users/petercat-ai/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/petercat-ai/petercat", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/petercat-ai/petercat", + "forks_url": "https://api.github.com/repos/petercat-ai/petercat/forks", + "keys_url": "https://api.github.com/repos/petercat-ai/petercat/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/petercat-ai/petercat/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/petercat-ai/petercat/teams", + "hooks_url": "https://api.github.com/repos/petercat-ai/petercat/hooks", + "issue_events_url": "https://api.github.com/repos/petercat-ai/petercat/issues/events{/number}", + "events_url": "https://api.github.com/repos/petercat-ai/petercat/events", + "assignees_url": "https://api.github.com/repos/petercat-ai/petercat/assignees{/user}", + "branches_url": "https://api.github.com/repos/petercat-ai/petercat/branches{/branch}", + "tags_url": "https://api.github.com/repos/petercat-ai/petercat/tags", + "blobs_url": "https://api.github.com/repos/petercat-ai/petercat/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/petercat-ai/petercat/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/petercat-ai/petercat/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/petercat-ai/petercat/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/petercat-ai/petercat/statuses/{sha}", + "languages_url": "https://api.github.com/repos/petercat-ai/petercat/languages", + "stargazers_url": "https://api.github.com/repos/petercat-ai/petercat/stargazers", + "contributors_url": "https://api.github.com/repos/petercat-ai/petercat/contributors", + "subscribers_url": "https://api.github.com/repos/petercat-ai/petercat/subscribers", + "subscription_url": "https://api.github.com/repos/petercat-ai/petercat/subscription", + "commits_url": "https://api.github.com/repos/petercat-ai/petercat/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/petercat-ai/petercat/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/petercat-ai/petercat/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/petercat-ai/petercat/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/petercat-ai/petercat/contents/{+path}", + "compare_url": "https://api.github.com/repos/petercat-ai/petercat/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/petercat-ai/petercat/merges", + "archive_url": "https://api.github.com/repos/petercat-ai/petercat/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/petercat-ai/petercat/downloads", + "issues_url": "https://api.github.com/repos/petercat-ai/petercat/issues{/number}", + "pulls_url": "https://api.github.com/repos/petercat-ai/petercat/pulls{/number}", + "milestones_url": "https://api.github.com/repos/petercat-ai/petercat/milestones{/number}", + "notifications_url": "https://api.github.com/repos/petercat-ai/petercat/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/petercat-ai/petercat/labels{/name}", + "releases_url": "https://api.github.com/repos/petercat-ai/petercat/releases{/id}", + "deployments_url": "https://api.github.com/repos/petercat-ai/petercat/deployments", + "created_at": "2023-11-28T06:46:41Z", + "updated_at": "2024-08-24T06:42:00Z", + "pushed_at": "2024-08-24T12:23:10Z", + "git_url": "git://github.com/petercat-ai/petercat.git", + "ssh_url": "git@github.com:petercat-ai/petercat.git", + "clone_url": "https://github.com/petercat-ai/petercat.git", + "svn_url": "https://github.com/petercat-ai/petercat", + "homepage": "https://www.petercat.chat/", + "size": 28857, + "stargazers_count": 3, + "watchers_count": 3, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 6, + "watchers": 3, + "default_branch": "main", + "custom_properties": {} + }, + "organization": { + "login": "petercat-ai", + "id": 169796403, + "node_id": "O_kgDOCh7jMw", + "url": "https://api.github.com/orgs/petercat-ai", + "repos_url": "https://api.github.com/orgs/petercat-ai/repos", + "events_url": "https://api.github.com/orgs/petercat-ai/events", + "hooks_url": "https://api.github.com/orgs/petercat-ai/hooks", + "issues_url": "https://api.github.com/orgs/petercat-ai/issues", + "members_url": "https://api.github.com/orgs/petercat-ai/members{/member}", + "public_members_url": "https://api.github.com/orgs/petercat-ai/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/169796403?v=4", + "description": null + }, + "sender": { + "login": "vercel[bot]", + "id": 35613825, + "node_id": "MDM6Qm90MzU2MTM4MjU=", + "avatar_url": "https://avatars.githubusercontent.com/in/8329?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vercel%5Bbot%5D", + "html_url": "https://github.com/apps/vercel", + "followers_url": "https://api.github.com/users/vercel%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/vercel%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/vercel%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vercel%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vercel%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/vercel%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/vercel%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/vercel%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/vercel%5Bbot%5D/received_events", + "type": "Bot", + "site_admin": false + }, + "installation": { + "id": 54106016, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTQxMDYwMTY=" + } + } +} \ No newline at end of file