forked from jenkins-x/go-scm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Edited GitLab MR should be an update action, not a sync
Signed-off-by: Andrew Bayer <[email protected]>
- Loading branch information
Showing
4 changed files
with
238 additions
and
8 deletions.
There are no files selected for viewing
154 changes: 154 additions & 0 deletions
154
scm/driver/gitlab/testdata/webhooks/pull_request_edited.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
{ | ||
"object_kind": "merge_request", | ||
"user": { | ||
"name": "Sid Sijbrandij", | ||
"username": "sytses", | ||
"avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87?s=80&d=identicon" | ||
}, | ||
"project": { | ||
"id": 4861503, | ||
"name": "hello-world", | ||
"description": "", | ||
"web_url": "https://gitlab.com/gitlab-org/hello-world", | ||
"avatar_url": null, | ||
"git_ssh_url": "[email protected]:gitlab-org/hello-world.git", | ||
"git_http_url": "https://gitlab.com/gitlab-org/hello-world.git", | ||
"namespace": "sytses", | ||
"visibility_level": 0, | ||
"path_with_namespace": "gitlab-org/hello-world", | ||
"default_branch": "master", | ||
"ci_config_path": null, | ||
"homepage": "https://gitlab.com/gitlab-org/hello-world", | ||
"url": "[email protected]:gitlab-org/hello-world.git", | ||
"ssh_url": "[email protected]:gitlab-org/hello-world.git", | ||
"http_url": "https://gitlab.com/gitlab-org/hello-world.git" | ||
}, | ||
"object_attributes": { | ||
"assignee_id": null, | ||
"author_id": 51764, | ||
"created_at": "2017-12-10 17:01:11 UTC", | ||
"deleted_at": null, | ||
"description": "adding build instructions to readme", | ||
"head_pipeline_id": null, | ||
"id": 6632669, | ||
"iid": 1, | ||
"last_edited_at": null, | ||
"last_edited_by_id": null, | ||
"merge_commit_sha": null, | ||
"merge_error": null, | ||
"merge_params": { | ||
"force_remove_source_branch": "0" | ||
}, | ||
"merge_status": "unchecked", | ||
"merge_user_id": null, | ||
"merge_when_pipeline_succeeds": false, | ||
"milestone_id": null, | ||
"source_branch": "feature", | ||
"source_project_id": 4861503, | ||
"state": "opened", | ||
"target_branch": "master", | ||
"target_project_id": 4861503, | ||
"time_estimate": 0, | ||
"title": "update readme", | ||
"updated_at": "2017-12-10 17:01:11 UTC", | ||
"updated_by_id": null, | ||
"url": "https://gitlab.com/gitlab-org/hello-world/merge_requests/1", | ||
"source": { | ||
"id": 4861503, | ||
"name": "hello-world", | ||
"description": "", | ||
"web_url": "https://gitlab.com/gitlab-org/hello-world", | ||
"avatar_url": null, | ||
"git_ssh_url": "[email protected]:gitlab-org/hello-world.git", | ||
"git_http_url": "https://gitlab.com/gitlab-org/hello-world.git", | ||
"namespace": "sytses", | ||
"visibility_level": 0, | ||
"path_with_namespace": "gitlab-org/hello-world", | ||
"default_branch": "master", | ||
"ci_config_path": null, | ||
"homepage": "https://gitlab.com/gitlab-org/hello-world", | ||
"url": "[email protected]:gitlab-org/hello-world.git", | ||
"ssh_url": "[email protected]:gitlab-org/hello-world.git", | ||
"http_url": "https://gitlab.com/gitlab-org/hello-world.git" | ||
}, | ||
"target": { | ||
"id": 4861503, | ||
"name": "hello-world", | ||
"description": "", | ||
"web_url": "https://gitlab.com/gitlab-org/hello-world", | ||
"avatar_url": null, | ||
"git_ssh_url": "[email protected]:gitlab-org/hello-world.git", | ||
"git_http_url": "https://gitlab.com/gitlab-org/hello-world.git", | ||
"namespace": "sytses", | ||
"visibility_level": 0, | ||
"path_with_namespace": "gitlab-org/hello-world", | ||
"default_branch": "master", | ||
"ci_config_path": null, | ||
"homepage": "https://gitlab.com/gitlab-org/hello-world", | ||
"url": "[email protected]:gitlab-org/hello-world.git", | ||
"ssh_url": "[email protected]:gitlab-org/hello-world.git", | ||
"http_url": "https://gitlab.com/gitlab-org/hello-world.git" | ||
}, | ||
"last_commit": { | ||
"id": "c4c79227ed610f1151f05bbc5be33b4f340d39c8", | ||
"message": "update readme\n", | ||
"timestamp": "2017-12-10T08:28:36-08:00", | ||
"url": "https://gitlab.com/gitlab-org/hello-world/commit/c4c79227ed610f1151f05bbc5be33b4f340d39c8", | ||
"author": { | ||
"name": "Sid Sijbrandij", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"work_in_progress": false, | ||
"total_time_spent": 0, | ||
"human_total_time_spent": null, | ||
"human_time_estimate": null, | ||
"action": "update" | ||
}, | ||
"labels": [{ | ||
"id": 206, | ||
"title": "API", | ||
"color": "#ffffff", | ||
"project_id": 14, | ||
"created_at": "2013-12-03T17:15:43Z", | ||
"updated_at": "2013-12-03T17:15:43Z", | ||
"template": false, | ||
"description": "API related issues", | ||
"type": "ProjectLabel", | ||
"group_id": 41 | ||
}], | ||
"changes": { | ||
"labels": { | ||
"previous": [{ | ||
"id": 206, | ||
"title": "API", | ||
"color": "#ffffff", | ||
"project_id": 14, | ||
"created_at": "2013-12-03T17:15:43Z", | ||
"updated_at": "2013-12-03T17:15:43Z", | ||
"template": false, | ||
"description": "API related issues", | ||
"type": "ProjectLabel", | ||
"group_id": 41 | ||
}], | ||
"current": [{ | ||
"id": 205, | ||
"title": "Platform", | ||
"color": "#123123", | ||
"project_id": 14, | ||
"created_at": "2013-12-03T17:15:43Z", | ||
"updated_at": "2013-12-03T17:15:43Z", | ||
"template": false, | ||
"description": "Platform related issues", | ||
"type": "ProjectLabel", | ||
"group_id": 41 | ||
}] | ||
} | ||
}, | ||
"repository": { | ||
"name": "hello-world", | ||
"url": "[email protected]:gitlab-org/hello-world.git", | ||
"description": "", | ||
"homepage": "https://gitlab.com/gitlab-org/hello-world" | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
scm/driver/gitlab/testdata/webhooks/pull_request_edited.json.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"Action": "updated", | ||
"Repo": { | ||
"ID": "4861503", | ||
"Namespace": "gitlab-org", | ||
"Name": "hello-world", | ||
"Perm": null, | ||
"Branch": "master", | ||
"Private": false, | ||
"Clone": "https://gitlab.com/gitlab-org/hello-world.git", | ||
"CloneSSH": "[email protected]:gitlab-org/hello-world.git", | ||
"Link": "https://gitlab.com/gitlab-org/hello-world", | ||
"Created": "0001-01-01T00:00:00Z", | ||
"Updated": "0001-01-01T00:00:00Z" | ||
}, | ||
"PullRequest": { | ||
"Number": 1, | ||
"Title": "update readme", | ||
"Body": "adding build instructions to readme", | ||
"State": "open", | ||
"Sha": "c4c79227ed610f1151f05bbc5be33b4f340d39c8", | ||
"Ref": "refs/merge-requests/1/head", | ||
"Base": { | ||
"Ref": "master", | ||
"Repo": { | ||
"ID": "4861503", | ||
"Namespace": "gitlab-org", | ||
"Name": "hello-world", | ||
"Perm": null, | ||
"Branch": "master", | ||
"Private": false, | ||
"Clone": "https://gitlab.com/gitlab-org/hello-world.git", | ||
"CloneSSH": "[email protected]:gitlab-org/hello-world.git", | ||
"Link": "https://gitlab.com/gitlab-org/hello-world", | ||
"Created": "0001-01-01T00:00:00Z", | ||
"Updated": "0001-01-01T00:00:00Z" | ||
} | ||
}, | ||
"Head": { | ||
"Sha": "c4c79227ed610f1151f05bbc5be33b4f340d39c8", | ||
"Repo": { | ||
"ID": "4861503", | ||
"Namespace": "gitlab-org", | ||
"Name": "hello-world", | ||
"Perm": null, | ||
"Branch": "master", | ||
"Private": false, | ||
"Clone": "https://gitlab.com/gitlab-org/hello-world.git", | ||
"CloneSSH": "[email protected]:gitlab-org/hello-world.git", | ||
"Link": "https://gitlab.com/gitlab-org/hello-world", | ||
"Created": "0001-01-01T00:00:00Z", | ||
"Updated": "0001-01-01T00:00:00Z" | ||
} | ||
}, | ||
"Source": "feature", | ||
"Target": "master", | ||
"Fork": "sytses/hello-world", | ||
"Link": "https://gitlab.com/gitlab-org/hello-world/merge_requests/1", | ||
"Closed": false, | ||
"Merged": false, | ||
"Author": { | ||
"Login": "sytses", | ||
"Name": "Sid Sijbrandij", | ||
"Email": "", | ||
"Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87?s=80\u0026d=identicon" | ||
}, | ||
"Created": "0001-01-01T00:00:00Z", | ||
"Updated": "0001-01-01T00:00:00Z" | ||
}, | ||
"Sender": { | ||
"Login": "sytses", | ||
"Name": "Sid Sijbrandij", | ||
"Email": "", | ||
"Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87?s=80\u0026d=identicon" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters