mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
integrations: Add Gitea integration.
Gitea integration adopted from Gogs integration with minor adjusting. More events are now handled. Fixes #13346
This commit is contained in:
BIN
static/images/integrations/gitea/001.png
Normal file
BIN
static/images/integrations/gitea/001.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
static/images/integrations/logos/gitea.png
Normal file
BIN
static/images/integrations/logos/gitea.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
@@ -273,6 +273,7 @@ WEBHOOK_INTEGRATIONS = [
|
||||
WebhookIntegration('flock', ['customer-support'], display_name='Flock'),
|
||||
WebhookIntegration('freshdesk', ['customer-support']),
|
||||
WebhookIntegration('front', ['customer-support'], display_name='Front'),
|
||||
WebhookIntegration('gitea', ['version-control'], stream_name='commits'),
|
||||
WebhookIntegration(
|
||||
'github',
|
||||
['version-control'],
|
||||
|
0
zerver/webhooks/gitea/__init__.py
Normal file
0
zerver/webhooks/gitea/__init__.py
Normal file
19
zerver/webhooks/gitea/doc.md
Normal file
19
zerver/webhooks/gitea/doc.md
Normal file
@@ -0,0 +1,19 @@
|
||||
Receive Gitea notifications in Zulip!
|
||||
|
||||
1. {!create-stream.md!}
|
||||
|
||||
1. {!create-bot-construct-url-indented.md!}
|
||||
|
||||
{!git-webhook-url-with-branches-indented.md!}
|
||||
|
||||
1. Go to your repository on Gitea and click on **Settings**. Select
|
||||
**Webhooks** on the left sidebar, and click **Add Webhook**.
|
||||
Select **Gitea**.
|
||||
|
||||
1. Set **Payload URL** to the URL constructed above. Set **Content type**
|
||||
to `application/json`. Select the events you would like to receive
|
||||
notifications for, and click **Add Webhook**.
|
||||
|
||||
{!congrats.md!}
|
||||
|
||||

|
75
zerver/webhooks/gitea/fixtures/create__branch.json
Normal file
75
zerver/webhooks/gitea/fixtures/create__branch.json
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"sha": "01efc1fe09d4fba25397a386a6c623fd12eadd79",
|
||||
"ref": "test-branch",
|
||||
"ref_type": "branch",
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:11:14Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
}
|
163
zerver/webhooks/gitea/fixtures/issue_comment__edited.json
Normal file
163
zerver/webhooks/gitea/fixtures/issue_comment__edited.json
Normal file
@@ -0,0 +1,163 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "edited",
|
||||
"issue": {
|
||||
"id": 8184,
|
||||
"url": "https://try.gitea.io/api/v1/repos/kostekIV/test/issues/3",
|
||||
"number": 3,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"original_author": "",
|
||||
"original_author_id": 0,
|
||||
"title": "Test issue 2",
|
||||
"body": "Test body",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"assignees": [
|
||||
{
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
],
|
||||
"state": "open",
|
||||
"comments": 4,
|
||||
"created_at": "2019-11-17T23:45:03Z",
|
||||
"updated_at": "2019-11-18T01:21:56Z",
|
||||
"closed_at": null,
|
||||
"due_date": null,
|
||||
"pull_request": null,
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test"
|
||||
}
|
||||
},
|
||||
"comment": {
|
||||
"id": 24400,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test/issues/3#issuecomment-24400",
|
||||
"pull_request_url": "",
|
||||
"issue_url": "https://try.gitea.io/kostekIV/test/issues/3",
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"original_author": "",
|
||||
"original_author_id": 0,
|
||||
"body": "edit test comment",
|
||||
"created_at": "2019-11-17T23:45:10Z",
|
||||
"updated_at": "2019-11-18T02:44:09Z"
|
||||
},
|
||||
"changes": {
|
||||
"body": {
|
||||
"from": "test comment\r\n"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 66,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 1,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 1,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T01:55:57Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"is_pull": false
|
||||
}
|
137
zerver/webhooks/gitea/fixtures/issue_comment__in_pr.json
Normal file
137
zerver/webhooks/gitea/fixtures/issue_comment__in_pr.json
Normal file
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "created",
|
||||
"issue": {
|
||||
"id": 8170,
|
||||
"url": "https://try.gitea.io/api/v1/repos/kostekIV/test/issues/1",
|
||||
"number": 1,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"original_author": "",
|
||||
"original_author_id": 0,
|
||||
"title": "dummy",
|
||||
"body": "sdfasdfa",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": null,
|
||||
"assignees": null,
|
||||
"state": "closed",
|
||||
"comments": 0,
|
||||
"created_at": "2019-11-15T20:56:14Z",
|
||||
"updated_at": "2019-11-15T21:01:32Z",
|
||||
"closed_at": "2019-11-15T21:01:26Z",
|
||||
"due_date": null,
|
||||
"pull_request": {
|
||||
"merged": true,
|
||||
"merged_at": "2019-11-15T21:01:26Z"
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test"
|
||||
}
|
||||
},
|
||||
"comment": {
|
||||
"id": 24399,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test/pulls/1/files#issuecomment-24399",
|
||||
"pull_request_url": "https://try.gitea.io/kostekIV/test/pulls/1",
|
||||
"issue_url": "",
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"original_author": "",
|
||||
"original_author_id": 0,
|
||||
"body": "test comment",
|
||||
"created_at": "2019-11-17T23:24:44Z",
|
||||
"updated_at": "2019-11-17T23:24:44Z"
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-17T21:35:13Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"is_pull": true
|
||||
}
|
134
zerver/webhooks/gitea/fixtures/issue_comment__new.json
Normal file
134
zerver/webhooks/gitea/fixtures/issue_comment__new.json
Normal file
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "created",
|
||||
"issue": {
|
||||
"id": 8184,
|
||||
"url": "https://try.gitea.io/api/v1/repos/kostekIV/test/issues/3",
|
||||
"number": 3,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"original_author": "",
|
||||
"original_author_id": 0,
|
||||
"title": "Test issue",
|
||||
"body": "Test body",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": null,
|
||||
"assignees": null,
|
||||
"state": "open",
|
||||
"comments": 0,
|
||||
"created_at": "2019-11-17T23:45:03Z",
|
||||
"updated_at": "2019-11-17T23:45:10Z",
|
||||
"closed_at": null,
|
||||
"due_date": null,
|
||||
"pull_request": null,
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test"
|
||||
}
|
||||
},
|
||||
"comment": {
|
||||
"id": 24400,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test/issues/3#issuecomment-24400",
|
||||
"pull_request_url": "",
|
||||
"issue_url": "https://try.gitea.io/kostekIV/test/issues/3",
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"original_author": "",
|
||||
"original_author_id": 0,
|
||||
"body": "test comment",
|
||||
"created_at": "2019-11-17T23:45:10Z",
|
||||
"updated_at": "2019-11-17T23:45:10Z"
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 1,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-17T21:35:13Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"is_pull": false
|
||||
}
|
135
zerver/webhooks/gitea/fixtures/issues__assigned.json
Normal file
135
zerver/webhooks/gitea/fixtures/issues__assigned.json
Normal file
@@ -0,0 +1,135 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "assigned",
|
||||
"number": 3,
|
||||
"issue": {
|
||||
"id": 8184,
|
||||
"url": "https://try.gitea.io/api/v1/repos/kostekIV/test/issues/3",
|
||||
"number": 3,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"original_author": "",
|
||||
"original_author_id": 0,
|
||||
"title": "Test issue",
|
||||
"body": "Test body",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"assignees": [
|
||||
{
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
],
|
||||
"state": "open",
|
||||
"comments": 1,
|
||||
"created_at": "2019-11-17T23:45:03Z",
|
||||
"updated_at": "2019-11-18T00:01:30Z",
|
||||
"closed_at": null,
|
||||
"due_date": null,
|
||||
"pull_request": null,
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 1,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-17T21:35:13Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
}
|
135
zerver/webhooks/gitea/fixtures/issues__closed.json
Normal file
135
zerver/webhooks/gitea/fixtures/issues__closed.json
Normal file
@@ -0,0 +1,135 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "closed",
|
||||
"number": 3,
|
||||
"issue": {
|
||||
"id": 8184,
|
||||
"url": "https://try.gitea.io/api/v1/repos/kostekIV/test/issues/3",
|
||||
"number": 3,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"original_author": "",
|
||||
"original_author_id": 0,
|
||||
"title": "Test issue 2",
|
||||
"body": "Test body",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"assignees": [
|
||||
{
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
],
|
||||
"state": "closed",
|
||||
"comments": 1,
|
||||
"created_at": "2019-11-17T23:45:03Z",
|
||||
"updated_at": "2019-11-18T00:08:27Z",
|
||||
"closed_at": "2019-11-18T00:08:27Z",
|
||||
"due_date": null,
|
||||
"pull_request": null,
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 1,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-17T21:35:13Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
}
|
140
zerver/webhooks/gitea/fixtures/issues__edited.json
Normal file
140
zerver/webhooks/gitea/fixtures/issues__edited.json
Normal file
@@ -0,0 +1,140 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "edited",
|
||||
"number": 3,
|
||||
"changes": {
|
||||
"title": {
|
||||
"from": "Test issue"
|
||||
}
|
||||
},
|
||||
"issue": {
|
||||
"id": 8184,
|
||||
"url": "https://try.gitea.io/api/v1/repos/kostekIV/test/issues/3",
|
||||
"number": 3,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"original_author": "",
|
||||
"original_author_id": 0,
|
||||
"title": "Test issue 2",
|
||||
"body": "Test body",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"assignees": [
|
||||
{
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
],
|
||||
"state": "open",
|
||||
"comments": 1,
|
||||
"created_at": "2019-11-17T23:45:03Z",
|
||||
"updated_at": "2019-11-18T00:06:07Z",
|
||||
"closed_at": null,
|
||||
"due_date": null,
|
||||
"pull_request": null,
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 1,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-17T21:35:13Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
}
|
111
zerver/webhooks/gitea/fixtures/issues__opened.json
Normal file
111
zerver/webhooks/gitea/fixtures/issues__opened.json
Normal file
@@ -0,0 +1,111 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "opened",
|
||||
"number": 3,
|
||||
"issue": {
|
||||
"id": 8184,
|
||||
"url": "https://try.gitea.io/api/v1/repos/kostekIV/test/issues/3",
|
||||
"number": 3,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"original_author": "",
|
||||
"original_author_id": 0,
|
||||
"title": "Test issue",
|
||||
"body": "Test body",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": null,
|
||||
"assignees": null,
|
||||
"state": "open",
|
||||
"comments": 0,
|
||||
"created_at": "2019-11-17T23:45:03Z",
|
||||
"updated_at": "2019-11-17T23:45:03Z",
|
||||
"closed_at": null,
|
||||
"due_date": null,
|
||||
"pull_request": null,
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 1,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-17T21:35:13Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
}
|
135
zerver/webhooks/gitea/fixtures/issues__reopened.json
Normal file
135
zerver/webhooks/gitea/fixtures/issues__reopened.json
Normal file
@@ -0,0 +1,135 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "reopened",
|
||||
"number": 3,
|
||||
"issue": {
|
||||
"id": 8184,
|
||||
"url": "https://try.gitea.io/api/v1/repos/kostekIV/test/issues/3",
|
||||
"number": 3,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"original_author": "",
|
||||
"original_author_id": 0,
|
||||
"title": "Test issue 2",
|
||||
"body": "Test body",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"assignees": [
|
||||
{
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
],
|
||||
"state": "open",
|
||||
"comments": 2,
|
||||
"created_at": "2019-11-17T23:45:03Z",
|
||||
"updated_at": "2019-11-18T00:42:36Z",
|
||||
"closed_at": null,
|
||||
"due_date": null,
|
||||
"pull_request": null,
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:32:22Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
}
|
263
zerver/webhooks/gitea/fixtures/pull_request__assigned.json
Normal file
263
zerver/webhooks/gitea/fixtures/pull_request__assigned.json
Normal file
@@ -0,0 +1,263 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "assigned",
|
||||
"number": 5,
|
||||
"pull_request": {
|
||||
"id": 1906,
|
||||
"url": "https://try.gitea.io/kostekIV/test/pulls/5",
|
||||
"number": 5,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"title": "test 2",
|
||||
"body": "test",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"assignees": [
|
||||
{
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
],
|
||||
"state": "open",
|
||||
"comments": 1,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test/pulls/5",
|
||||
"diff_url": "https://try.gitea.io/kostekIV/test/pulls/5.diff",
|
||||
"patch_url": "https://try.gitea.io/kostekIV/test/pulls/5.patch",
|
||||
"mergeable": false,
|
||||
"merged": false,
|
||||
"merged_at": null,
|
||||
"merge_commit_sha": null,
|
||||
"merged_by": null,
|
||||
"base": {
|
||||
"label": "master",
|
||||
"ref": "master",
|
||||
"sha": "1d40c3be7919f066f9158eaaaecaf696b3e22886",
|
||||
"repo_id": 14576,
|
||||
"repo": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:32:22Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
}
|
||||
},
|
||||
"head": {
|
||||
"label": "d",
|
||||
"ref": "d",
|
||||
"sha": "40f7d3050bdc11085e00518a1356150e5fff512d",
|
||||
"repo_id": 14576,
|
||||
"repo": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:32:22Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
}
|
||||
},
|
||||
"merge_base": "50a822293e4dda7fdc1ecb6e61f7da62345b7fce",
|
||||
"due_date": null,
|
||||
"created_at": "2019-11-18T00:26:08Z",
|
||||
"updated_at": "2019-11-18T00:35:13Z",
|
||||
"closed_at": null
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:32:22Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"review": null
|
||||
}
|
239
zerver/webhooks/gitea/fixtures/pull_request__closed.json
Normal file
239
zerver/webhooks/gitea/fixtures/pull_request__closed.json
Normal file
@@ -0,0 +1,239 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "closed",
|
||||
"number": 5,
|
||||
"pull_request": {
|
||||
"id": 1906,
|
||||
"url": "https://try.gitea.io/kostekIV/test/pulls/5",
|
||||
"number": 5,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"title": "test 2",
|
||||
"body": "test",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": null,
|
||||
"assignees": null,
|
||||
"state": "closed",
|
||||
"comments": 0,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test/pulls/5",
|
||||
"diff_url": "https://try.gitea.io/kostekIV/test/pulls/5.diff",
|
||||
"patch_url": "https://try.gitea.io/kostekIV/test/pulls/5.patch",
|
||||
"mergeable": true,
|
||||
"merged": false,
|
||||
"merged_at": null,
|
||||
"merge_commit_sha": null,
|
||||
"merged_by": null,
|
||||
"base": {
|
||||
"label": "master",
|
||||
"ref": "master",
|
||||
"sha": "1d40c3be7919f066f9158eaaaecaf696b3e22886",
|
||||
"repo_id": 14576,
|
||||
"repo": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:22:27Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
}
|
||||
},
|
||||
"head": {
|
||||
"label": "d",
|
||||
"ref": "d",
|
||||
"sha": "06902b147a01a3fc0e7c23caf5548e242300e553",
|
||||
"repo_id": 14576,
|
||||
"repo": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:22:27Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
}
|
||||
},
|
||||
"merge_base": "50a822293e4dda7fdc1ecb6e61f7da62345b7fce",
|
||||
"due_date": null,
|
||||
"created_at": "2019-11-18T00:26:08Z",
|
||||
"updated_at": "2019-11-18T00:28:29Z",
|
||||
"closed_at": null
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:22:27Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"review": null
|
||||
}
|
244
zerver/webhooks/gitea/fixtures/pull_request__edited.json
Normal file
244
zerver/webhooks/gitea/fixtures/pull_request__edited.json
Normal file
@@ -0,0 +1,244 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "edited",
|
||||
"number": 5,
|
||||
"changes": {
|
||||
"title": {
|
||||
"from": "test"
|
||||
}
|
||||
},
|
||||
"pull_request": {
|
||||
"id": 1906,
|
||||
"url": "https://try.gitea.io/kostekIV/test/pulls/5",
|
||||
"number": 5,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"title": "test 2",
|
||||
"body": "test",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": null,
|
||||
"assignees": null,
|
||||
"state": "open",
|
||||
"comments": 0,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test/pulls/5",
|
||||
"diff_url": "https://try.gitea.io/kostekIV/test/pulls/5.diff",
|
||||
"patch_url": "https://try.gitea.io/kostekIV/test/pulls/5.patch",
|
||||
"mergeable": true,
|
||||
"merged": false,
|
||||
"merged_at": null,
|
||||
"merge_commit_sha": null,
|
||||
"merged_by": null,
|
||||
"base": {
|
||||
"label": "master",
|
||||
"ref": "master",
|
||||
"sha": "1d40c3be7919f066f9158eaaaecaf696b3e22886",
|
||||
"repo_id": 14576,
|
||||
"repo": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:22:27Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
}
|
||||
},
|
||||
"head": {
|
||||
"label": "d",
|
||||
"ref": "d",
|
||||
"sha": "06902b147a01a3fc0e7c23caf5548e242300e553",
|
||||
"repo_id": 14576,
|
||||
"repo": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:22:27Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
}
|
||||
},
|
||||
"merge_base": "50a822293e4dda7fdc1ecb6e61f7da62345b7fce",
|
||||
"due_date": null,
|
||||
"created_at": "2019-11-18T00:26:08Z",
|
||||
"updated_at": "2019-11-18T00:26:33Z",
|
||||
"closed_at": null
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:22:27Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"review": null
|
||||
}
|
250
zerver/webhooks/gitea/fixtures/pull_request__merged.json
Normal file
250
zerver/webhooks/gitea/fixtures/pull_request__merged.json
Normal file
@@ -0,0 +1,250 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "closed",
|
||||
"number": 4,
|
||||
"pull_request": {
|
||||
"id": 1905,
|
||||
"url": "https://try.gitea.io/kostekIV/test/pulls/4",
|
||||
"number": 4,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"title": "New pr",
|
||||
"body": "Body",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": null,
|
||||
"assignees": null,
|
||||
"state": "closed",
|
||||
"comments": 1,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test/pulls/4",
|
||||
"diff_url": "https://try.gitea.io/kostekIV/test/pulls/4.diff",
|
||||
"patch_url": "https://try.gitea.io/kostekIV/test/pulls/4.patch",
|
||||
"mergeable": true,
|
||||
"merged": true,
|
||||
"merged_at": "2019-11-18T00:22:27Z",
|
||||
"merge_commit_sha": "1d40c3be7919f066f9158eaaaecaf696b3e22886",
|
||||
"merged_by": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"base": {
|
||||
"label": "master",
|
||||
"ref": "master",
|
||||
"sha": "1d40c3be7919f066f9158eaaaecaf696b3e22886",
|
||||
"repo_id": 14576,
|
||||
"repo": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:11:14Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
}
|
||||
},
|
||||
"head": {
|
||||
"label": "test-branch",
|
||||
"ref": "test-branch",
|
||||
"sha": "01efc1fe09d4fba25397a386a6c623fd12eadd79",
|
||||
"repo_id": 14576,
|
||||
"repo": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:11:14Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
}
|
||||
},
|
||||
"merge_base": "50a822293e4dda7fdc1ecb6e61f7da62345b7fce",
|
||||
"due_date": null,
|
||||
"created_at": "2019-11-18T00:16:29Z",
|
||||
"updated_at": "2019-11-18T00:22:27Z",
|
||||
"closed_at": null
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:11:14Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"review": null
|
||||
}
|
239
zerver/webhooks/gitea/fixtures/pull_request__opened.json
Normal file
239
zerver/webhooks/gitea/fixtures/pull_request__opened.json
Normal file
@@ -0,0 +1,239 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "opened",
|
||||
"number": 4,
|
||||
"pull_request": {
|
||||
"id": 1905,
|
||||
"url": "https://try.gitea.io/kostekIV/test/pulls/4",
|
||||
"number": 4,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"title": "New pr",
|
||||
"body": "Body",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": null,
|
||||
"assignees": null,
|
||||
"state": "open",
|
||||
"comments": 0,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test/pulls/4",
|
||||
"diff_url": "https://try.gitea.io/kostekIV/test/pulls/4.diff",
|
||||
"patch_url": "https://try.gitea.io/kostekIV/test/pulls/4.patch",
|
||||
"mergeable": true,
|
||||
"merged": false,
|
||||
"merged_at": null,
|
||||
"merge_commit_sha": null,
|
||||
"merged_by": null,
|
||||
"base": {
|
||||
"label": "master",
|
||||
"ref": "master",
|
||||
"sha": "df5c4968af6569095b40fa8f756953072d03d39f",
|
||||
"repo_id": 14576,
|
||||
"repo": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:11:14Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
}
|
||||
},
|
||||
"head": {
|
||||
"label": "test-branch",
|
||||
"ref": "test-branch",
|
||||
"sha": "01efc1fe09d4fba25397a386a6c623fd12eadd79",
|
||||
"repo_id": 14576,
|
||||
"repo": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:11:14Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
}
|
||||
},
|
||||
"merge_base": "50a822293e4dda7fdc1ecb6e61f7da62345b7fce",
|
||||
"due_date": null,
|
||||
"created_at": "2019-11-18T00:16:29Z",
|
||||
"updated_at": "2019-11-18T00:16:29Z",
|
||||
"closed_at": null
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 18,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:11:14Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"review": null
|
||||
}
|
239
zerver/webhooks/gitea/fixtures/pull_request__reopened.json
Normal file
239
zerver/webhooks/gitea/fixtures/pull_request__reopened.json
Normal file
@@ -0,0 +1,239 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"action": "reopened",
|
||||
"number": 5,
|
||||
"pull_request": {
|
||||
"id": 1906,
|
||||
"url": "https://try.gitea.io/kostekIV/test/pulls/5",
|
||||
"number": 5,
|
||||
"user": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"title": "test 2",
|
||||
"body": "test",
|
||||
"labels": [],
|
||||
"milestone": null,
|
||||
"assignee": null,
|
||||
"assignees": null,
|
||||
"state": "open",
|
||||
"comments": 1,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test/pulls/5",
|
||||
"diff_url": "https://try.gitea.io/kostekIV/test/pulls/5.diff",
|
||||
"patch_url": "https://try.gitea.io/kostekIV/test/pulls/5.patch",
|
||||
"mergeable": false,
|
||||
"merged": false,
|
||||
"merged_at": null,
|
||||
"merge_commit_sha": null,
|
||||
"merged_by": null,
|
||||
"base": {
|
||||
"label": "master",
|
||||
"ref": "master",
|
||||
"sha": "1d40c3be7919f066f9158eaaaecaf696b3e22886",
|
||||
"repo_id": 14576,
|
||||
"repo": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:22:27Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
}
|
||||
},
|
||||
"head": {
|
||||
"label": "d",
|
||||
"ref": "d",
|
||||
"sha": "06902b147a01a3fc0e7c23caf5548e242300e553",
|
||||
"repo_id": 14576,
|
||||
"repo": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:22:27Z",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"push": false,
|
||||
"pull": false
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
}
|
||||
},
|
||||
"merge_base": "50a822293e4dda7fdc1ecb6e61f7da62345b7fce",
|
||||
"due_date": null,
|
||||
"created_at": "2019-11-18T00:26:08Z",
|
||||
"updated_at": "2019-11-18T00:28:33Z",
|
||||
"closed_at": null
|
||||
},
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 19,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 0,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T00:22:27Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"review": null
|
||||
}
|
201
zerver/webhooks/gitea/fixtures/push__5_commits.json
Normal file
201
zerver/webhooks/gitea/fixtures/push__5_commits.json
Normal file
@@ -0,0 +1,201 @@
|
||||
{
|
||||
"secret": "123",
|
||||
"ref": "refs/heads/d",
|
||||
"before": "21138d2ca0ce18f8e037696fdbe1b3f0c211f630",
|
||||
"after": "2ec0c971d04723523aa20f2b378f8b419b47d4ec",
|
||||
"compare_url": "https://try.gitea.io/kostekIV/test/compare/21138d2ca0ce18f8e037696fdbe1b3f0c211f630...2ec0c971d04723523aa20f2b378f8b419b47d4ec",
|
||||
"commits": [
|
||||
{
|
||||
"id": "2ec0c971d04723523aa20f2b378f8b419b47d4ec",
|
||||
"message": "commit\n",
|
||||
"url": "https://try.gitea.io/kostekIV/test/commit/2ec0c971d04723523aa20f2b378f8b419b47d4ec",
|
||||
"author": {
|
||||
"name": "Jan Koscisz",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"committer": {
|
||||
"name": "Jan Koscisz",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"verification": null,
|
||||
"timestamp": "2019-11-18T02:55:51+01:00",
|
||||
"added": [],
|
||||
"removed": [],
|
||||
"modified": [
|
||||
"1.c"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "6cb1701c8b0114ad716f4cd49153076e7109cb85",
|
||||
"message": "commit\n",
|
||||
"url": "https://try.gitea.io/kostekIV/test/commit/6cb1701c8b0114ad716f4cd49153076e7109cb85",
|
||||
"author": {
|
||||
"name": "Jan Koscisz",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"committer": {
|
||||
"name": "Jan Koscisz",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"verification": null,
|
||||
"timestamp": "2019-11-18T02:55:51+01:00",
|
||||
"added": [],
|
||||
"removed": [],
|
||||
"modified": [
|
||||
"1.c"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "6773eabc0778a3e38997c06a13f5f0c48b67e5dc",
|
||||
"message": "commit\n",
|
||||
"url": "https://try.gitea.io/kostekIV/test/commit/6773eabc0778a3e38997c06a13f5f0c48b67e5dc",
|
||||
"author": {
|
||||
"name": "Jan Koscisz",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"committer": {
|
||||
"name": "Jan Koscisz",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"verification": null,
|
||||
"timestamp": "2019-11-18T02:55:51+01:00",
|
||||
"added": [],
|
||||
"removed": [],
|
||||
"modified": [
|
||||
"1.c"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "337402cf675ce7082ddcd23d06a116c85241825a",
|
||||
"message": "commit\n",
|
||||
"url": "https://try.gitea.io/kostekIV/test/commit/337402cf675ce7082ddcd23d06a116c85241825a",
|
||||
"author": {
|
||||
"name": "Jan Koscisz",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"committer": {
|
||||
"name": "Jan Koscisz",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"verification": null,
|
||||
"timestamp": "2019-11-18T02:55:51+01:00",
|
||||
"added": [],
|
||||
"removed": [],
|
||||
"modified": [
|
||||
"1.c"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "0a38cad3fac3a13bb78b738d13f15ce9cc3343fa",
|
||||
"message": "commit\n",
|
||||
"url": "https://try.gitea.io/kostekIV/test/commit/0a38cad3fac3a13bb78b738d13f15ce9cc3343fa",
|
||||
"author": {
|
||||
"name": "Jan Koscisz",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"committer": {
|
||||
"name": "Jan Koscisz",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"verification": null,
|
||||
"timestamp": "2019-11-18T02:55:51+01:00",
|
||||
"added": [],
|
||||
"removed": [],
|
||||
"modified": [
|
||||
"1.c"
|
||||
]
|
||||
}
|
||||
],
|
||||
"head_commit": null,
|
||||
"repository": {
|
||||
"id": 14576,
|
||||
"owner": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"name": "test",
|
||||
"full_name": "kostekIV/test",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"parent": null,
|
||||
"mirror": false,
|
||||
"size": 66,
|
||||
"html_url": "https://try.gitea.io/kostekIV/test",
|
||||
"ssh_url": "git@try.gitea.io:kostekIV/test.git",
|
||||
"clone_url": "https://try.gitea.io/kostekIV/test.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 1,
|
||||
"forks_count": 0,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 1,
|
||||
"default_branch": "master",
|
||||
"archived": false,
|
||||
"created_at": "2019-11-15T19:19:34Z",
|
||||
"updated_at": "2019-11-18T01:55:57Z",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": true,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": true,
|
||||
"has_pull_requests": true,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"avatar_url": ""
|
||||
},
|
||||
"pusher": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
},
|
||||
"sender": {
|
||||
"id": 21818,
|
||||
"login": "kostekIV",
|
||||
"full_name": "",
|
||||
"email": "koscis.j@gmail.com",
|
||||
"avatar_url": "https://try.gitea.io/user/avatar/kostekIV/-1",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "2019-11-17T23:23:04Z",
|
||||
"created": "2019-11-15T19:17:02Z",
|
||||
"username": "kostekIV"
|
||||
}
|
||||
}
|
105
zerver/webhooks/gitea/tests.py
Normal file
105
zerver/webhooks/gitea/tests.py
Normal file
@@ -0,0 +1,105 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from mock import MagicMock, patch
|
||||
|
||||
from zerver.lib.test_classes import WebhookTestCase
|
||||
|
||||
class GiteaHookTests(WebhookTestCase):
|
||||
STREAM_NAME = 'commits'
|
||||
URL_TEMPLATE = "/api/v1/external/giteae?&api_key={api_key}&stream={stream}"
|
||||
FIXTURE_DIR_NAME = 'gitea'
|
||||
|
||||
def test_multiple_commits(self) -> None:
|
||||
expected_topic = u"test / d"
|
||||
expected_message = u"""kostekIV [pushed](https://try.gitea.io/kostekIV/test/compare/21138d2ca0ce18f8e037696fdbe1b3f0c211f630...2ec0c971d04723523aa20f2b378f8b419b47d4ec) 5 commits to branch d.
|
||||
|
||||
* commit ([2ec0c97](https://try.gitea.io/kostekIV/test/commit/2ec0c971d04723523aa20f2b378f8b419b47d4ec))
|
||||
* commit ([6cb1701](https://try.gitea.io/kostekIV/test/commit/6cb1701c8b0114ad716f4cd49153076e7109cb85))
|
||||
* commit ([6773eab](https://try.gitea.io/kostekIV/test/commit/6773eabc0778a3e38997c06a13f5f0c48b67e5dc))
|
||||
* commit ([337402c](https://try.gitea.io/kostekIV/test/commit/337402cf675ce7082ddcd23d06a116c85241825a))
|
||||
* commit ([0a38cad](https://try.gitea.io/kostekIV/test/commit/0a38cad3fac3a13bb78b738d13f15ce9cc3343fa))"""
|
||||
self.send_and_test_stream_message('push__5_commits', expected_topic, expected_message)
|
||||
|
||||
def test_new_branch(self) -> None:
|
||||
expected_topic = u"test / test-branch"
|
||||
expected_message = u"kostekIV created [test-branch](https://try.gitea.io/kostekIV/test/src/test-branch) branch."
|
||||
self.send_and_test_stream_message('create__branch', expected_topic, expected_message)
|
||||
|
||||
def test_pull_request_opened(self) -> None:
|
||||
expected_topic = u"test / PR #1905 New pr"
|
||||
expected_message = u"""kostekIV opened [PR #4](https://try.gitea.io/kostekIV/test/pulls/4) from `test-branch` to `master`."""
|
||||
self.send_and_test_stream_message('pull_request__opened', expected_topic, expected_message)
|
||||
|
||||
def test_pull_request_merged(self) -> None:
|
||||
expected_topic = u"test / PR #1905 New pr"
|
||||
expected_message = u"""kostekIV merged [PR #4](https://try.gitea.io/kostekIV/test/pulls/4) from `test-branch` to `master`."""
|
||||
self.send_and_test_stream_message('pull_request__merged', expected_topic, expected_message)
|
||||
|
||||
def test_pull_request_edited(self) -> None:
|
||||
expected_topic = u"test / PR #1906 test 2"
|
||||
expected_message = u"""kostekIV edited [PR #5](https://try.gitea.io/kostekIV/test/pulls/5) from `d` to `master`."""
|
||||
self.send_and_test_stream_message('pull_request__edited', expected_topic, expected_message)
|
||||
|
||||
def test_pull_request_reopened(self) -> None:
|
||||
expected_topic = u"test / PR #1906 test 2"
|
||||
expected_message = u"""kostekIV reopened [PR #5](https://try.gitea.io/kostekIV/test/pulls/5) from `d` to `master`."""
|
||||
self.send_and_test_stream_message('pull_request__reopened', expected_topic, expected_message)
|
||||
|
||||
def test_pull_request_closed(self) -> None:
|
||||
expected_topic = u"test / PR #1906 test 2"
|
||||
expected_message = u"""kostekIV closed [PR #5](https://try.gitea.io/kostekIV/test/pulls/5) from `d` to `master`."""
|
||||
self.send_and_test_stream_message('pull_request__closed', expected_topic, expected_message)
|
||||
|
||||
def test_pull_request_assigned(self) -> None:
|
||||
expected_topic = u"test / PR #1906 test 2"
|
||||
expected_message = u"""kostekIV assigned [PR #5](https://try.gitea.io/kostekIV/test/pulls/5) (assigned to kostekIV) from `d` to `master`."""
|
||||
self.send_and_test_stream_message('pull_request__assigned', expected_topic, expected_message)
|
||||
|
||||
def test_issues_opened(self) -> None:
|
||||
expected_topic = u"test / Issue #3 Test issue"
|
||||
expected_message = u"""kostekIV opened [Issue #3](https://try.gitea.io/kostekIV/test/issues/3):\n\n~~~ quote\nTest body\n~~~"""
|
||||
self.send_and_test_stream_message('issues__opened', expected_topic, expected_message)
|
||||
|
||||
def test_issues_edited(self) -> None:
|
||||
expected_topic = u"test / Issue #3 Test issue 2"
|
||||
expected_message = u"""kostekIV edited [Issue #3](https://try.gitea.io/kostekIV/test/issues/3) (assigned to kostekIV):\n\n~~~ quote\nTest body\n~~~"""
|
||||
self.send_and_test_stream_message('issues__edited', expected_topic, expected_message)
|
||||
|
||||
def test_issues_closed(self) -> None:
|
||||
expected_topic = u"test / Issue #3 Test issue 2"
|
||||
expected_message = u"""kostekIV closed [Issue #3](https://try.gitea.io/kostekIV/test/issues/3) (assigned to kostekIV):\n\n~~~ quote\nTest body\n~~~"""
|
||||
self.send_and_test_stream_message('issues__closed', expected_topic, expected_message)
|
||||
|
||||
def test_issues_assigned(self) -> None:
|
||||
expected_topic = u"test / Issue #3 Test issue"
|
||||
expected_message = u"""kostekIV assigned [Issue #3](https://try.gitea.io/kostekIV/test/issues/3) (assigned to kostekIV):\n\n~~~ quote\nTest body\n~~~"""
|
||||
self.send_and_test_stream_message('issues__assigned', expected_topic, expected_message)
|
||||
|
||||
def test_issues_reopened(self) -> None:
|
||||
expected_topic = u"test / Issue #3 Test issue 2"
|
||||
expected_message = u"""kostekIV reopened [Issue #3](https://try.gitea.io/kostekIV/test/issues/3) (assigned to kostekIV):\n\n~~~ quote\nTest body\n~~~"""
|
||||
self.send_and_test_stream_message('issues__reopened', expected_topic, expected_message)
|
||||
|
||||
def test_issue_comment_new(self) -> None:
|
||||
expected_topic = u"test / Issue #3 Test issue"
|
||||
expected_message = u"""kostekIV [commented](https://try.gitea.io/kostekIV/test/issues/3#issuecomment-24400) on [Issue #3](https://try.gitea.io/kostekIV/test/issues/3):\n\n~~~ quote\ntest comment\n~~~"""
|
||||
self.send_and_test_stream_message('issue_comment__new', expected_topic, expected_message)
|
||||
|
||||
def test_issue_comment_in_pr(self) -> None:
|
||||
expected_topic = u"test / Issue #1 dummy"
|
||||
expected_message = u"""kostekIV [commented](https://try.gitea.io/kostekIV/test/pulls/1/files#issuecomment-24399) on [Issue #1](https://try.gitea.io/kostekIV/test/issues/1):\n\n~~~ quote\ntest comment\n~~~"""
|
||||
self.send_and_test_stream_message('issue_comment__in_pr', expected_topic, expected_message)
|
||||
|
||||
def test_issue_comment_edited(self) -> None:
|
||||
expected_topic = u"test / Issue #3 Test issue 2"
|
||||
expected_message = u"""kostekIV edited a [comment](https://try.gitea.io/kostekIV/test/issues/3#issuecomment-24400) on [Issue #3](https://try.gitea.io/kostekIV/test/issues/3):\n\n~~~ quote\nedit test comment\n~~~"""
|
||||
|
||||
self.send_and_test_stream_message('issue_comment__edited', expected_topic, expected_message)
|
||||
|
||||
@patch('zerver.webhooks.gitea.view.check_send_webhook_message')
|
||||
def test_push_filtered_by_branches_ignore(self, check_send_webhook_message_mock: MagicMock) -> None:
|
||||
self.url = self.build_webhook_url(branches='changes,development')
|
||||
payload = self.get_body('push__5_commits')
|
||||
result = self.client_post(self.url, payload, HTTP_X_GITEA_EVENT='push',
|
||||
content_type="application/json")
|
||||
self.assertFalse(check_send_webhook_message_mock.called)
|
||||
self.assert_json_success(result)
|
167
zerver/webhooks/gitea/view.py
Normal file
167
zerver/webhooks/gitea/view.py
Normal file
@@ -0,0 +1,167 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim:fenc=utf-8
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.lib.webhooks.common import check_send_webhook_message, \
|
||||
validate_extract_webhook_http_header, UnexpectedWebhookEventType, \
|
||||
get_http_headers_from_filename
|
||||
from zerver.lib.webhooks.git import TOPIC_WITH_BRANCH_TEMPLATE, \
|
||||
TOPIC_WITH_PR_OR_ISSUE_INFO_TEMPLATE, get_create_branch_event_message, \
|
||||
get_pull_request_event_message, get_push_commits_event_message, \
|
||||
get_issue_event_message
|
||||
from zerver.models import UserProfile
|
||||
|
||||
fixture_to_headers = get_http_headers_from_filename("HTTP_X_GITEA_EVENT")
|
||||
|
||||
def get_issue_url(repo_url: str, issue_nr: int) -> str:
|
||||
return "{}/issues/{}".format(repo_url, issue_nr)
|
||||
|
||||
def format_push_event(payload: Dict[str, Any]) -> str:
|
||||
|
||||
for commit in payload['commits']:
|
||||
commit['sha'] = commit['id']
|
||||
commit['name'] = (commit['author']['username'] or
|
||||
commit['author']['name'].split()[0])
|
||||
|
||||
data = {
|
||||
'user_name': payload['sender']['username'],
|
||||
'compare_url': payload['compare_url'],
|
||||
'branch_name': payload['ref'].replace('refs/heads/', ''),
|
||||
'commits_data': payload['commits']
|
||||
}
|
||||
|
||||
return get_push_commits_event_message(**data)
|
||||
|
||||
def format_new_branch_event(payload: Dict[str, Any]) -> str:
|
||||
|
||||
branch_name = payload['ref']
|
||||
url = '{}/src/{}'.format(payload['repository']['html_url'], branch_name)
|
||||
|
||||
data = {
|
||||
'user_name': payload['sender']['username'],
|
||||
'url': url,
|
||||
'branch_name': branch_name
|
||||
}
|
||||
return get_create_branch_event_message(**data)
|
||||
|
||||
def format_pull_request_event(payload: Dict[str, Any],
|
||||
include_title: Optional[bool]=False) -> str:
|
||||
assignee = payload['pull_request']['assignee']
|
||||
data = {
|
||||
'user_name': payload['pull_request']['user']['username'],
|
||||
'action': payload['action'],
|
||||
'url': payload['pull_request']['html_url'],
|
||||
'number': payload['pull_request']['number'],
|
||||
'target_branch': payload['pull_request']['head']['ref'],
|
||||
'base_branch': payload['pull_request']['base']['ref'],
|
||||
'title': payload['pull_request']['title'] if include_title else None,
|
||||
'assignee': assignee['login'] if assignee else None
|
||||
}
|
||||
|
||||
if payload['pull_request']['merged']:
|
||||
data['user_name'] = payload['pull_request']['merged_by']['username']
|
||||
data['action'] = 'merged'
|
||||
|
||||
return get_pull_request_event_message(**data)
|
||||
|
||||
def format_issues_event(payload: Dict[str, Any], include_title: Optional[bool]=False) -> str:
|
||||
issue_nr = payload['issue']['number']
|
||||
assignee = payload['issue']['assignee']
|
||||
return get_issue_event_message(
|
||||
payload['sender']['login'],
|
||||
payload['action'],
|
||||
get_issue_url(payload['repository']['html_url'], issue_nr),
|
||||
issue_nr,
|
||||
payload['issue']['body'],
|
||||
assignee=assignee['login'] if assignee else None,
|
||||
title=payload['issue']['title'] if include_title else None
|
||||
)
|
||||
|
||||
def format_issue_comment_event(payload: Dict[str, Any], include_title: Optional[bool]=False) -> str:
|
||||
action = payload['action']
|
||||
comment = payload['comment']
|
||||
issue = payload['issue']
|
||||
issue_nr = issue['number']
|
||||
|
||||
if action == 'created':
|
||||
action = '[commented]'
|
||||
else:
|
||||
action = '{} a [comment]'.format(action)
|
||||
action += '({}) on'.format(comment['html_url'])
|
||||
|
||||
return get_issue_event_message(
|
||||
payload['sender']['login'],
|
||||
action,
|
||||
get_issue_url(payload['repository']['html_url'], issue_nr),
|
||||
issue_nr,
|
||||
comment['body'],
|
||||
title=issue['title'] if include_title else None
|
||||
)
|
||||
|
||||
@api_key_only_webhook_view('Gitea')
|
||||
@has_request_variables
|
||||
def api_gitea_webhook(request: HttpRequest, user_profile: UserProfile,
|
||||
payload: Dict[str, Any]=REQ(argument_type='body'),
|
||||
branches: Optional[str]=REQ(default=None),
|
||||
user_specified_topic: Optional[str]=REQ("topic", default=None)) -> HttpResponse:
|
||||
|
||||
repo = payload['repository']['name']
|
||||
event = validate_extract_webhook_http_header(request, 'X_GITEA_EVENT', 'Gitea')
|
||||
if event == 'push':
|
||||
branch = payload['ref'].replace('refs/heads/', '')
|
||||
if branches is not None and branch not in branches.split(','):
|
||||
return json_success()
|
||||
body = format_push_event(payload)
|
||||
topic = TOPIC_WITH_BRANCH_TEMPLATE.format(
|
||||
repo=repo,
|
||||
branch=branch
|
||||
)
|
||||
elif event == 'create':
|
||||
body = format_new_branch_event(payload)
|
||||
topic = TOPIC_WITH_BRANCH_TEMPLATE.format(
|
||||
repo=repo,
|
||||
branch=payload['ref']
|
||||
)
|
||||
elif event == 'pull_request':
|
||||
body = format_pull_request_event(
|
||||
payload,
|
||||
include_title=user_specified_topic is not None
|
||||
)
|
||||
topic = TOPIC_WITH_PR_OR_ISSUE_INFO_TEMPLATE.format(
|
||||
repo=repo,
|
||||
type='PR',
|
||||
id=payload['pull_request']['id'],
|
||||
title=payload['pull_request']['title']
|
||||
)
|
||||
elif event == 'issues':
|
||||
body = format_issues_event(
|
||||
payload,
|
||||
include_title=user_specified_topic is not None
|
||||
)
|
||||
topic = TOPIC_WITH_PR_OR_ISSUE_INFO_TEMPLATE.format(
|
||||
repo=repo,
|
||||
type='Issue',
|
||||
id=payload['issue']['number'],
|
||||
title=payload['issue']['title']
|
||||
)
|
||||
elif event == 'issue_comment':
|
||||
body = format_issue_comment_event(
|
||||
payload,
|
||||
include_title=user_specified_topic is not None
|
||||
)
|
||||
topic = TOPIC_WITH_PR_OR_ISSUE_INFO_TEMPLATE.format(
|
||||
repo=repo,
|
||||
type='Issue',
|
||||
id=payload['issue']['number'],
|
||||
title=payload['issue']['title']
|
||||
)
|
||||
else:
|
||||
raise UnexpectedWebhookEventType('Gitea', event)
|
||||
|
||||
check_send_webhook_message(request, user_profile, topic, body)
|
||||
return json_success()
|
Reference in New Issue
Block a user