refactor(bazel): move the hook dispatchers next to the trait they fire - #1372
Open
jbedard wants to merge 1 commit into
Open
refactor(bazel): move the hook dispatchers next to the trait they fire#1372jbedard wants to merge 1 commit into
jbedard wants to merge 1 commit into
Conversation
`dispatch_bazel_attempt_end` / `dispatch_bazel_build_end` walk `BazelTrait.bazel_attempt_end` / `.build_end`, so they belong with the trait definition rather than with the build/test task runner. Every task that drives its own spawn loop already loads `@aspect//bazel.axl`, so they now reach the dispatchers through that facade instead of importing the private `bazel_runner.axl`. No behavior change.
✨ Aspect Workflows Tasks📅 Wed Aug 5 19:54:22 UTC 2026 ❌ 1 failed task
|
thesayyn
reviewed
Aug 5, 2026
| build_end = attr(list[typing.Callable[[TaskContext, int], None]], default = [], description = "Hooks called once after the Bazel invocation completes (after all retries), with the final exit code"), | ||
| ) | ||
|
|
||
| def dispatch_bazel_attempt_end(ctx, bazel_trait, exit_code): |
Member
There was a problem hiding this comment.
So much comment for a simple function :(
thesayyn
reviewed
Aug 5, 2026
| handler(ctx, exit_code) | ||
|
|
||
| def dispatch_bazel_build_end(ctx, bazel_trait, exit_code): | ||
| """Fire every `bazel_trait.build_end` hook with the FINAL `exit_code`. |
thesayyn
reviewed
Aug 5, 2026
| handler(ctx, exit_code) | ||
|
|
||
| def dispatch_bazel_build_end(ctx, bazel_trait, exit_code): | ||
| """Fire every `bazel_trait.build_end` hook with the FINAL `exit_code`. |
Member
There was a problem hiding this comment.
these probably don't deserve to be a utility function. what they do could easily be inline at callsite.
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.
dispatch_bazel_attempt_end/dispatch_bazel_build_endwalkBazelTrait.bazel_attempt_end/.build_end, so they belong with the trait definition rather than with the build/test task runner. Every task that drives its own spawn loop already loads@aspect//bazel.axl, so they now reach the dispatchers through that facade instead of importing the privatebazel_runner.axl.No behaviour change.
Changes are visible to end-users: no
Test plan