Skip to content

Commit

Permalink
Merge branch 'main' into sup-1697-add-username-to-author
Browse files Browse the repository at this point in the history
  • Loading branch information
lizrabuya committed Jan 17, 2024
2 parents 6045117 + 7a5d72b commit ff36eb2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions buildkite/builds.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ type PullRequest struct {
Repository *string `json:"repository,omitempty" yaml:"repository,omitempty"`
}

type TriggeredFrom struct {
BuildID *string `json:"build_id,omitempty" yaml:"build_id,omitempty"`
BuildNumber *int `json:"build_number,omitempty" yaml:"build_number,omitempty"`
BuildPipelineSlug *string `json:"build_pipeline_slug,omitempty" yaml:"build_pipeline_slug,omitempty"`
}

// Build represents a build which has run in buildkite
type Build struct {
ID *string `json:"id,omitempty" yaml:"id,omitempty"`
Expand Down Expand Up @@ -94,6 +100,10 @@ type Build struct {

// the pull request this build is associated with
PullRequest *PullRequest `json:"pull_request,omitempty" yaml:"pull_request,omitempty"`

// the build that this build is triggered from
// https://buildkite.com/docs/pipelines/trigger-step
TriggeredFrom *TriggeredFrom `json:"triggered_from,omitempty" yaml:"triggered_from,omitempty"`
}

type MetaDataFilters struct {
Expand Down
8 changes: 8 additions & 0 deletions buildkite/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type Job struct {
ParallelGroupTotal *int `json:"parallel_group_total,omitempty" yaml:"parallel_group_total,omitempty"`
ClusterID *string `json:"cluster_id,omitempty" yaml:"cluster_id,omitempty"`
ClusterQueueID *string `json:"cluster_queue_id,omitempty" yaml:"cluster_queue_id,omitempty"`
TriggeredBuild *TriggeredBuild `json:"triggered_build,omitempty" yaml:"triggered_build,omitempty"`
}

// JobRetrySource represents what triggered this retry.
Expand Down Expand Up @@ -85,6 +86,13 @@ type JobEnvs struct {
EnvironmentVariables *map[string]string `json:"env,string" yaml:"env,string"`
}

type TriggeredBuild struct {
ID *string `json:"id,omitempty" yaml:"id,omitempty"`
Number *int `json:"number,omitempty" yaml:"number,omitempty"`
URL *string `json:"url,omitempty" yaml:"url,omitempty"`
WebURL *string `json:"web_url,omitempty" yaml:"web_url,omitempty"`
}

// UnblockJob - unblock a job
//
// buildkite API docs: https://buildkite.com/docs/apis/rest-api/jobs#unblock-a-job
Expand Down

0 comments on commit ff36eb2

Please sign in to comment.