Skip to content

Add build-wide retries for failed jobs - #1053

Merged
mcncl merged 2 commits into
mainfrom
feat/build_retry_failed_jobs
Oct 19, 2026
Merged

mcncl merged 2 commits into
mainfrom
feat/build_retry_failed_jobs

Conversation

@mcncl

@mcncl mcncl commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Description

Add bk build retry-failed-jobs to queue retries in an existing build using the public REST endpoint, instead of retrying jobs individually.

bk build retry-failed-jobs acme/my-pipeline/123 --states failed,soft_failed --yes --no-input --json

Changes

  • Accept a build number with a pipeline, org/pipeline/number, or a Buildkite build URL, using the target organization's credentials.
  • Retry all retryable failed jobs by default, or select failure types with --states. Require confirmation unless --yes is supplied, and reject malformed or conflicting targets before retrying.
  • Return JSON, YAML, or text with the queued-job count from 202 Accepted. This does not wait for completion or establish that jobs are safe to rerun; retries are not limited to infrastructure failures and may repeat deployment side effects.
  • Keep structured stdout free of prompts and warn callers to check the build before resubmitting if an accepted request's receipt cannot be read or written.

Testing

  • Tests have run locally (env -u BUILDKITE_API_TOKEN go test ./... -count=1)
  • Code is formatted with the repository's pinned gofumpt
  • Synthetic HTTP tests cover state selection, confirmation, target credentials, selector rejection, async counts, API errors, and receipt failures. No real retry requests were made.
  • go vet ./... and golangci-lint run --timeout 3m pass.

Queue retries for an existing build with explicit confirmation and
JSON, YAML, or text receipts. Validate targets before writing and
report asynchronous acceptance without implying successful completion.
@mcncl
mcncl requested review from a team as code owners October 19, 2026 02:11
buildsworth-bk-app[bot]
buildsworth-bk-app Bot previously approved these changes Oct 19, 2026
Keep annotation, step upload, and retry commands registered and
documented together. Preserve configured quiet mode during retry
pipeline discovery and cover it with terminal-backed tests.
@buildsworth-bk-app
buildsworth-bk-app Bot dismissed their stale review October 19, 2026 04:08

Superseded by a newer Buildsworth review.

@mcncl
mcncl enabled auto-merge (squash) October 19, 2026 04:08
@mcncl
mcncl merged commit 702f29c into main Oct 19, 2026
2 checks passed
@mcncl
mcncl deleted the feat/build_retry_failed_jobs branch October 19, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant