Skip to content

Commit ef5260a

Browse files
authored
Add missing fields to PipelineObjectAttributes (#176)
Some fields in PipelineObjectAttributes were missing. Reference: https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#pipeline-events Specifically I am interested in the `IID` field, which is the internal id, and it is the only way to do a GraphQL query for pipelines. It supports only to query by IID.
1 parent c4072b5 commit ef5260a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

gitlab/payload.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,8 @@ type ObjectAttributes struct {
685685
// PipelineObjectAttributes contains pipeline specific GitLab object attributes information
686686
type PipelineObjectAttributes struct {
687687
ID int64 `json:"id"`
688+
IID int64 `json:"iid"`
689+
Name string `json:"name"`
688690
Ref string `json:"ref"`
689691
Tag bool `json:"tag"`
690692
SHA string `json:"sha"`
@@ -696,6 +698,7 @@ type PipelineObjectAttributes struct {
696698
FinishedAt customTime `json:"finished_at"`
697699
Duration int64 `json:"duration"`
698700
Variables []Variable `json:"variables"`
701+
Url string `json:"url"`
699702
}
700703

701704
// Variable contains pipeline variables

testdata/gitlab/pipeline-event.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"object_kind": "pipeline",
33
"object_attributes":{
44
"id": 31,
5+
"iid": 3,
6+
"name": "pipeline_name",
57
"ref": "master",
68
"tag": false,
79
"sha": "bcbb5ec396a2c0f828686f14fac9b80b780504f2",
@@ -21,7 +23,8 @@
2123
"key": "NESTOR_PROD_ENVIRONMENT",
2224
"value": "us-west-1"
2325
}
24-
]
26+
],
27+
"url": "http://192.168.64.1:3005/gitlab-org/gitlab-test/-/pipelines/31"
2528
},
2629
"merge_request": {
2730
"id": 1,

0 commit comments

Comments
 (0)