docs: show how to customize Aspect's CI status surfaces - #598
Open
gregmagolan wants to merge 3 commits into
Open
docs: show how to customize Aspect's CI status surfaces#598gregmagolan wants to merge 3 commits into
gregmagolan wants to merge 3 commits into
Conversation
Contributor
✨ Bazel Examples CI📅 Tue Aug 11 23:06:20 UTC 2026
|
The Buildkite pipeline here runs six task kinds, each posting its own annotation, which makes this a good place to demonstrate customizing them. Patches the built-in summary template rather than re-authoring it, so the annotation keeps its invocation rows, target counts, cache rate, artifact links and tips block while the trailing "Last update" line becomes a Buildkite-native status line with a branch chip. A `fail()` guards the `.replace()` anchor, since a silent no-op would otherwise revert the customization on a CLI upgrade with nothing in the logs. Also shows per-kind scoping: a lint-specific callout nested under "lint" so it lands on the lint annotation alone. Details templates are per-kind, so an unscoped override would replace the build, test, format and gazelle bodies with lint's. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Extends the Buildkite annotation example to the other status surfaces, so one config demonstrates all four. PR / MR summary comment: `GithubStatusComments` takes a single "body" key (the comment is one document covering every task, not a per-kind render). `GitlabStatusComments` reuses GitHub's exported default template, so one patched body serves both hosts. Also shows `status_badges`, which swaps the row emoji without touching a template — it merges over the defaults, so unlisted keys keep their built-ins. GitHub status checks share the renderer table with the Buildkite annotations, so the summary and lint-details templates are reused verbatim and the Checks tab agrees with the annotation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gregmagolan
force-pushed
the
feat/buildkite-annotation-customization
branch
from
August 11, 2026 23:00
19a4a00 to
9bec988
Compare
The title is the line reviewers actually scan, and the `title` template key shipped in 2026.33.2 (aspect-build/aspect-cli#1384), which this repo now pins. Adds two titles: a shared one that reads "<icon> <kind> on <subject> — <state>", and a lint-scoped one that drops the subject (just `//...` for lint) in favour of naming where the rules live. Both surfaces reuse them, so the Checks tab and the Buildkite annotation agree. Also demonstrates that a per-kind block overlays the flat keys rather than replacing them: lint keeps the shared summary while taking its own title and details. No drift guard on these — they're whole templates rather than patches, so there's no anchor that could silently stop matching. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
CI in this repo runs six task kinds across GitHub Actions and Buildkite, which makes it a good place to demonstrate customizing Aspect's status surfaces. Customers have been asking how, so this config now shows all four in one place.
Buildkite annotations and GitHub status checks share the same per-kind renderer table, so they take the same
summary/detailsJinja2 keys — and the same patched template serves both. Rather than replace a template wholesale (losing the invocation rows, target counts, cache rate, artifact links and tips block), the example imports the built-in and patches one line:Each patch is guarded by a
fail()..replace()against a template that no longer contains the anchor is a silent no-op, so a CLI upgrade that edits a built-in would quietly revert the customization with nothing in the logs. These templates live underprivate/lib/and are not stability-guaranteed, which is exactly the risk the guard catches.Per-kind scoping is shown with a lint-specific callout nested under
"lint". The summary template is shared across kinds so a summary patch applies everywhere; details templates are per-kind, so an unscoped"details"override would replace the build, test, format and gazelle bodies with lint's.Titles are customized too, since that's the line reviewers actually scan. A shared template reads
<icon> <kind> on <subject> — <state>, and a lint-scoped one drops the subject (just//...for lint) in favour of naming where the rules live.statecarries the verdict Aspect already computed, so rewording the title doesn't mean reimplementing per-kind status logic. These need no drift guard — they're whole templates rather than patches, so no anchor can silently stop matching.This also shows that a per-kind block overlays the flat keys rather than replacing them: lint keeps the shared summary while taking its own title and details.
PR / MR summary comments work differently:
GithubStatusCommentstakes a singlebodykey, because the comment is one document covering every task rather than a per-kind render.GitlabStatusCommentsreuses GitHub's exported default template, so one patched body serves both hosts. The example also showsstatus_badges, which swaps the row emoji without touching a template at all — it merges over the defaults, so unlisted keys keep their built-ins.Requires Aspect CLI 2026.33.2, which this repo already pins.
Changes are visible to end-users: no
Test plan
aspect format --helpfrom the repo root — loads.aspect/config.axland exits 0, confirming every template resolves against the pinned CLI.aspect buildifier .aspect/config.axl— passes, no reformatting.Aspect SUMMARY_TEMPLATE drifted…/Aspect DEFAULT_BODY_TEMPLATE drifted…).status_badgesmerges over the defaults sorunningandabortedkeep their built-in emoji.compose_titleon the released 2026.33.2:build,testandformattake the shared title (✅ build on //... — Successful build) whilelinttakes its scoped one (⚠️ lint (tools/lint) — 3 errors, 8 warnings), confirming the scoping.