Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Fix field type of PipelineEvent.[]Builds.Runner.RunnerType
Browse files Browse the repository at this point in the history
It's documented to be of type string, not bool. For more details see #1297
  • Loading branch information
vntw committed Nov 26, 2021
1 parent cdfb4b0 commit 7d28f63
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions event_parsing_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ func TestParsePipelineHook(t *testing.T) {
if event.Builds[0].ID != 380 {
t.Errorf("Builds[0] ID is %v, want %v", event.Builds[0].ID, 380)
}

if event.Builds[0].Runner.RunnerType != "instance_type" {
t.Errorf("Builds[0] Runner RunnerType is %v, want %v", event.Builds[0].Runner.RunnerType, "instance_type")
}
}

func TestParsePushHook(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion event_webhook_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ type PipelineEvent struct {
Description string `json:"description"`
Active bool `json:"active"`
IsShared bool `json:"is_shared"`
RunnerType bool `json:"runner_type"`
RunnerType string `json:"runner_type"`
Tags []string `json:"tags"`
} `json:"runner"`
ArtifactsFile struct {
Expand Down
12 changes: 11 additions & 1 deletion testdata/webhooks/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,17 @@
"email": "[email protected]",
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
},
"runner": null,
"runner": {
"id": 42,
"description": "shared-runners-manager-1.gitlab.com",
"runner_type": "instance_type",
"active": true,
"is_shared": true,
"tags": [
"docker",
"gce"
]
},
"artifacts_file":{
"filename": null,
"size": null
Expand Down

0 comments on commit 7d28f63

Please sign in to comment.