Commit 56d975a6 authored by nyxi's avatar nyxi Committed by Sander van Harmelen

PipelineEvent fixes (#202)

* Fix the PipelineEvent struct, with proper sub struct for Runner and correct type for the artifacts_file 'size' field

* Updated tests for changes to PipelineEvent

* Formatting

* Naming
parent 39ce5fd6
...@@ -509,10 +509,15 @@ type PipelineEvent struct { ...@@ -509,10 +509,15 @@ type PipelineEvent struct {
Username string `json:"username"` Username string `json:"username"`
AvatarURL string `json:"avatar_url"` AvatarURL string `json:"avatar_url"`
} `json:"user"` } `json:"user"`
Runner string `json:"runner"` Runner struct {
ID int `json:"id"`
Description string `json:"description"`
Active bool `json:"active"`
IsShared bool `json:"is_shared"`
} `json:"runner"`
ArtifactsFile struct { ArtifactsFile struct {
Filename string `json:"filename"` Filename string `json:"filename"`
Size string `json:"size"` Size int `json:"size"`
} `json:"artifacts_file"` } `json:"artifacts_file"`
} `json:"builds"` } `json:"builds"`
} }
......
...@@ -284,10 +284,15 @@ func TestPipelineEventUnmarshal(t *testing.T) { ...@@ -284,10 +284,15 @@ func TestPipelineEventUnmarshal(t *testing.T) {
"username": "root", "username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon" "avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
}, },
"runner": null, "runner": {
"id": 6,
"description": "Kubernetes Runner",
"active": true,
"is_shared": true
},
"artifacts_file":{ "artifacts_file":{
"filename": null, "filename": "artifacts.zip",
"size": null "size": 1319148
} }
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment