buildkite / feedback

Got feedback? Please let us know!
https://buildkite.com
25 stars 24 forks source link

Jobs that fail and are re-tried not listed in builds/<build-id> api call #503

Closed geuis closed 5 years ago

geuis commented 5 years ago

Accessing a build via the api returns the list of jobs in that build:

https://api.buildkite.com/v2/organizations/{orgId}/pipelines/{pipelineId}/builds/{buildId}

BK will attempt to run a job up to 3x automatically when the job fails.

However, in the list of jobs that is returned none of the jobs that failed are listed. Only the job id of the last successful retry is included. The retries_count value is incremented however.

If you view the build via the web url, the jobs and their retries are grouped together and all of the logs for both failed and successful retries are accessible.

image

If the job id of one of the failed jobs is used in the api call for an individual job's log, that data is available in the api.

https://api.buildkite.com/v2/organizations/{orgId}/pipelines/{pipelineId}/builds/{buildId}/jobs/{jobId}/log

Also, none of the state query string filters listed for /builds seems to work for individual /builds/{buildId} end points. https://buildkite.com/docs/apis/rest-api/builds#list-builds-for-a-pipeline. If all job indices would be included and state filtering worked, it would allow easy filtering of jobs based on need.

What's needed: The job id's of all retries should be available in the api call.

geuis commented 5 years ago

@sj26 got back to me on Slack. Re-posting his reply as the answer here:

Sorry for that, to maintain backwards compatibility we didn't want to add retried jobs into the responses unless opted in. You can add `include_retried_jobs=true` in the params to include them.