Skip to content

Example: click-through-links tip via task_update in config.axl#1206

Open
gregmagolan wants to merge 2 commits into
mainfrom
tips-click-through-links-example
Open

Example: click-through-links tip via task_update in config.axl#1206
gregmagolan wants to merge 2 commits into
mainfrom
tips-click-through-links-example

Conversation

@gregmagolan
Copy link
Copy Markdown
Member

A worked example of the per-tip surfaces / aggregate controls added in #1202: a custom info tip that surfaces click-through links on every build/test task.

Registered inline in config(ctx) by subscribing to the task_update lifecycle event — no new framework hook. The handler reads three links off each TaskUpdate the way the built-in surfaces do and shows whichever it knows, one per line in the built-in metadata-row style:

✨ Aspect Web UI — invocation details, test logs, build logs, and timing
🔗 BES results
🐙 GitHub Actions — raw CI logs for this job
  • Aspect Web UIsink_invocation_id joined onto ASPECT_WORKFLOWS_BES_RESULTS_URL (mirrors resolve_aspect_url).
  • BES resultsrender_bes_url (Bazel's invocation_id + bes_results_url).
  • CI builddetect_build_url + the per-host icon/label from detect_ci_host (🐙 GitHub Actions, ⭕ CircleCI, 🏗 Buildkite, 🦊 GitLab CI).

It's a TIP_TEMPLATE_JINJA2 accumulator tip keyed on a stable id, so links that resolve across separate updates merge into the one tip and re-render in place. surfaces = TASK_SCREENS keeps these per-invocation links off the cross-task PR summary.

Stacked on #1202 (base branch custom-links-tip-example); the diff is .aspect/config.axl only once that lands.


Changes are visible to end-users: no

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

Test plan

  • Manual: CIRCLECI=true CIRCLE_BUILD_URL=… ASPECT_WORKFLOWS_BES_RESULTS_URL=… aspect build //examples/lint:hello surfaces the tip with the link bar, deduped across the build's task_update emits; buildifier clean.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1b37cc4a7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .aspect/config.axl Outdated
Comment on lines +154 to +156
"body": "{% if aspect is defined %}{{ aspect[0] }}\n{% endif %}" +
"{% if bes is defined %}{{ bes[0] }}\n{% endif %}" +
"{% if ci is defined %}{{ ci[0] }}\n{% endif %}",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Show retried invocation links instead of the first only

When --bazel-retry-attempts starts a later Bazel attempt, bazel_runner creates a fresh invocation and updates sink_invocation_id / Bazel invocation_id, so the accumulator can contain both the failed first-attempt links and the final attempt links. These templates always render [0], so after a retry the tip continues to point users at the first failed invocation/BES page rather than the current or final one; either render all accumulated links or use the latest value for per-invocation links.

Useful? React with 👍 / 👎.

@gregmagolan gregmagolan force-pushed the custom-links-tip-example branch from f9a5506 to ec1d98d Compare June 4, 2026 03:57
@gregmagolan gregmagolan force-pushed the tips-click-through-links-example branch from e1b37cc to 2166b9d Compare June 4, 2026 03:57
@gregmagolan gregmagolan force-pushed the custom-links-tip-example branch from ec1d98d to 91c1102 Compare June 4, 2026 04:16
@gregmagolan gregmagolan force-pushed the tips-click-through-links-example branch from 2166b9d to 8978e8f Compare June 4, 2026 04:17
@gregmagolan gregmagolan force-pushed the custom-links-tip-example branch from 91c1102 to 2f08e20 Compare June 4, 2026 13:56
@gregmagolan gregmagolan force-pushed the tips-click-through-links-example branch from 8978e8f to bf1c87a Compare June 4, 2026 13:57
…hook

Gives tips three customization axes plus an interception hook.

Surfaces: a `surfaces` allowlist (SURFACE_CLI / _GHSC / _BK / _GITLAB /
_PR_SUMMARY, plus TASK_SCREENS / AGGREGATE_SCREENS / SURFACE_ALL
shorthands; empty = all) gates which status screens render a tip.
`collect_tips_sorted(ctx, surface=...)` filters via the shared
`tip_shows_on` predicate; the CLI print is gated on SURFACE_CLI.

Within-task repeat: `on_repeat` controls a same-id re-emit within one
task — REPEAT_REPLACE (default, last-wins so a task can revise its own
tip) or REPEAT_ACCUMULATE (union JINJA2 accumulators + re-render).

Cross-task aggregation: `aggregate` governs the PR-summary rollup —
AGGREGATE_AUTO (default: collapse by rendered content, one row per
distinct title/body with side-by-side divergent variants), ALWAYS
(collapse all; union accumulators; newest wins), NEVER (exclude).

tip_suggestion hook: a `TipsTrait.tip_suggestion` hook fires on every
add_tip with a TipInfo and returns TIP_ACCEPT / TIP_REJECT /
tip_replace(...), letting config.axl veto or rewrite any tip — the same
accept/reject/replace shape as repro_fix_suggestion.

The built-in add-github-token-scope tip is REPEAT_ACCUMULATE +
AGGREGATE_ALWAYS to keep its scope union on both axes. The Tips feature's
`seed` arg is removed — tips are created via the standard add_tip path
(e.g. from a task_update handler) which now respects all of the above.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gregmagolan gregmagolan force-pushed the custom-links-tip-example branch from 2f08e20 to 308fa88 Compare June 4, 2026 15:59
@gregmagolan gregmagolan force-pushed the tips-click-through-links-example branch from bf1c87a to 75f8a11 Compare June 4, 2026 15:59
@gregmagolan gregmagolan changed the base branch from custom-links-tip-example to main June 4, 2026 16:07
@gregmagolan gregmagolan force-pushed the tips-click-through-links-example branch from 75f8a11 to ca280b8 Compare June 4, 2026 16:08
@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented Jun 4, 2026

✨ Aspect Workflows Tasks

📅 Thu Jun 4 17:09:08 UTC 2026

⚠️ 2 flagged tasks

  • ⚠️ delivery (delivery-gha-debug) · ⏱ 27s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Delivery complete (2 warn · 3 skipped)
  • ⚠️ delivery (delivery-gha) · ⏱ 29s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Delivery complete (2 warn · 3 skipped)

✅ 12 successful tasks

  • ✅ build (build-gha-debug) · ⏱ 21.3s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (164 built)
  • ✅ build (build-gha) · ⏱ 16.9s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (164 built)
  • ✅ buildifier (buildifier-gha) · ⏱ 55.2s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format (format-gha-debug) · ⏱ 1m 46s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format (format-gha) · ⏱ 1m 39s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ gazelle (gazelle-from-source-gha-debug) · ⏱ 2m 20s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle (gazelle-from-source-gha) · ⏱ 2m 11s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle (gazelle-gha) · ⏱ 50.5s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ lint (lint-gha-debug) · ⏱ 39.4s · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ lint (lint-gha) · ⏱ 46.6s · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ test (test-gha-debug) · ⏱ 50.1s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (25/25 passed · 25 cached)
  • ✅ test (test-gha) · ⏱ 19.8s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (25/25 passed · 25 cached)

🔁 Reproduce

⚠️ delivery (delivery-gha-debug · delivery-gha)

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

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


⏱ Last updated Thu Jun 4 17:11:45 UTC 2026 · 📊 GitHub API quota 1,710/15,000 (11% used, resets in 22m)
🚀 Powered by Aspect CLI (v0.0.0-dev)  |  Aspect Build · X · LinkedIn · YouTube

@gregmagolan gregmagolan force-pushed the tips-click-through-links-example branch 2 times, most recently from cdeff85 to 1b95825 Compare June 4, 2026 16:56
Demonstrates the per-tip surfaces/aggregate controls: a custom `info`
tip registered inline in `config(ctx)` via
`lifecycle.task_update.append(...)`. It reads the Aspect Web UI, BES, and
CI build URLs off each `TaskUpdate` and surfaces whichever it knows — one
link per line in the built-in metadata-row style. Links may resolve across
separate updates; the JINJA2 accumulator tip re-renders in place.
`surfaces = TASK_SCREENS` keeps these per-invocation links off the
cross-task PR summary.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gregmagolan gregmagolan force-pushed the tips-click-through-links-example branch from 1b95825 to 4df29de Compare June 4, 2026 17:07
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