Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jobs): add pipeline.project_id #1518

Merged
merged 1 commit into from Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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