Skip to content

Commit 0e86a55

Browse files
authored
Merge branch 'master' into add-graphql
2 parents 4d43d72 + dacaa1e commit 0e86a55

File tree

3 files changed

+32
-30
lines changed

3 files changed

+32
-30
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# buildkite-go [![GoDoc](https://img.shields.io/badge/godoc-Reference-brightgreen.svg?style=flat)](http://godoc.org/github.com/buildkite/go-buildkite) [![Build status](https://badge.buildkite.com/b16a0d730b8732a1cfba06068f8450aa7cc4b2cf40eb6e6717.svg?branch=master)](https://buildkite.com/buildkite/go-buildkite)
1+
# buildkite-go [![Go Reference](https://pkg.go.dev/badge/github.com/buildkite/go-buildkite.svg)](https://pkg.go.dev/github.com/buildkite/go-buildkite/v2) [![Build status](https://badge.buildkite.com/b16a0d730b8732a1cfba06068f8450aa7cc4b2cf40eb6e6717.svg?branch=master)](https://buildkite.com/buildkite/go-buildkite)
22

33
A [Go](http://golang.org) library and client for the [Buildkite API](https://buildkite.com/docs/api). This project draws a lot of it's structure and testing methods from [go-github](https://github.com/google/go-github).
44

buildkite/jobs.go

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,37 @@ type JobsService struct {
1313
}
1414

1515
// Job represents a job run during a build in buildkite
16-
type Job struct {
16+
type Job struct {
1717
ID *string `json:"id,omitempty" yaml:"id,omitempty"`
1818
GraphQLID *string `json:"graphql_id,omitempty" yaml:"graphql_id,omitempty"`
19-
Type *string `json:"type,omitempty" yaml:"type,omitempty"`
20-
Name *string `json:"name,omitempty" yaml:"name,omitempty"`
21-
Label *string `json:"label,omitempty" yaml:"label,omitempty"`
22-
StepKey *string `json:"step_key,omitempty" yaml:"step_key,omitempty"`
23-
State *string `json:"state,omitempty" yaml:"state,omitempty"`
24-
LogsURL *string `json:"logs_url,omitempty" yaml:"logs_url,omitempty"`
25-
RawLogsURL *string `json:"raw_log_url,omitempty" yaml:"raw_log_url,omitempty"`
26-
Command *string `json:"command,omitempty" yaml:"command,omitempty"`
27-
ExitStatus *int `json:"exit_status,omitempty" yaml:"exit_status,omitempty"`
28-
ArtifactPaths *string `json:"artifact_paths,omitempty" yaml:"artifact_paths,omitempty"`
29-
ArtifactsURL *string `json:"artifacts_url,omitempty" yaml:"artifacts_url,omitempty"`
30-
CreatedAt *Timestamp `json:"created_at,omitempty" yaml:"created_at,omitempty"`
31-
ScheduledAt *Timestamp `json:"scheduled_at,omitempty" yaml:"scheduled_at,omitempty"`
32-
RunnableAt *Timestamp `json:"runnable_at,omitempty" yaml:"runnable_at,omitempty"`
33-
StartedAt *Timestamp `json:"started_at,omitempty" yaml:"started_at,omitempty"`
34-
FinishedAt *Timestamp `json:"finished_at,omitempty" yaml:"finished_at,omitempty"`
35-
Agent Agent `json:"agent,omitempty" yaml:"agent,omitempty"`
36-
AgentQueryRules []string `json:"agent_query_rules,omitempty" yaml:"agent_query_rules,omitempty"`
37-
WebURL string `json:"web_url" yaml:"web_url"`
38-
Retried bool `json:"retried,omitempty" yaml:"retried,omitempty"`
39-
RetriedInJobID string `json:"retried_in_job_id,omitempty" yaml:"retried_in_job_id,omitempty"`
40-
RetriesCount int `json:"retries_count,omitempty" yaml:"retries_count,omitempty"`
41-
SoftFailed bool `json:"soft_failed,omitempty" yaml:"soft_failed,omitempty"`
42-
UnblockedBy *UnblockedBy `json:"unblocked_by,omitempty" yaml:"unblocked_by,omitempty"`
43-
Unblockable *bool `json:"unblockable,omitempty" yaml:"unblockable,omitempty"`
44-
UnblockURL *string `json:"unblock_url,omitempty" yaml:"unblock_url,omitempty"`
19+
Type *string `json:"type,omitempty" yaml:"type,omitempty"`
20+
Name *string `json:"name,omitempty" yaml:"name,omitempty"`
21+
Label *string `json:"label,omitempty" yaml:"label,omitempty"`
22+
StepKey *string `json:"step_key,omitempty" yaml:"step_key,omitempty"`
23+
State *string `json:"state,omitempty" yaml:"state,omitempty"`
24+
LogsURL *string `json:"logs_url,omitempty" yaml:"logs_url,omitempty"`
25+
RawLogsURL *string `json:"raw_log_url,omitempty" yaml:"raw_log_url,omitempty"`
26+
Command *string `json:"command,omitempty" yaml:"command,omitempty"`
27+
ExitStatus *int `json:"exit_status,omitempty" yaml:"exit_status,omitempty"`
28+
ArtifactPaths *string `json:"artifact_paths,omitempty" yaml:"artifact_paths,omitempty"`
29+
ArtifactsURL *string `json:"artifacts_url,omitempty" yaml:"artifacts_url,omitempty"`
30+
CreatedAt *Timestamp `json:"created_at,omitempty" yaml:"created_at,omitempty"`
31+
ScheduledAt *Timestamp `json:"scheduled_at,omitempty" yaml:"scheduled_at,omitempty"`
32+
RunnableAt *Timestamp `json:"runnable_at,omitempty" yaml:"runnable_at,omitempty"`
33+
StartedAt *Timestamp `json:"started_at,omitempty" yaml:"started_at,omitempty"`
34+
FinishedAt *Timestamp `json:"finished_at,omitempty" yaml:"finished_at,omitempty"`
35+
Agent Agent `json:"agent,omitempty" yaml:"agent,omitempty"`
36+
AgentQueryRules []string `json:"agent_query_rules,omitempty" yaml:"agent_query_rules,omitempty"`
37+
WebURL string `json:"web_url" yaml:"web_url"`
38+
Retried bool `json:"retried,omitempty" yaml:"retried,omitempty"`
39+
RetriedInJobID string `json:"retried_in_job_id,omitempty" yaml:"retried_in_job_id,omitempty"`
40+
RetriesCount int `json:"retries_count,omitempty" yaml:"retries_count,omitempty"`
41+
SoftFailed bool `json:"soft_failed,omitempty" yaml:"soft_failed,omitempty"`
42+
UnblockedBy *UnblockedBy `json:"unblocked_by,omitempty" yaml:"unblocked_by,omitempty"`
43+
Unblockable *bool `json:"unblockable,omitempty" yaml:"unblockable,omitempty"`
44+
UnblockURL *string `json:"unblock_url,omitempty" yaml:"unblock_url,omitempty"`
45+
ParallelGroupIndex *string `json:"parallel_group_index,omitempty" yaml:"parallel_group_index,omitempty"`
46+
ParallelGroupTotal *string `json:"parallel_group_total,omitempty" yaml:"parallel_group_total,omitempty"`
4547
}
4648

4749
// UnblockedBy represents the unblocked status of a job, when present
@@ -165,4 +167,3 @@ func (js *JobsService) GetJobEnvironmentVariables(org string, pipeline string, b
165167

166168
return jobEnvs, resp, err
167169
}
168-

buildkite/pipelines.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ type Pipeline struct {
7979
type Step struct {
8080
Type *string `json:"type,omitempty" yaml:"type,omitempty"`
8181
Name *string `json:"name,omitempty" yaml:"name,omitempty"`
82+
Label *string `json:"label,omitempty" yaml:"label,omitempty"`
8283
Command *string `json:"command,omitempty" yaml:"command,omitempty"`
8384
ArtifactPaths *string `json:"artifact_paths,omitempty" yaml:"artifact_paths,omitempty"`
8485
BranchConfiguration *string `json:"branch_configuration,omitempty" yaml:"branch_configuration,omitempty"`
@@ -100,7 +101,7 @@ func (p *Plugins) UnmarshalJSON(bs []byte) error {
100101

101102
asArray := []map[string]Plugin{}
102103
if err2 := json.Unmarshal(bs, &asArray); err2 != nil {
103-
return fmt.Errorf("plugins are neither a map or an array: %w, %w", err, err2)
104+
return fmt.Errorf("plugins are neither a map or an array: %s, %s", err.Error(), err2.Error())
104105
}
105106
for _, plugin := range asArray {
106107
if len(plugin) != 1 {

0 commit comments

Comments
 (0)