Skip to content

Hide conditionally excluded jobs from bk build watch - #946

Open
JoelTowell wants to merge 3 commits into
buildkite:mainfrom
JoelTowell:fix-bk-watch
Open

Hide conditionally excluded jobs from bk build watch#946
JoelTowell wants to merge 3 commits into
buildkite:mainfrom
JoelTowell:fix-bk-watch

Conversation

@JoelTowell

@JoelTowell JoelTowell commented Aug 14, 2026

Copy link
Copy Markdown

Description

I ran bk build watch against a pipeline with many conditional steps. I found a lot of intentionally skipped steps were noisily logged as broken. After reviewing some documentation, it became clear that broken has a rather idiosyncratic meaning. It seems that it would often mean a job was skipped due to not meeting a conditional branches or if condition.

I think this is undesirable behaviour. If I watch a build, I don't want the output to be polluted with noise about jobs I didn't expect to run in the first place.

Upon inspection, it seems this happens because bk build watch passes the full API build into BuildSummaryWithJobs. This calls renderJobs which does not filter jobs based on their state. From what I can tell, conditionally skipped jobs must be registered as 'broken' before they arrive here. The result is displaying jobs which nobody would reasonably want to 'watch'.

The proposed solution is to filter out 'broken' jobs in bk watch jobs before they are passed into BuildSummaryWithJobs.

I briefly considered an alteration to renderJobs, but bk build view uses it too and should probably still show the full job list.

Changes

  • Filter out 'broken' jobs with a helper function.
  • Add a unit test to validate behaviour.

Testing

  • Tests have run locally (with go test ./...)
  • Code is formatted (with go fmt ./...)

Disclosures / Credits

  • I'm not particularly conversant with Go. I used AI (Cursor with Grok 4.6) to validate my understanding of behaviour, and to help write the unit test.

@JoelTowell
JoelTowell requested review from a team as code owners August 14, 2026 16:45
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