Skip to content

fix(bk-annotations): silence trace noise on empty-kind phase markers#1099

Draft
gregmagolan wants to merge 1 commit into
mainfrom
fix-empty-kind-renderer
Draft

fix(bk-annotations): silence trace noise on empty-kind phase markers#1099
gregmagolan wants to merge 1 commit into
mainfrom
fix-empty-kind-renderer

Conversation

@gregmagolan
Copy link
Copy Markdown
Member

The lint, format, gazelle, and delivery task debug logs were spamming two trace lines on every run:

Buildkite annotations: task_update fired but no context_id; ignoring (kind= status=running)
...
Buildkite annotations: no renderer for kind=""; ignoring

Both come from setup_phase / preflight_phase (in lib/lifecycle.axl) emitting TaskUpdate(kind="") — that's the documented "no template" contract for phase markers that telemetry observers should see but renderable surfaces have nothing to render.

The BK annotation handler treated empty kind the same as an unknown kind (a real misconfig) and traced both. Now: empty kind returns silently (it's the contract); no_context_id / unknown_kind still trace because those are routing/config bugs.

The decision is hoisted into a shared should_render_update(update, context_id) -> (decision, reason) helper so the contract is testable and regression-guarded.


Changes are visible to end-users: yes

  • Searched for relevant documentation and updated as needed: yes
  • Breaking change (forces users to change their own code or config): no
  • Suggested release notes appear below: yes

Suggested release notes

  • Removed spurious Buildkite annotations: no renderer for kind="" and task_update fired but no context_id trace lines from --debug output on every task run; the underlying empty-kind phase markers were always the intended "no template" case.

Test plan

  • Covered by existing test cases (aspect dev test-bk-annotation-snapshots)
  • New test cases added (aspect dev test-bk-annotation-decision)

`setup_phase` and `preflight_phase` emit TaskUpdates with `kind=""` —
that's the documented "no template" contract (see `lib/lifecycle.axl`)
for phase-marker dispatches that telemetry observers consume but
renderable surfaces have no per-kind data for.

The BK annotation handler was tracing every such update twice — once
for the missing context_id (when setup_phase runs before
task_started) and once for the missing renderer (when preflight_phase
runs after). Both lines fired on every lint task in debug logs.

Hoist the decision into a shared `should_render_update(update,
context_id)` helper returning `(decision, reason)`. Empty kind is
silent (it's expected). `no_context_id` / `unknown_kind` keep their
trace because those are real routing/config bugs worth surfacing
under `ASPECT_DEBUG=1`.

Regression test: `test-bk-annotation-decision` asserts each skip
reason and the happy path for every registered renderer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented May 19, 2026

✨ Aspect Workflows Tasks

📅 Tue May 19 11:53:34 UTC 2026

❌ 1 failed task

  • ❌ format (buildifier-gha-debug) · ⏱ 29.9s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 failed in diff · Format failed (1 file needs format)

✅ 14 successful tasks

  • ✅ build (build-gha) · ⏱ 21.9s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (161 built)
  • ✅ build (build-gha-debug) · ⏱ 1m 3s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (161 built)
  • ✅ delivery (delivery-gha) · ⏱ 54s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Delivery complete (1 delivered)
  • ✅ delivery (delivery-gha-debug) · ⏱ 5m 19s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Delivery complete (1 delivered)
  • ✅ format (format-gha) · ⏱ 16.8s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format (format-gha-debug) · ⏱ 21.3s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ gazelle (gazelle-from-source-gha) · ⏱ 16.6s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle (gazelle-from-source-gha-debug) · ⏱ 22.2s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle (gazelle-gha) · ⏱ 15s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle (gazelle-gha-debug) · ⏱ 15.2s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ lint (lint-gha) · ⏱ 17.5s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ lint (lint-gha-debug) · ⏱ 17.1s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ test (test-gha) · ⏱ 24.3s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (25/25 passed · 25 cached)
  • ✅ test (test-gha-debug) · ⏱ 1m 8s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (25/25 passed · 25 cached)

🔁 Reproduce

❌ format (buildifier-gha-debug)

aspect format \
  --on-change=fail \
  --scope=changed \
  --formatter-target=//tools/format:format-starlark \
  --base-ref=origin/main

🛠️ Fix

❌ format (buildifier-gha-debug)

aspect format --on-change=silent --formatter-target=//tools/format:format-starlark -- \
  crates/aspect-cli/src/builtins/aspect/feature/buildkite_annotations_test.axl

⏱ Last updated Tue May 19 12:00:10 UTC 2026 · 📊 GitHub API quota 872/15,000 (6% used, resets in 55m)
🚀 Powered by Aspect CLIAspect 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