Commit 307a77e0 authored by nyxi's avatar nyxi Committed by Sander van Harmelen

BuildEvent BuildDuration is a float (#203)

* 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

* BuildEvent BuildDuration is a float, not a string

* float64
parent 56d975a6
...@@ -527,21 +527,21 @@ type PipelineEvent struct { ...@@ -527,21 +527,21 @@ type PipelineEvent struct {
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/web_hooks/web_hooks.html#build-events // https://docs.gitlab.com/ce/web_hooks/web_hooks.html#build-events
type BuildEvent struct { type BuildEvent struct {
ObjectKind string `json:"object_kind"` ObjectKind string `json:"object_kind"`
Ref string `json:"ref"` Ref string `json:"ref"`
Tag bool `json:"tag"` Tag bool `json:"tag"`
BeforeSha string `json:"before_sha"` BeforeSha string `json:"before_sha"`
Sha string `json:"sha"` Sha string `json:"sha"`
BuildID int `json:"build_id"` BuildID int `json:"build_id"`
BuildName string `json:"build_name"` BuildName string `json:"build_name"`
BuildStage string `json:"build_stage"` BuildStage string `json:"build_stage"`
BuildStatus string `json:"build_status"` BuildStatus string `json:"build_status"`
BuildStartedAt string `json:"build_started_at"` BuildStartedAt string `json:"build_started_at"`
BuildFinishedAt string `json:"build_finished_at"` BuildFinishedAt string `json:"build_finished_at"`
BuildDuration string `json:"build_duration"` BuildDuration float64 `json:"build_duration"`
BuildAllowFailure bool `json:"build_allow_failure"` BuildAllowFailure bool `json:"build_allow_failure"`
ProjectID int `json:"project_id"` ProjectID int `json:"project_id"`
ProjectName string `json:"project_name"` ProjectName string `json:"project_name"`
User struct { User struct {
ID int `json:"id"` ID int `json:"id"`
Name string `json:"name"` Name string `json:"name"`
......
...@@ -391,7 +391,7 @@ func TestBuildEventUnmarshal(t *testing.T) { ...@@ -391,7 +391,7 @@ func TestBuildEventUnmarshal(t *testing.T) {
"build_status": "created", "build_status": "created",
"build_started_at": null, "build_started_at": null,
"build_finished_at": null, "build_finished_at": null,
"build_duration": null, "build_duration": 23.265997,
"build_allow_failure": false, "build_allow_failure": false,
"project_id": 380, "project_id": 380,
"project_name": "gitlab-org/gitlab-test", "project_name": "gitlab-org/gitlab-test",
......
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