Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update current gitlab merge request event payload #99

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions gitlab/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,27 +488,11 @@ type Author struct {
Email string `json:"email"`
}

// Changes contains all changes associated with a GitLab issue or MR
type Changes struct {
LabelChanges LabelChanges `json:"labels"`
}

// LabelChanges contains changes in labels assocatiated with a GitLab issue or MR
type LabelChanges struct {
Previous []Label `json:"previous"`
Current []Label `json:"current"`
}
// Changes contains all the changes in a MergeRequest
type Changes map[string]Change

// Label contains all of the GitLab label information
type Label struct {
ID int64 `json:"id"`
Title string `json:"title"`
Color string `json:"color"`
ProjectID int64 `json:"project_id"`
CreatedAt customTime `json:"created_at"`
UpdatedAt customTime `json:"updated_at"`
Template bool `json:"template"`
Description string `json:"description"`
Type string `json:"type"`
GroupID int64 `json:"group_id"`
// Change is an individual change of a field in a MergeRequest
type Change struct {
Current interface{} `json:"current"`
Previous interface{} `json:"previous"`
}
12 changes: 9 additions & 3 deletions testdata/gitlab/merge-request-event.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@
"group_id": 41
}],
"changes": {
"updated_by_id": [null, 1],
"updated_at": ["2017-09-15 16:50:55 UTC", "2017-09-15 16:52:00 UTC"],
"updated_by_id": {
"previous": null,
"current": 1
},
"updated_at": {
"previous": "2017-09-15 16:50:55 UTC",
"current":"2017-09-15 16:52:00 UTC"
},
"labels": {
"previous": [{
"id": 206,
Expand Down Expand Up @@ -137,4 +143,4 @@
}]
}
}
}
}