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

Commit 103dbce

Browse files
authored
Merge pull request #1298 from vntw/fix-pipeline-wh-event
Fix field type of PipelineEvent.[]Builds.Runner.RunnerType
2 parents cdfb4b0 + 7d28f63 commit 103dbce

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

event_parsing_webhook_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ func TestParsePipelineHook(t *testing.T) {
272272
if event.Builds[0].ID != 380 {
273273
t.Errorf("Builds[0] ID is %v, want %v", event.Builds[0].ID, 380)
274274
}
275+
276+
if event.Builds[0].Runner.RunnerType != "instance_type" {
277+
t.Errorf("Builds[0] Runner RunnerType is %v, want %v", event.Builds[0].Runner.RunnerType, "instance_type")
278+
}
275279
}
276280

277281
func TestParsePushHook(t *testing.T) {

event_webhook_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ type PipelineEvent struct {
702702
Description string `json:"description"`
703703
Active bool `json:"active"`
704704
IsShared bool `json:"is_shared"`
705-
RunnerType bool `json:"runner_type"`
705+
RunnerType string `json:"runner_type"`
706706
Tags []string `json:"tags"`
707707
} `json:"runner"`
708708
ArtifactsFile struct {

testdata/webhooks/pipeline.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,17 @@
8686
"email": "[email protected]",
8787
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
8888
},
89-
"runner": null,
89+
"runner": {
90+
"id": 42,
91+
"description": "shared-runners-manager-1.gitlab.com",
92+
"runner_type": "instance_type",
93+
"active": true,
94+
"is_shared": true,
95+
"tags": [
96+
"docker",
97+
"gce"
98+
]
99+
},
90100
"artifacts_file":{
91101
"filename": null,
92102
"size": null

0 commit comments

Comments
 (0)