Skip to content

Commit

Permalink
Merge pull request #1518 from go-faster/feat/jobs/pipeline.project_id
Browse files Browse the repository at this point in the history
feat(jobs): add pipeline.project_id
  • Loading branch information
svanharmelen committed Aug 9, 2022
2 parents f9cd878 + 8cc3651 commit 1ced135
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 28 deletions.
9 changes: 5 additions & 4 deletions jobs.go
Expand Up @@ -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 {
Expand Down
38 changes: 22 additions & 16 deletions jobs_test.go
Expand Up @@ -70,6 +70,7 @@ func TestJobsService_ListProjectJobs(t *testing.T) {
"name": "teaspoon",
"pipeline": {
"id": 6,
"project_id": 1,
"ref": "master",
"sha": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
"status": "pending"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
18 changes: 10 additions & 8 deletions runners_test.go
Expand Up @@ -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{
Expand Down

0 comments on commit 1ced135

Please sign in to comment.