Hide conditionally excluded jobs from bk build watch - #946
Open
JoelTowell wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I ran
bk build watchagainst a pipeline with many conditional steps. I found a lot of intentionally skipped steps were noisily logged asbroken. After reviewing some documentation, it became clear thatbrokenhas a rather idiosyncratic meaning. It seems that it would often mean a job was skipped due to not meeting a conditionalbranchesorifcondition.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 watchpasses the full API build intoBuildSummaryWithJobs. This callsrenderJobswhich 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 inbk watch jobsbefore they are passed intoBuildSummaryWithJobs.I briefly considered an alteration to
renderJobs, butbk build viewuses it too and should probably still show the full job list.Changes
'broken'jobs with a helper function.Testing
go test ./...)go fmt ./...)Disclosures / Credits