From e55d994db56162ddf580ab444eb0f5cd7da1b050 Mon Sep 17 00:00:00 2001 From: Riyadh Al Nur Date: Sun, 2 May 2021 16:10:26 +0800 Subject: [PATCH] FIX: gitlab merge request event assignee payload - gitlab updated their MR payload which adds a parent field for the list of assignees - this fix update the Assignee struct to add the missing `Email` and `ID` field - adds an array of assignees as part of the MR event payload Closes #101 --- gitlab/payload.go | 3 +++ testdata/gitlab/merge-request-event.json | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gitlab/payload.go b/gitlab/payload.go index 97ba3ec..3bf4e9f 100644 --- a/gitlab/payload.go +++ b/gitlab/payload.go @@ -57,6 +57,7 @@ type MergeRequestEventPayload struct { Project Project `json:"project"` Repository Repository `json:"repository"` Labels []Label `json:"labels"` + Assignees []Assignee `json:"assignees"` } // PushEventPayload contains the information for GitLab's push event @@ -449,9 +450,11 @@ type MergeRequest struct { // Assignee contains all of the GitLab assignee information type Assignee struct { + ID int64 `json:"id"` Name string `json:"name"` Username string `json:"username"` AvatarURL string `json:"avatar_url"` + Email string `json:"email"` } // StDiff contains all of the GitLab diff information diff --git a/testdata/gitlab/merge-request-event.json b/testdata/gitlab/merge-request-event.json index eb890fb..785427c 100644 --- a/testdata/gitlab/merge-request-event.json +++ b/testdata/gitlab/merge-request-event.json @@ -136,5 +136,14 @@ "group_id": 41 }] } - } + }, + "assignees": [ + { + "id": 6, + "name": "User1", + "username": "user1", + "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon", + "email": "user1@gmail.com" + } + ] } \ No newline at end of file