Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
9c5f26ed
Commit
9c5f26ed
authored
Apr 30, 2019
by
Romain Maneschi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updatedById is not an array of int but an object like other fields
parent
4baaa27b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
10 deletions
+37
-10
event_parsing_test.go
event_parsing_test.go
+21
-6
event_types.go
event_types.go
+8
-2
event_types_test.go
event_types_test.go
+8
-2
No files found.
event_parsing_test.go
View file @
9c5f26ed
...
...
@@ -3,6 +3,7 @@ package gitlab
import
(
"net/http"
"testing"
"github.com/stretchr/testify/assert"
)
...
...
@@ -260,8 +261,14 @@ func TestParseIssueHook(t *testing.T) {
"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,
...
...
@@ -317,7 +324,8 @@ func TestParseIssueHook(t *testing.T) {
t
.
Errorf
(
"Assignee username is %v, want %v"
,
event
.
Assignee
.
Username
,
"user1"
)
}
assert
.
Equal
(
t
,
1
,
len
(
event
.
Labels
))
assert
.
Equal
(
t
,
[]
int
{
0
,
1
},
event
.
Changes
.
UpdatedByID
)
assert
.
Equal
(
t
,
0
,
event
.
Changes
.
UpdatedByID
.
Previous
)
assert
.
Equal
(
t
,
1
,
event
.
Changes
.
UpdatedByID
.
Current
)
assert
.
Equal
(
t
,
1
,
len
(
event
.
Changes
.
Labels
.
Previous
))
assert
.
Equal
(
t
,
1
,
len
(
event
.
Changes
.
Labels
.
Current
))
}
...
...
@@ -855,8 +863,14 @@ func TestParseMergeRequestHook(t *testing.T) {
"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,
...
...
@@ -912,7 +926,8 @@ func TestParseMergeRequestHook(t *testing.T) {
t
.
Errorf
(
"WorkInProgress is %v, want %v"
,
event
.
ObjectAttributes
.
WorkInProgress
,
false
)
}
assert
.
Equal
(
t
,
1
,
len
(
event
.
Labels
))
assert
.
Equal
(
t
,
[]
int
{
0
,
1
},
event
.
Changes
.
UpdatedByID
)
assert
.
Equal
(
t
,
0
,
event
.
Changes
.
UpdatedByID
.
Previous
)
assert
.
Equal
(
t
,
1
,
event
.
Changes
.
UpdatedByID
.
Current
)
assert
.
Equal
(
t
,
1
,
len
(
event
.
Changes
.
Labels
.
Previous
))
assert
.
Equal
(
t
,
1
,
len
(
event
.
Changes
.
Labels
.
Current
))
}
...
...
event_types.go
View file @
9c5f26ed
...
...
@@ -173,7 +173,10 @@ type IssueEvent struct {
Previous
[]
Label
`json:"previous"`
Current
[]
Label
`json:"current"`
}
`json:"labels"`
UpdatedByID
[]
int
`json:"updated_by_id"`
UpdatedByID
struct
{
Previous
int
`json:"previous"`
Current
int
`json:"current"`
}
`json:"updated_by_id"`
}
`json:"changes"`
}
...
...
@@ -584,7 +587,10 @@ type MergeEvent struct {
Previous
[]
Label
`json:"previous"`
Current
[]
Label
`json:"current"`
}
`json:"labels"`
UpdatedByID
[]
int
`json:"updated_by_id"`
UpdatedByID
struct
{
Previous
int
`json:"previous"`
Current
int
`json:"current"`
}
`json:"updated_by_id"`
}
`json:"changes"`
}
...
...
event_types_test.go
View file @
9c5f26ed
...
...
@@ -214,8 +214,14 @@ func TestMergeEventUnmarshal(t *testing.T) {
"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,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment