diff --git a/jobs.go b/jobs.go index b238fc8e9..c70e12094 100644 --- a/jobs.go +++ b/jobs.go @@ -48,10 +48,11 @@ type Job struct { ID int `json:"id"` Name string `json:"name"` Pipeline struct { - ID int `json:"id"` - Ref string `json:"ref"` - Sha string `json:"sha"` - Status string `json:"status"` + ID int `json:"id"` + ProjectID int `json:"project_id"` + Ref string `json:"ref"` + Sha string `json:"sha"` + Status string `json:"status"` } `json:"pipeline"` Ref string `json:"ref"` Artifacts []struct { diff --git a/jobs_test.go b/jobs_test.go index 9c39080ef..8a171a834 100644 --- a/jobs_test.go +++ b/jobs_test.go @@ -70,6 +70,7 @@ func TestJobsService_ListProjectJobs(t *testing.T) { "name": "teaspoon", "pipeline": { "id": 6, + "project_id": 1, "ref": "master", "sha": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", "status": "pending" @@ -100,6 +101,7 @@ func TestJobsService_ListProjectJobs(t *testing.T) { "name": "rspec:other", "pipeline": { "id": 6, + "project_id": 1, "ref": "master", "sha": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", "status": "pending" @@ -133,15 +135,17 @@ func TestJobsService_ListProjectJobs(t *testing.T) { Name: "teaspoon", TagList: []string{"docker runner", "ubuntu18"}, Pipeline: struct { - ID int `json:"id"` - Ref string `json:"ref"` - Sha string `json:"sha"` - Status string `json:"status"` + ID int `json:"id"` + ProjectID int `json:"project_id"` + Ref string `json:"ref"` + Sha string `json:"sha"` + Status string `json:"status"` }{ - ID: 6, - Ref: "master", - Sha: "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", - Status: "pending", + ID: 6, + ProjectID: 1, + Ref: "master", + Sha: "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", + Status: "pending", }, Ref: "master", Stage: "test", @@ -165,15 +169,17 @@ func TestJobsService_ListProjectJobs(t *testing.T) { Name: "rspec:other", TagList: []string{"docker runner", "win10-2004"}, Pipeline: struct { - ID int `json:"id"` - Ref string `json:"ref"` - Sha string `json:"sha"` - Status string `json:"status"` + ID int `json:"id"` + ProjectID int `json:"project_id"` + Ref string `json:"ref"` + Sha string `json:"sha"` + Status string `json:"status"` }{ - ID: 6, - Ref: "master", - Sha: "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", - Status: "pending", + ID: 6, + ProjectID: 1, + Ref: "master", + Sha: "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", + Status: "pending", }, Ref: "master", Stage: "test", diff --git a/runners_test.go b/runners_test.go index 27faf188c..ee8cfedfa 100644 --- a/runners_test.go +++ b/runners_test.go @@ -56,15 +56,17 @@ func TestListRunnersJobs(t *testing.T) { } pipeline := struct { - ID int `json:"id"` - Ref string `json:"ref"` - Sha string `json:"sha"` - Status string `json:"status"` + ID int `json:"id"` + ProjectID int `json:"project_id"` + Ref string `json:"ref"` + Sha string `json:"sha"` + Status string `json:"status"` }{ - ID: 8777, - Ref: "master", - Sha: "6c016b801a88f4bd31f927fc045b5c746a6f823e", - Status: "failed", + ID: 8777, + ProjectID: 3252, + Ref: "master", + Sha: "6c016b801a88f4bd31f927fc045b5c746a6f823e", + Status: "failed", } want := []*Job{