Skip to content

[bazel-bot] Refactor BazelBuildResult into success/failure types - #988

Merged
jtstogel merged 1 commit into
llvm:mainfrom
jtstogel:bazel-build-result
Oct 14, 2026
Merged

jtstogel merged 1 commit into
llvm:mainfrom
jtstogel:bazel-build-result

Conversation

@jtstogel

@jtstogel jtstogel commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

BazelBuildResult currently has stdout/stderr that are only during a build failure. This PR replaces the class with a tagged union of Success and Failure variants that only carry the fields they need. This PR also removes the time_taken field as it's unused.

Why refactor this? A followup #989 will need to add another field to the output of run_bazel_build(). This field will only be only relevant for the failure case, and I didn't want to add an optional field to BazelBuildResult.

Assisted-by: LLM written, human reviewed

`BazelBuildResult` currently has `stdout`/`stderr` that are only used after a build failure. This PR replaces the dataclass with a tagged union of `Success` and `Failure` variants that only carry the fields they need. This PR also removes the `time_taken` field as it's unused.

A followup PR will need to add a `config` field to the output of `run_bazel_build()`. This would only be relevant for the failure case.

@pranavk pranavk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the refactor. this is clearly better

@jtstogel
jtstogel merged commit 98e1ea2 into llvm:main Oct 14, 2026
7 checks passed
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.

2 participants