Skip to content

refactor(bazel): move the flag/rc helpers into bazel/flags.axl - #1371

Merged
jbedard merged 1 commit into
mainfrom
sc/1-bazel-flags
Aug 16, 2026
Merged

refactor(bazel): move the flag/rc helpers into bazel/flags.axl#1371
jbedard merged 1 commit into
mainfrom
sc/1-bazel-flags

Conversation

@jbedard

@jbedard jbedard commented Aug 5, 2026

Copy link
Copy Markdown
Member

private/lib/bazel_flags.axl becomes bazel/flags.axl, reached through the bazel namespace the @aspect//bazel.axl facade now assembles. The helpers drop their bazel_trait parameter and read ctx.traits[BazelTrait] themselves, so a task passes only ctx:

bazel_flag_args("the build")            -> bzl.flags.args("the build")
announce_bazel_args("the build")        -> bzl.announce.args("the build")
resolve_bazel_announce(ctx)             -> bzl.announce.resolve(ctx)
setup_bazel_command(ctx, cmd, trait)    -> bzl.setup_command(ctx, cmd)
sibling_rc(ctx, trait, transform)       -> bzl.sibling_rc(ctx, transform)
expand_config_flags(ctx, trait, flags)  -> bzl.flags.expand_config(ctx, flags)
aspect_endpoint_auth_flags(ctx, ...)    -> bzl.endpoint_auth_flags(ctx, ...)

core_args / targets_arg consolidate the arg bundles the bazel-driving tasks were each spelling out.

Pure move: no behaviour change. Endpoint auth rides along unchanged here and re-homes to the deployment feature separately.

Changes are visible to end-users: no

Test plan

  • Covered by existing test cases

@jbedard
jbedard requested a review from thesayyn August 5, 2026 19:46
@aspect-workflows

aspect-workflows Bot commented Aug 5, 2026

Copy link
Copy Markdown

✨ Aspect Workflows Tasks

📅 Sun Aug 16 07:16:34 UTC 2026

❌ 1 failed task

  • ❌ delivery-uncacheable [delivery] · ⏱ 36.2s · ✨ Aspect · 🐙 GitHub Actions
    💬 failed in deliver · Delivery failed (1 delivery fail)

⚠️ 3 flagged tasks

  • ⚠️ delivery-gha-debug [delivery] · ⏱ 46.6s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Delivery complete (1 delivered · 2 warn · 4 skipped)
  • ⚠️ delivery-gha [delivery] · ⏱ 34.2s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Delivery complete (1 delivered · 2 warn · 4 skipped)
  • ⚠️ delivery-uncacheable-warn [delivery] · ⏱ 14.2s · ✨ Aspect · 🐙 GitHub Actions
    💬 Delivery complete (1 warn)

✅ 29 successful tasks

  • ✅ axl-smoke-gha-bootstrap [build] · ⏱ 51.5s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (1 built)
  • ✅ run-axl-smoke [run] · ⏱ 24.8s · 🐙 GitHub Actions · ☑️ Check
    💬 Ran //examples/deliverable:py_deliverable
  • ✅ run-axl-smoke-2 [run] · ⏱ 13.3s · 🐙 GitHub Actions · ☑️ Check
    💬 Ran //examples/deliverable:sh_deliverable
  • ✅ axl-tests-gha-bootstrap [build] · ⏱ 21.6s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (1 built)
  • ✅ build-gha-debug [build] · ⏱ 10m 50s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (172 built)
  • ✅ build-gha [build] · ⏱ 9m 45s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (172 built)
  • ✅ build-gha-ephemeral [build] · ⏱ 59.2s · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (10 built)
  • ✅ buildifier-gha-debug [buildifier] · ⏱ 44.5s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ buildifier-gha [buildifier] · ⏱ 52.2s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ delivery-no-remote-exec [delivery] · ⏱ 14.2s · ✨ Aspect · 🐙 GitHub Actions
    💬 Delivery complete (no deliveries)
  • ✅ format-gha-debug [format] · ⏱ 1m 11s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-format-repeat-task [format] · ⏱ 1m 3s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-format-repeat-task-2 [format] · ⏱ 11.9s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-format-repeat-task-3 [format] · ⏱ 11.7s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-format-repeat-task-4 [format] · ⏱ 12.4s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-gha [format] · ⏱ 1m 47s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ gazelle-gha-debug [gazelle] · ⏱ 36.3s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle-from-source-gha-debug [gazelle] · ⏱ 1m 59s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle-from-source-gha [gazelle] · ⏱ 1m 50s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle-gha [gazelle] · ⏱ 50.5s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ init-shell [build] · ⏱ 29.5s · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (10 built)
  • ✅ lint-gha-debug [lint] · ⏱ 48.5s · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ lint-gha [lint] · ⏱ 43.5s · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ test-gha-debug [test] · ⏱ 9m 1s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (26/26 passed · 25 cached)
  • ✅ test-gha-ide-target-pattern-file [build] · ⏱ 20.8s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (1 built)
  • ✅ test-gha-coverage [test] · ⏱ 25.2s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (1/1 passed · 1 cached)
  • ✅ test-gha-target-pattern-file [test] · ⏱ 18.4s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (1/1 passed · 1 cached)
  • ✅ test-gha [test] · ⏱ 5m 32s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (26/26 passed · 26 cached)
  • ✅ test-gha-ephemeral [test] · ⏱ 1m 13s · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (1/1 passed)

🔁 Reproduce

❌ delivery (delivery-uncacheable · delivery-gha-debug · delivery-gha · delivery-uncacheable-warn)

# --mode=always --track-state=false for off-runner with no state backend.
aspect delivery \
  --commit-sha=5fa88ccd461d4f138687a523ae1ae72389f73ca1 \
  --mode=always \
  --track-state=false \
  --dry-run=true

Install aspect: aspect.build/docs/cli/install


⏱ Last updated Sun Aug 16 07:27:46 UTC 2026 · 📊 GitHub API quota 1,857/15,000 (12% used, resets in 6m)
🚀 Powered by Aspect CLI (v0.0.0-dev)  |  Aspect Build · X · LinkedIn · YouTube

@jbedard
jbedard force-pushed the sc/1-bazel-flags branch 2 times, most recently from 7483e4c to b05f36b Compare August 13, 2026 04:08
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 689161aa-7770-4273-990b-b63c8ca2dd6f

📥 Commits

Reviewing files that changed from the base of the PR and between b05f36b and 5fa88cc.

📒 Files selected for processing (1)
  • crates/aspect-cli/src/builtins/aspect/private/lib/bazel_runner.axl
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/aspect-cli/src/builtins/aspect/private/lib/bazel_runner.axl

Included review availability: Your plan includes up to 3 reviews per rolling hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The Bazel helpers now live in a public bazel module. Tasks, runners, lifecycle code, health checks, and tests use its namespaced APIs. The module provides trait-aware flag handling, RC setup, config expansion, and endpoint authentication.

Changes

Bazel namespace migration

Layer / File(s) Summary
Public Bazel flag APIs
crates/aspect-cli/src/builtins/aspect/bazel/flags.axl
Adds Bazel argument resolution, RC setup, config expansion, endpoint authentication, public namespaces, and aliases.
Bazel facade exports
crates/aspect-cli/src/builtins/aspect/bazel.axl, crates/aspect-cli/src/builtins/aspect/bazel/build_events.axl, crates/aspect-cli/src/builtins/aspect/private/lib/aspect_endpoint_auth.axl
Exports the Bazel APIs and updates module references.
Consumer API migration
crates/aspect-cli/src/builtins/aspect/*.axl, crates/aspect-cli/src/builtins/aspect/private/lib/{bazel_runner,health_check,lifecycle,runner_health_check}.axl
Replaces private helper imports and calls with the public bazel or bzl namespace.
Public API test migration
crates/aspect-cli/src/builtins/aspect/private/lib/bazel_flags_test.axl
Updates tests to use public APIs, trait-based context setup, and combined endpoint-auth coverage.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 5fa88

This refactor reorganizes Bazel helpers without an identified behavior change, and no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: moving Bazel flag and RC helpers into bazel/flags.axl.
Description check ✅ Passed The description directly explains the helper relocation, namespace API changes, behavior-preserving intent, and test coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sc/1-bazel-flags

Comment @coderabbitai help to get the list of available commands.

`private/lib/bazel_flags.axl` becomes `bazel/flags.axl`, reached through the
`bazel` namespace the `@aspect//bazel.axl` facade now assembles. The helpers
drop their `bazel_trait` parameter and read `ctx.traits[BazelTrait]`
themselves, so a task passes only `ctx`:

    bazel_flag_args("the build")            -> bzl.flags.args("the build")
    announce_bazel_args("the build")        -> bzl.announce.args("the build")
    resolve_bazel_announce(ctx)             -> bzl.announce.resolve(ctx)
    setup_bazel_command(ctx, cmd, trait)    -> bzl.setup_command(ctx, cmd)
    sibling_rc(ctx, trait, transform)       -> bzl.sibling_rc(ctx, transform)
    expand_config_flags(ctx, trait, flags)  -> bzl.flags.expand_config(ctx, flags)
    aspect_endpoint_auth_flags(ctx, ...)    -> bzl.endpoint_auth_flags(ctx, ...)

`core_args` / `targets_arg` consolidate the arg bundles the bazel-driving
tasks were each spelling out.

Pure move: no behavior change. Endpoint auth rides along unchanged here and
re-homes to the deployment feature separately.
@jbedard
jbedard merged commit 6170351 into main Aug 16, 2026
74 checks passed
@jbedard
jbedard deleted the sc/1-bazel-flags branch August 16, 2026 07:28
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