integrations: Update note fixtures for GitLab Integration.

This commit is contained in:
Satyam Bansal 2023-05-26 13:00:25 +05:30 committed by Tim Abbott
parent 0adcc2a1df
commit 508514c870
7 changed files with 553 additions and 403 deletions

View File

@ -1,65 +1,73 @@
{
"object_kind":"note",
"user":{
"name":"Tomasz Kolek",
"username":"tomaszkolek0",
"avatar_url":"https://secure.gravatar.com/avatar/116a6fdbcfd00466297a39174da11fbb?s=80\u0026d=identicon"
},
"project_id":1534233,
"project":{
"name":"my-awesome-project",
"description":"",
"web_url":"https://gitlab.com/tomaszkolek0/my-awesome-project",
"avatar_url":null,
"git_ssh_url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"git_http_url":"https://gitlab.com/tomaszkolek0/my-awesome-project.git",
"namespace":"tomaszkolek0",
"visibility_level":0,
"path_with_namespace":"tomaszkolek0/my-awesome-project",
"default_branch":"master",
"homepage":"https://gitlab.com/tomaszkolek0/my-awesome-project",
"url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"ssh_url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"http_url":"https://gitlab.com/tomaszkolek0/my-awesome-project.git"
},
"object_attributes":{
"id":14169211,
"note":"nice commit",
"noteable_type":"Commit",
"author_id":670043,
"created_at":"2016-08-22 19:17:30 UTC",
"updated_at":"2016-08-22 19:17:30 UTC",
"project_id":1534233,
"attachment":null,
"line_code":null,
"commit_id":"66abd2da28809ffa128ed0447965cf11d7f863a7",
"noteable_id":null,
"st_diff":null,
"system":false,
"updated_by_id":null,
"type":null,
"position":null,
"original_position":null,
"resolved_at":null,
"resolved_by_id":null,
"discussion_id":"c748ca8fd85ec719e2d4d75c849cf7c616dc3955",
"original_discussion_id":null,
"url":"https://gitlab.com/tomaszkolek0/my-awesome-project/commit/66abd2da28809ffa128ed0447965cf11d7f863a7#note_14169211"
},
"repository":{
"name":"my-awesome-project",
"url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"description":"",
"homepage":"https://gitlab.com/tomaszkolek0/my-awesome-project"
},
"commit":{
"id":"66abd2da28809ffa128ed0447965cf11d7f863a7",
"message":"b\n",
"timestamp":"2016-08-17T21:17:54+02:00",
"url":"https://gitlab.com/tomaszkolek0/my-awesome-project/commit/66abd2da28809ffa128ed0447965cf11d7f863a7",
"author":{
"name":"Tomasz Kolek",
"email":"tomasz-kolek@o2.pl"
}
}
"object_kind": "note",
"event_type": "note",
"user": {
"id": 14613894,
"name": "Satyam Bansal",
"username": "sbansal1999",
"avatar_url": "https://secure.gravatar.com/avatar/f4dd7cfc79fac91db4d9ecbb443a0519?s=80&d=identicon",
"email": "[REDACTED]"
},
"project_id": 46186758,
"project": {
"id": 46186758,
"name": "testing-zulip-gitlab-integration",
"description": null,
"web_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"avatar_url": null,
"git_ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"git_http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git",
"namespace": "Satyam Bansal",
"visibility_level": 0,
"path_with_namespace": "sbansal1999/testing-zulip-gitlab-integration",
"default_branch": "main",
"ci_config_path": "",
"homepage": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git"
},
"object_attributes": {
"attachment": null,
"author_id": 14613894,
"change_position": null,
"commit_id": "82689ddf00fd7bdadb5c2afb3b94bd555edc9d01",
"created_at": "2023-05-25 18:18:17 UTC",
"discussion_id": "10ffd7c627f00f19cc2fa9cbbed9d13f3ff91375",
"id": 1406241063,
"line_code": null,
"note": "Wow what a beautiful commit.",
"noteable_id": null,
"noteable_type": "Commit",
"original_position": null,
"position": null,
"project_id": 46186758,
"resolved_at": null,
"resolved_by_id": null,
"resolved_by_push": null,
"st_diff": null,
"system": false,
"type": null,
"updated_at": "2023-05-25 18:18:17 UTC",
"updated_by_id": null,
"description": "Wow what a beautiful commit.",
"url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/commit/82689ddf00fd7bdadb5c2afb3b94bd555edc9d01#note_1406241063"
},
"repository": {
"name": "testing-zulip-gitlab-integration",
"url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"description": null,
"homepage": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration"
},
"commit": {
"id": "82689ddf00fd7bdadb5c2afb3b94bd555edc9d01",
"message": "added some lines in second file\n",
"title": "added some lines in second file",
"timestamp": "2023-05-25T22:21:16+05:30",
"url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/commit/82689ddf00fd7bdadb5c2afb3b94bd555edc9d01",
"author": {
"name": "Satyam Bansal",
"email": "sbansal1999@gmail.com"
}
}
}

View File

@ -1,88 +1,98 @@
{
"object_kind": "note",
"event_type": "confidential_note",
"user": {
"name": "Joe Bloggs",
"username": "joebloggs",
"avatar_url": "https://secure.gravatar.com/avatar/1e00d93acdfdddc06304143a1dfcd0b4?s=80&d=identicon"
},
"project_id": 8385998,
"project": {
"id": 8385998,
"name": "Test",
"description": "",
"web_url": "https://gitlab.com/joebloggs/test",
"avatar_url": null,
"git_ssh_url": "git@gitlab.com:joebloggs/test.git",
"git_http_url": "https://gitlab.com/joebloggs/test.git",
"namespace": "joebloggs",
"visibility_level": 20,
"path_with_namespace": "joebloggs/test",
"default_branch": null,
"ci_config_path": null,
"homepage": "https://gitlab.com/joebloggs/test",
"url": "git@gitlab.com:joebloggs/test.git",
"ssh_url": "git@gitlab.com:joebloggs/test.git",
"http_url": "https://gitlab.com/joebloggs/test.git"
},
"object_attributes": {
"attachment": null,
"author_id": 1102929,
"change_position": null,
"commit_id": null,
"created_at": "2018-09-15 21:01:07 UTC",
"discussion_id": "0be9d1a81a3841710ae99c237f781b4209e6c23f",
"id": 101638770,
"line_code": null,
"note": "Test",
"noteable_id": 14177506,
"noteable_type": "Issue",
"original_position": null,
"position": null,
"project_id": 8385998,
"resolved_at": null,
"resolved_by_id": null,
"resolved_by_push": null,
"st_diff": null,
"system": false,
"type": null,
"updated_at": "2018-09-15 21:01:07 UTC",
"updated_by_id": null,
"description": "Test",
"url": "https://gitlab.com/joebloggs/test/issues/3#note_101638770"
},
"repository": {
"name": "Test",
"url": "git@gitlab.com:joebloggs/test.git",
"description": "",
"homepage": "https://gitlab.com/joebloggs/test"
},
"issue": {
"author_id": 1102929,
"closed_at": null,
"confidential": true,
"created_at": "2018-09-15 21:01:03 UTC",
"description": "Test",
"due_date": null,
"id": 14177506,
"iid": 3,
"last_edited_at": null,
"last_edited_by_id": null,
"milestone_id": null,
"moved_to_id": null,
"project_id": 8385998,
"relative_position": 1073743323,
"state": "opened",
"time_estimate": 0,
"title": "Test",
"updated_at": "2018-09-15 21:01:03 UTC",
"updated_by_id": null,
"weight": null,
"url": "https://gitlab.com/joebloggs/test/issues/3",
"total_time_spent": 0,
"human_total_time_spent": null,
"human_time_estimate": null,
"assignee_ids": [],
"assignee_id": null
}
"object_kind": "note",
"event_type": "confidential_note",
"user": {
"id": 14613894,
"name": "Satyam Bansal",
"username": "sbansal1999",
"avatar_url": "https://secure.gravatar.com/avatar/f4dd7cfc79fac91db4d9ecbb443a0519?s=80&d=identicon",
"email": "[REDACTED]"
},
"project_id": 46186758,
"project": {
"id": 46186758,
"name": "testing-zulip-gitlab-integration",
"description": null,
"web_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"avatar_url": null,
"git_ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"git_http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git",
"namespace": "Satyam Bansal",
"visibility_level": 0,
"path_with_namespace": "sbansal1999/testing-zulip-gitlab-integration",
"default_branch": "main",
"ci_config_path": "",
"homepage": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git"
},
"object_attributes": {
"attachment": null,
"author_id": 14613894,
"change_position": null,
"commit_id": null,
"created_at": "2023-05-25 17:12:06 UTC",
"discussion_id": "0f34ca7c156316d3169dee075808536909857945",
"id": 1406130881,
"line_code": null,
"note": "Some more comments",
"noteable_id": 128231959,
"noteable_type": "Issue",
"original_position": null,
"position": null,
"project_id": 46186758,
"resolved_at": null,
"resolved_by_id": null,
"resolved_by_push": null,
"st_diff": null,
"system": false,
"type": null,
"updated_at": "2023-05-25 17:12:06 UTC",
"updated_by_id": null,
"description": "Some more comments",
"url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/issues/1#note_1406130881"
},
"repository": {
"name": "testing-zulip-gitlab-integration",
"url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"description": null,
"homepage": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration"
},
"issue": {
"author_id": 14613894,
"closed_at": null,
"confidential": false,
"created_at": "2023-05-20 17:56:18 UTC",
"description": "I think we should add a couple of more lines to the file. That will make this a lot better. :eyes:",
"discussion_locked": null,
"due_date": null,
"id": 128231959,
"iid": 1,
"last_edited_at": null,
"last_edited_by_id": null,
"milestone_id": null,
"moved_to_id": null,
"duplicated_to_id": null,
"project_id": 46186758,
"relative_position": 513,
"state_id": 1,
"time_estimate": 0,
"title": "Add more lines",
"updated_at": "2023-05-25 17:12:06 UTC",
"updated_by_id": null,
"weight": null,
"health_status": null,
"url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/issues/1",
"total_time_spent": 0,
"time_change": 0,
"human_total_time_spent": null,
"human_time_change": null,
"human_time_estimate": null,
"assignee_ids": [],
"assignee_id": null,
"labels": [],
"state": "opened",
"severity": "unknown"
}
}

View File

@ -1,76 +1,98 @@
{
"object_kind":"note",
"user":{
"name":"Tomasz Kolek",
"username":"tomaszkolek0",
"avatar_url":"https://secure.gravatar.com/avatar/116a6fdbcfd00466297a39174da11fbb?s=80\u0026d=identicon"
},
"project_id":1534233,
"project":{
"name":"my-awesome-project",
"description":"",
"web_url":"https://gitlab.com/tomaszkolek0/my-awesome-project",
"avatar_url":null,
"git_ssh_url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"git_http_url":"https://gitlab.com/tomaszkolek0/my-awesome-project.git",
"namespace":"tomaszkolek0",
"visibility_level":0,
"path_with_namespace":"tomaszkolek0/my-awesome-project",
"default_branch":"master",
"homepage":"https://gitlab.com/tomaszkolek0/my-awesome-project",
"url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"ssh_url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"http_url":"https://gitlab.com/tomaszkolek0/my-awesome-project.git"
},
"object_attributes":{
"id":14172057,
"note":"Nice issue",
"noteable_type":"Issue",
"author_id":670043,
"created_at":"2016-08-22 19:46:01 UTC",
"updated_at":"2016-08-22 19:46:01 UTC",
"project_id":1534233,
"attachment":null,
"line_code":null,
"commit_id":"",
"noteable_id":2788403,
"st_diff":null,
"system":false,
"updated_by_id":null,
"type":null,
"position":null,
"original_position":null,
"resolved_at":null,
"resolved_by_id":null,
"discussion_id":"3dc99fafcb44acc90c91e745626617b650b50809",
"original_discussion_id":null,
"url":"https://gitlab.com/tomaszkolek0/my-awesome-project/issues/2#note_14172057"
},
"repository":{
"name":"my-awesome-project",
"url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"description":"",
"homepage":"https://gitlab.com/tomaszkolek0/my-awesome-project"
},
"issue":{
"id":2788403,
"title":"abc",
"assignee_id":null,
"author_id":670043,
"project_id":1534233,
"created_at":"2016-08-18 18:29:14 UTC",
"updated_at":"2016-08-22 19:46:01 UTC",
"position":0,
"branch_name":null,
"description":"",
"milestone_id":null,
"state":"opened",
"iid":2,
"updated_by_id":null,
"weight":null,
"confidential":false,
"moved_to_id":null,
"deleted_at":null,
"due_date":null
}
"object_kind": "note",
"event_type": "note",
"user": {
"id": 14613894,
"name": "Satyam Bansal",
"username": "sbansal1999",
"avatar_url": "https://secure.gravatar.com/avatar/f4dd7cfc79fac91db4d9ecbb443a0519?s=80&d=identicon",
"email": "[REDACTED]"
},
"project_id": 46186758,
"project": {
"id": 46186758,
"name": "testing-zulip-gitlab-integration",
"description": null,
"web_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"avatar_url": null,
"git_ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"git_http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git",
"namespace": "Satyam Bansal",
"visibility_level": 0,
"path_with_namespace": "sbansal1999/testing-zulip-gitlab-integration",
"default_branch": "main",
"ci_config_path": "",
"homepage": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git"
},
"object_attributes": {
"attachment": null,
"author_id": 14613894,
"change_position": null,
"commit_id": null,
"created_at": "2023-05-25 18:41:09 UTC",
"discussion_id": "d85e085fd1fbf70a166d9aebd27933112a25a072",
"id": 1406279810,
"line_code": null,
"note": "This is again a random comment.",
"noteable_id": 128231959,
"noteable_type": "Issue",
"original_position": null,
"position": null,
"project_id": 46186758,
"resolved_at": null,
"resolved_by_id": null,
"resolved_by_push": null,
"st_diff": null,
"system": false,
"type": null,
"updated_at": "2023-05-25 18:41:09 UTC",
"updated_by_id": null,
"description": "This is again a random comment.",
"url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/issues/1#note_1406279810"
},
"repository": {
"name": "testing-zulip-gitlab-integration",
"url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"description": null,
"homepage": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration"
},
"issue": {
"author_id": 14613894,
"closed_at": null,
"confidential": false,
"created_at": "2023-05-20 17:56:18 UTC",
"description": "I think we should add a couple of more lines to the file. That will make this a lot better. :eyes:",
"discussion_locked": null,
"due_date": null,
"id": 128231959,
"iid": 1,
"last_edited_at": null,
"last_edited_by_id": null,
"milestone_id": null,
"moved_to_id": null,
"duplicated_to_id": null,
"project_id": 46186758,
"relative_position": 513,
"state_id": 1,
"time_estimate": 0,
"title": "Add more lines",
"updated_at": "2023-05-25 18:41:09 UTC",
"updated_by_id": null,
"weight": null,
"health_status": null,
"url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/issues/1",
"total_time_spent": 0,
"time_change": 0,
"human_total_time_spent": null,
"human_time_change": null,
"human_time_estimate": null,
"assignee_ids": [],
"assignee_id": null,
"labels": [],
"state": "opened",
"severity": "unknown"
}
}

View File

@ -1,129 +1,152 @@
{
"object_kind":"note",
"user":{
"name":"Tomasz Kolek",
"username":"tomaszkolek0",
"avatar_url":"https://secure.gravatar.com/avatar/116a6fdbcfd00466297a39174da11fbb?s=80\u0026d=identicon"
"object_kind": "note",
"event_type": "note",
"user": {
"id": 14613894,
"name": "Satyam Bansal",
"username": "sbansal1999",
"avatar_url": "https://secure.gravatar.com/avatar/f4dd7cfc79fac91db4d9ecbb443a0519?s=80&d=identicon",
"email": "[REDACTED]"
},
"project_id":1534233,
"project":{
"name":"my-awesome-project",
"description":"",
"web_url":"https://gitlab.com/tomaszkolek0/my-awesome-project",
"avatar_url":null,
"git_ssh_url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"git_http_url":"https://gitlab.com/tomaszkolek0/my-awesome-project.git",
"namespace":"tomaszkolek0",
"visibility_level":0,
"path_with_namespace":"tomaszkolek0/my-awesome-project",
"default_branch":"master",
"homepage":"https://gitlab.com/tomaszkolek0/my-awesome-project",
"url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"ssh_url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"http_url":"https://gitlab.com/tomaszkolek0/my-awesome-project.git"
"project_id": 46186758,
"project": {
"id": 46186758,
"name": "testing-zulip-gitlab-integration",
"description": null,
"web_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"avatar_url": null,
"git_ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"git_http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git",
"namespace": "Satyam Bansal",
"visibility_level": 0,
"path_with_namespace": "sbansal1999/testing-zulip-gitlab-integration",
"default_branch": "main",
"ci_config_path": "",
"homepage": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git"
},
"object_attributes":{
"id":14171860,
"note":"Nice merge request!",
"noteable_type":"MergeRequest",
"author_id":670043,
"created_at":"2016-08-22 19:36:22 UTC",
"updated_at":"2016-08-22 19:36:22 UTC",
"project_id":1534233,
"attachment":null,
"line_code":null,
"commit_id":"",
"noteable_id":756075,
"st_diff":null,
"system":false,
"updated_by_id":null,
"type":null,
"position":null,
"original_position":null,
"resolved_at":null,
"resolved_by_id":null,
"discussion_id":"431b621ff2e6f4dc0e37ad19160b9e946a02f488",
"original_discussion_id":null,
"url":"https://gitlab.com/tomaszkolek0/my-awesome-project/merge_requests/1#note_14171860"
"object_attributes": {
"attachment": null,
"author_id": 14613894,
"change_position": null,
"commit_id": null,
"created_at": "2023-05-25 19:04:19 UTC",
"discussion_id": "547c7f02ebb7bbdef59e006756cc5b4a09de710a",
"id": 1406328457,
"line_code": null,
"note": "I am not sure if this new feature is even required or not.",
"noteable_id": 226323715,
"noteable_type": "MergeRequest",
"original_position": null,
"position": null,
"project_id": 46186758,
"resolved_at": null,
"resolved_by_id": null,
"resolved_by_push": null,
"st_diff": null,
"system": false,
"type": null,
"updated_at": "2023-05-25 19:04:19 UTC",
"updated_by_id": null,
"description": "I am not sure if this new feature is even required or not.",
"url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/merge_requests/1#note_1406328457"
},
"repository":{
"name":"my-awesome-project",
"url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"description":"",
"homepage":"https://gitlab.com/tomaszkolek0/my-awesome-project"
"repository": {
"name": "testing-zulip-gitlab-integration",
"url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"description": null,
"homepage": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration"
},
"merge_request":{
"id":756075,
"target_branch":"master",
"source_branch":"tomek",
"source_project_id":1534233,
"author_id":670043,
"assignee_id":null,
"title":"Tomek",
"created_at":"2016-08-22 19:36:12 UTC",
"updated_at":"2016-08-22 19:36:22 UTC",
"milestone_id":null,
"state":"opened",
"merge_status":"can_be_merged",
"target_project_id":1534233,
"iid":1,
"description":"",
"position":0,
"locked_at":null,
"updated_by_id":null,
"merge_error":null,
"merge_params":{
"force_remove_source_branch":null
"merge_request": {
"assignee_id": null,
"author_id": 14613894,
"created_at": "2023-05-25 19:03:52 UTC",
"description": "",
"head_pipeline_id": null,
"id": 226323715,
"iid": 1,
"last_edited_at": null,
"last_edited_by_id": null,
"merge_commit_sha": null,
"merge_error": null,
"merge_params": {
"force_remove_source_branch": "1"
},
"merge_when_build_succeeds":false,
"merge_user_id":null,
"merge_commit_sha":null,
"deleted_at":null,
"approvals_before_merge":null,
"rebase_commit_sha":null,
"in_progress_merge_commit_sha":null,
"source":{
"name":"my-awesome-project",
"description":"",
"web_url":"https://gitlab.com/tomaszkolek0/my-awesome-project",
"avatar_url":null,
"git_ssh_url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"git_http_url":"https://gitlab.com/tomaszkolek0/my-awesome-project.git",
"namespace":"tomaszkolek0",
"visibility_level":0,
"path_with_namespace":"tomaszkolek0/my-awesome-project",
"default_branch":"master",
"homepage":"https://gitlab.com/tomaszkolek0/my-awesome-project",
"url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"ssh_url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"http_url":"https://gitlab.com/tomaszkolek0/my-awesome-project.git"
"merge_status": "can_be_merged",
"merge_user_id": null,
"merge_when_pipeline_succeeds": false,
"milestone_id": null,
"source_branch": "feature",
"source_project_id": 46186758,
"state_id": 1,
"target_branch": "main",
"target_project_id": 46186758,
"time_estimate": 0,
"title": "add new-feature",
"updated_at": "2023-05-25 19:03:53 UTC",
"updated_by_id": null,
"url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/merge_requests/1",
"source": {
"id": 46186758,
"name": "testing-zulip-gitlab-integration",
"description": null,
"web_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"avatar_url": null,
"git_ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"git_http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git",
"namespace": "Satyam Bansal",
"visibility_level": 0,
"path_with_namespace": "sbansal1999/testing-zulip-gitlab-integration",
"default_branch": "main",
"ci_config_path": "",
"homepage": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git"
},
"target":{
"name":"my-awesome-project",
"description":"",
"web_url":"https://gitlab.com/tomaszkolek0/my-awesome-project",
"avatar_url":null,
"git_ssh_url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"git_http_url":"https://gitlab.com/tomaszkolek0/my-awesome-project.git",
"namespace":"tomaszkolek0",
"visibility_level":0,
"path_with_namespace":"tomaszkolek0/my-awesome-project",
"default_branch":"master",
"homepage":"https://gitlab.com/tomaszkolek0/my-awesome-project",
"url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"ssh_url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"http_url":"https://gitlab.com/tomaszkolek0/my-awesome-project.git"
"target": {
"id": 46186758,
"name": "testing-zulip-gitlab-integration",
"description": null,
"web_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"avatar_url": null,
"git_ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"git_http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git",
"namespace": "Satyam Bansal",
"visibility_level": 0,
"path_with_namespace": "sbansal1999/testing-zulip-gitlab-integration",
"default_branch": "main",
"ci_config_path": "",
"homepage": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git"
},
"last_commit":{
"id":"600060393d326486c12f222ba78d569dab6b4114",
"message":"new commit\n",
"timestamp":"2016-08-22T21:31:34+02:00",
"url":"https://gitlab.com/tomaszkolek0/my-awesome-project/commit/600060393d326486c12f222ba78d569dab6b4114",
"author":{
"name":"Tomasz Kolek",
"email":"tomasz-kolek@o2.pl"
"last_commit": {
"id": "b7d5e68a840f73be14f580e88bc8e37181805f64",
"message": "add new-feature\n",
"title": "add new-feature",
"timestamp": "2023-05-26T00:32:24+05:30",
"url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/commit/b7d5e68a840f73be14f580e88bc8e37181805f64",
"author": {
"name": "Satyam Bansal",
"email": "sbansal1999@gmail.com"
}
},
"work_in_progress":false
"work_in_progress": false,
"total_time_spent": 0,
"time_change": 0,
"human_total_time_spent": null,
"human_time_change": null,
"human_time_estimate": null,
"assignee_ids": [],
"reviewer_ids": [],
"labels": [],
"state": "opened",
"blocking_discussions_resolved": true,
"first_contribution": true,
"detailed_merge_status": "mergeable"
}
}

View File

@ -1,60 +1,81 @@
{
"object_kind": "note",
"user":{
"name":"Tomasz Kolek",
"username":"tomaszkolek0",
"avatar_url":"https://secure.gravatar.com/avatar/116a6fdbcfd00466297a39174da11fbb?s=80\u0026d=identicon"
},
"project_id": 1534233,
"project":{
"name":"my-awesome-project",
"description":"",
"web_url":"https://gitlab.com/tomaszkolek0/my-awesome-project",
"avatar_url":null,
"git_ssh_url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"git_http_url":"https://gitlab.com/tomaszkolek0/my-awesome-project.git",
"namespace":"tomaszkolek0",
"visibility_level":0,
"path_with_namespace":"tomaszkolek0/my-awesome-project",
"default_branch":"master",
"homepage":"https://gitlab.com/tomaszkolek0/my-awesome-project",
"url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"ssh_url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"http_url":"https://gitlab.com/tomaszkolek0/my-awesome-project.git"
},
"repository":{
"name":"my-awesome-project",
"url":"git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"description":"",
"homepage":"https://gitlab.com/tomaszkolek0/my-awesome-project"
"object_kind": "note",
"event_type": "note",
"user": {
"id": 14613894,
"name": "Satyam Bansal",
"username": "sbansal1999",
"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/14613894/avatar.png",
"email": "[REDACTED]"
},
"project_id": 46186758,
"project": {
"id": 46186758,
"name": "testing-zulip-gitlab-integration",
"description": null,
"web_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"avatar_url": null,
"git_ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"git_http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git",
"namespace": "Satyam Bansal",
"visibility_level": 0,
"path_with_namespace": "sbansal1999/testing-zulip-gitlab-integration",
"default_branch": "main",
"ci_config_path": "",
"homepage": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration",
"url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"ssh_url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"http_url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration.git"
},
"object_attributes": {
"id": 14172058,
"note": "Nice snippet",
"noteable_type": "Snippet",
"author_id": 670043,
"created_at":"2016-08-22 19:46:01 UTC",
"updated_at":"2016-08-22 19:46:01 UTC",
"project_id": 1534233,
"attachment": null,
"author_id": 14613894,
"change_position": null,
"commit_id": null,
"created_at": "2023-06-08 19:25:03 UTC",
"discussion_id": "d3348140b5483090551f0e4cce3a08f2faf041a3",
"id": 1424268837,
"line_code": null,
"commit_id": "",
"noteable_id": 2788404,
"system": false,
"note": "some comment",
"noteable_id": 2547713,
"noteable_type": "Snippet",
"original_position": null,
"position": null,
"project_id": 46186758,
"resolved_at": null,
"resolved_by_id": null,
"resolved_by_push": null,
"st_diff": null,
"url":"https://gitlab.com/tomaszkolek0/my-awesome-project/snippets/2#note_14172058"
"system": false,
"type": null,
"updated_at": "2023-06-08 19:25:03 UTC",
"updated_by_id": null,
"description": "some comment",
"url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/snippets/2547713#note_1424268837"
},
"repository": {
"name": "testing-zulip-gitlab-integration",
"url": "git@gitlab.com:sbansal1999/testing-zulip-gitlab-integration.git",
"description": null,
"homepage": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration"
},
"snippet": {
"id": 2,
"title": "test",
"content": "puts 'Hello world'",
"author_id": 670043,
"project_id": 1534233,
"created_at":"2016-08-21 17:36:01 UTC",
"updated_at":"2016-08-22 19:46:01 UTC",
"file_name": "README.md",
"expires_at": null,
"id": 2547713,
"title": "a very new new feature",
"content": "a very new new feature\na very new new feature\na very new new feature\na very new new feature\na very new new feature",
"author_id": 14613894,
"project_id": 46186758,
"created_at": "2023-05-25 19:13:05 UTC",
"updated_at": "2023-06-08 19:25:03 UTC",
"file_name": "",
"type": "ProjectSnippet",
"visibility_level": 0
"visibility_level": 0,
"description": "",
"encrypted_secret_token": null,
"encrypted_secret_token_iv": null,
"secret": false,
"repository_read_only": false,
"secret_token": null,
"url": "https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/snippets/2547713"
}
}

View File

@ -0,0 +1,60 @@
{
"object_kind": "note",
"user": {
"name": "Tomasz Kolek",
"username": "tomaszkolek0",
"avatar_url": "https://secure.gravatar.com/avatar/116a6fdbcfd00466297a39174da11fbb?s=80\u0026d=identicon"
},
"project_id": 1534233,
"project": {
"name": "my-awesome-project",
"description": "",
"web_url": "https://gitlab.com/tomaszkolek0/my-awesome-project",
"avatar_url": null,
"git_ssh_url": "git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"git_http_url": "https://gitlab.com/tomaszkolek0/my-awesome-project.git",
"namespace": "tomaszkolek0",
"visibility_level": 0,
"path_with_namespace": "tomaszkolek0/my-awesome-project",
"default_branch": "master",
"homepage": "https://gitlab.com/tomaszkolek0/my-awesome-project",
"url": "git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"ssh_url": "git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"http_url": "https://gitlab.com/tomaszkolek0/my-awesome-project.git"
},
"repository": {
"name": "my-awesome-project",
"url": "git@gitlab.com:tomaszkolek0/my-awesome-project.git",
"description": "",
"homepage": "https://gitlab.com/tomaszkolek0/my-awesome-project"
},
"object_attributes": {
"id": 14172058,
"note": "Nice snippet",
"noteable_type": "Snippet",
"author_id": 670043,
"created_at": "2016-08-22 19:46:01 UTC",
"updated_at": "2016-08-22 19:46:01 UTC",
"project_id": 1534233,
"attachment": null,
"line_code": null,
"commit_id": "",
"noteable_id": 2788404,
"system": false,
"st_diff": null,
"url": "https://gitlab.com/tomaszkolek0/my-awesome-project/snippets/2#note_14172058"
},
"snippet": {
"id": 2,
"title": "test",
"content": "puts 'Hello world'",
"author_id": 670043,
"project_id": 1534233,
"created_at": "2016-08-21 17:36:01 UTC",
"updated_at": "2016-08-22 19:46:01 UTC",
"file_name": "README.md",
"expires_at": null,
"type": "ProjectSnippet",
"visibility_level": 0
}
}

View File

@ -224,20 +224,20 @@ class GitlabHookTests(WebhookTestCase):
)
def test_note_commit_event_message(self) -> None:
expected_topic = "my-awesome-project"
expected_message = "Tomasz Kolek [commented](https://gitlab.com/tomaszkolek0/my-awesome-project/commit/66abd2da28809ffa128ed0447965cf11d7f863a7#note_14169211) on [66abd2da288](https://gitlab.com/tomaszkolek0/my-awesome-project/commit/66abd2da28809ffa128ed0447965cf11d7f863a7):\n~~~ quote\nnice commit\n~~~"
expected_topic = "testing-zulip-gitlab-integration"
expected_message = "Satyam Bansal [commented](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/commit/82689ddf00fd7bdadb5c2afb3b94bd555edc9d01#note_1406241063) on [82689ddf00f](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/commit/82689ddf00fd7bdadb5c2afb3b94bd555edc9d01):\n~~~ quote\nWow what a beautiful commit.\n~~~"
self.check_webhook("note_hook__commit_note", expected_topic, expected_message)
def test_note_merge_request_event_message(self) -> None:
expected_topic = "my-awesome-project / MR #1 Tomek"
expected_message = "Tomasz Kolek [commented](https://gitlab.com/tomaszkolek0/my-awesome-project/merge_requests/1#note_14171860) on [MR #1](https://gitlab.com/tomaszkolek0/my-awesome-project/merge_requests/1):\n\n~~~ quote\nNice merge request!\n~~~"
expected_topic = "testing-zulip-gitlab-integration / MR #1 add new-feature"
expected_message = "Satyam Bansal [commented](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/merge_requests/1#note_1406328457) on [MR #1](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/merge_requests/1):\n\n~~~ quote\nI am not sure if this new feature is even required or not.\n~~~"
self.check_webhook("note_hook__merge_request_note", expected_topic, expected_message)
def test_note_merge_request_event_message_without_merge_request_title(self) -> None:
expected_topic = "my-awesome-project / MR #1"
expected_message = "Tomasz Kolek [commented](https://gitlab.com/tomaszkolek0/my-awesome-project/merge_requests/1#note_14171860) on [MR #1](https://gitlab.com/tomaszkolek0/my-awesome-project/merge_requests/1):\n\n~~~ quote\nNice merge request!\n~~~"
expected_topic = "testing-zulip-gitlab-integration / MR #1"
expected_message = "Satyam Bansal [commented](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/merge_requests/1#note_1406328457) on [MR #1](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/merge_requests/1):\n\n~~~ quote\nI am not sure if this new feature is even required or not.\n~~~"
# To keep things as valid JSON.
self.url = self.build_webhook_url(use_merge_request_title="false")
self.check_webhook("note_hook__merge_request_note", expected_topic, expected_message)
@ -245,39 +245,45 @@ class GitlabHookTests(WebhookTestCase):
def test_note_merge_request_with_custom_topic_in_url(self) -> None:
self.url = self.build_webhook_url(topic="notifications")
expected_topic = "notifications"
expected_message = "[[my-awesome-project](https://gitlab.com/tomaszkolek0/my-awesome-project)] Tomasz Kolek [commented](https://gitlab.com/tomaszkolek0/my-awesome-project/merge_requests/1#note_14171860) on [MR #1 Tomek](https://gitlab.com/tomaszkolek0/my-awesome-project/merge_requests/1):\n\n~~~ quote\nNice merge request!\n~~~"
expected_message = "[[testing-zulip-gitlab-integration](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration)] Satyam Bansal [commented](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/merge_requests/1#note_1406328457) on [MR #1 add new-feature](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/merge_requests/1):\n\n~~~ quote\nI am not sure if this new feature is even required or not.\n~~~"
self.check_webhook("note_hook__merge_request_note", expected_topic, expected_message)
def test_note_issue_event_message(self) -> None:
expected_topic = "my-awesome-project / issue #2 abc"
expected_message = "Tomasz Kolek [commented](https://gitlab.com/tomaszkolek0/my-awesome-project/issues/2#note_14172057) on [issue #2](https://gitlab.com/tomaszkolek0/my-awesome-project/issues/2):\n\n~~~ quote\nNice issue\n~~~"
expected_topic = "testing-zulip-gitlab-integration / issue #1 Add more lines"
expected_message = "Satyam Bansal [commented](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/issues/1#note_1406279810) on [issue #1](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/issues/1):\n\n~~~ quote\nThis is again a random comment.\n~~~"
self.check_webhook("note_hook__issue_note", expected_topic, expected_message)
def test_note_confidential_issue_event_message(self) -> None:
expected_subject = "Test / issue #3 Test"
expected_message = "Joe Bloggs [commented](https://gitlab.com/joebloggs/test/issues/3#note_101638770) on [issue #3](https://gitlab.com/joebloggs/test/issues/3):\n\n~~~ quote\nTest\n~~~"
expected_subject = "testing-zulip-gitlab-integration / issue #1 Add more lines"
expected_message = "Satyam Bansal [commented](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/issues/1#note_1406130881) on [issue #1](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/issues/1):\n\n~~~ quote\nSome more comments\n~~~"
self.check_webhook("note_hook__confidential_issue_note", expected_subject, expected_message)
def test_note_issue_with_custom_topic_in_url(self) -> None:
self.url = self.build_webhook_url(topic="notifications")
expected_topic = "notifications"
expected_message = "[[my-awesome-project](https://gitlab.com/tomaszkolek0/my-awesome-project)] Tomasz Kolek [commented](https://gitlab.com/tomaszkolek0/my-awesome-project/issues/2#note_14172057) on [issue #2 abc](https://gitlab.com/tomaszkolek0/my-awesome-project/issues/2):\n\n~~~ quote\nNice issue\n~~~"
expected_message = "[[testing-zulip-gitlab-integration](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration)] Satyam Bansal [commented](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/issues/1#note_1406279810) on [issue #1 Add more lines](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/issues/1):\n\n~~~ quote\nThis is again a random comment.\n~~~"
self.check_webhook("note_hook__issue_note", expected_topic, expected_message)
def test_note_snippet_event_message(self) -> None:
def test_note_snippet_old_event_message(self) -> None:
expected_topic = "my-awesome-project / snippet #2 test"
expected_message = "Tomasz Kolek [commented](https://gitlab.com/tomaszkolek0/my-awesome-project/snippets/2#note_14172058) on [snippet #2](https://gitlab.com/tomaszkolek0/my-awesome-project/snippets/2):\n\n~~~ quote\nNice snippet\n~~~"
self.check_webhook("note_hook__snippet_note_old", expected_topic, expected_message)
def test_note_snippet_event_message(self) -> None:
expected_topic = "testing-zulip-gitlab-integration / snippet #2547713 a ver..."
expected_message = "Satyam Bansal [commented](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/snippets/2547713#note_1424268837) on [snippet #2547713](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/snippets/2547713):\n\n~~~ quote\nsome comment\n~~~"
self.check_webhook("note_hook__snippet_note", expected_topic, expected_message)
def test_note_snippet_with_custom_topic_in_url(self) -> None:
self.url = self.build_webhook_url(topic="notifications")
expected_topic = "notifications"
expected_message = "[[my-awesome-project](https://gitlab.com/tomaszkolek0/my-awesome-project)] Tomasz Kolek [commented](https://gitlab.com/tomaszkolek0/my-awesome-project/snippets/2#note_14172058) on [snippet #2 test](https://gitlab.com/tomaszkolek0/my-awesome-project/snippets/2):\n\n~~~ quote\nNice snippet\n~~~"
expected_message = "[[testing-zulip-gitlab-integration](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration)] Satyam Bansal [commented](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/-/snippets/2547713#note_1424268837) on [snippet #2547713 a very new new feature](https://gitlab.com/sbansal1999/testing-zulip-gitlab-integration/snippets/2547713):\n\n~~~ quote\nsome comment\n~~~"
self.check_webhook("note_hook__snippet_note", expected_topic, expected_message)