Skip to content

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

Open
jbedard wants to merge 1 commit into
mainfrom
sc/1-bazel-flags
Open

refactor(bazel): move the flag/rc helpers into bazel/flags.axl#1371
jbedard wants to merge 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

`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 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

📅 Wed Aug 5 19:53:09 UTC 2026

❌ 1 failed task

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

⚠️ 3 flagged tasks

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

✅ 27 successful tasks

  • ✅ axl-smoke-gha-bootstrap [build] · ⏱ 45.6s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (1 built)
  • ✅ run-axl-smoke [run] · ⏱ 23.3s · 🐙 GitHub Actions · ☑️ Check
    💬 Ran //examples/deliverable:py_deliverable
  • ✅ run-axl-smoke-2 [run] · ⏱ 14.1s · 🐙 GitHub Actions · ☑️ Check
    💬 Ran //examples/deliverable:sh_deliverable
  • ✅ axl-tests-gha-bootstrap [build] · ⏱ 1m 43s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (1 built)
  • ✅ build-gha-debug [build] · ⏱ 16m 23s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (172 built)
  • ✅ build-gha [build] · ⏱ 16m 19s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (172 built)
  • ✅ build-gha-ephemeral [build] · ⏱ 43.1s · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (10 built)
  • ✅ buildifier-gha-debug [buildifier] · ⏱ 42.3s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ buildifier-gha [buildifier] · ⏱ 59.9s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ delivery-no-remote-exec [delivery] · ⏱ 6.8s · ✨ Aspect · 🐙 GitHub Actions
    💬 Delivery complete (no deliveries)
  • ✅ format-gha-debug [format] · ⏱ 1m 21s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-format-repeat-task [format] · ⏱ 1m 16s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-format-repeat-task-2 [format] · ⏱ 15.2s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-format-repeat-task-3 [format] · ⏱ 14s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-format-repeat-task-4 [format] · ⏱ 13.5s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ gazelle-gha-debug [gazelle] · ⏱ 40.1s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle-from-source-gha-debug [gazelle] · ⏱ 1m 47s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle-from-source-gha [gazelle] · ⏱ 2m 9s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle-gha [gazelle] · ⏱ 45.3s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ init-shell [build] · ⏱ 29s · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (10 built)
  • ✅ lint-gha-debug [lint] · ⏱ 40s · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ lint-gha [lint] · ⏱ 36.3s · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ test-gha-debug [test] · ⏱ 16m 36s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (26/26 passed · 26 cached)
  • ✅ test-gha-coverage [test] · ⏱ 28.9s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (1/1 passed · 1 cached)
  • ✅ test-gha-target-pattern-file [test] · ⏱ 25.5s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (1/1 passed · 1 cached)
  • ✅ test-gha [test] · ⏱ 11m 50s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (26/26 passed · 25 cached)
  • ✅ test-gha-ephemeral [test] · ⏱ 35.2s · 🐙 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=1e2cafacdfbf908d1383be11abb08e45437de0a3 \
  --mode=always \
  --track-state=false \
  --dry-run=true

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


⏱ Last updated Wed Aug 5 20:11:05 UTC 2026 · 📊 GitHub API quota 1,464/15,000 (10% used, resets in 40m)
🚀 Powered by Aspect CLI (v0.0.0-dev)  |  Aspect Build · X · LinkedIn · YouTube

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