Documentation Index
Fetch the complete documentation index at: https://docs.aspect.build/llms.txt
Use this file to discover all available pages before exploring further.
This is the per-task migration guide for
aspect build and aspect test. See Migrating from legacy YAML-configured tasks for shared setup (CLI version pinning, the recommended two-step migration path, top-level workspaces:).build and test tasks ran bazel build / bazel test with environment-specific flags injected automatically, built-in retry logic, GitHub status checks, and lifecycle hooks. aspect build and aspect test replace them.
Environment-specific flags (BES endpoint, build metadata, runner optimizations) are injected by the BazelDefaults feature. GitHub status checks are posted by the GithubStatusChecks feature. Artifact uploads are handled by the ArtifactUpload feature.
Task-level retry, timeout, and conditional execution are now handled by your CI platform rather than the task runner. Bazel’s internal retry for transient errors (e.g.
BLAZE_INTERNAL_ERROR, LOCAL_ENVIRONMENTAL_ERROR) is still built into the CLI.What changed
| Area | YAML-configured tasks | Aspect CLI tasks |
|---|---|---|
| Invocation | bazel build / bazel test via task runner | aspect build / aspect test |
| Targets | targets: in .aspect/workflows/config.yaml (default //...) | positional args (default ...) |
| Bazel flags | bazel.flags / bazel.startup_flags in .aspect/workflows/config.yaml | --bazel-flag / --bazel-startup-flag |
| BES / remote cache | Auto-configured from platform config | Auto-configured by BazelDefaults |
| GitHub status checks | Built into task runner | GithubStatusChecks feature |
| Artifact upload | Built into task runner | ArtifactUpload feature (opt-in per artifact kind) |
| Internal error retry | Bazel retries 3× on transient errors | Bazel retries up to 10× on BLAZE_INTERNAL_ERROR / LOCAL_ENVIRONMENTAL_ERROR |
| Task timeout | timeout_in_minutes in .aspect/workflows/config.yaml | CI platform job/step timeout |
| Lifecycle hooks | before_task / after_task hooks | CI platform steps |
| Conditional execution | when: expressions | CI platform conditionals |
| Workspaces | workspaces: top-level list (one or more directories) | cd <dir> in your CI config; run aspect <task> from there |
Configuration migration
Many of the settings below can be applied in either of two ways:- CLI flag — pass the flag at invocation time (e.g.
aspect build --bazel-flag=--config=remote //...). Good for overrides on individual task invocations, or experimenting with a setting before committing it. .aspect/config.axl— declare it once in your repo’s AXL config so everyaspect build/aspect testinvocation picks it up. Good for settings that should apply to all invocations of a task type. AXL also lets you compute values programmatically (e.g. branching on CI host or environment), which is more expressive than shell logic wrapped around CLI flags.
Targets
Before —.aspect/workflows/config.yaml:
config.axl:
... — expands to all rule targets in the package at and beneath your current directory.
Bazel flags
Before —.aspect/workflows/config.yaml:
config.axl:
Test tag filters
Before —.aspect/workflows/config.yaml:
config.axl:
Code coverage
Before —.aspect/workflows/config.yaml:
config.axl:
Test log upload
Before —.aspect/workflows/config.yaml:
config.axl:
none (default), failed, executed, all. Test log upload is one knob of the broader Artifact upload feature — see that section for the full list of artifact kinds and authentication requirements.
GitHub status checks
The legacy YAML-configured tasks posted build and test results to a PR comment via the Aspect Workflows GitHub App (also known as Marvin) — there was no per-task GitHub status check. The new Aspect CLI posts a GitHub status check for eachaspect build / aspect test invocation via the GithubStatusChecks feature. The feature is enabled by default but only posts checks when the CLI is authenticated — without ASPECT_API_TOKEN set on the runner and the Aspect Workflows GitHub App installed, nothing reaches GitHub.
GithubStatusChecks:
- Creates a check run on the commit as soon as the task starts
- Updates it with live build progress (target counts, failures) during the build
- Completes it with a pass/fail conclusion and a build summary including artifact download links
Set
--task-key explicitly on any invocation that uses GithubStatusChecks or ArtifactUpload. Status check names and uploaded artifact names are derived from the task key, so a stable, distinct value per invocation makes results identifiable (e.g. build, test). If you omit --task-key, the CLI generates a random one per run and your status checks and artifacts will end up with unpredictable, non-reusable names.Authentication
GithubStatusChecks needs:
ASPECT_API_TOKENexposed to the runner.- The Aspect Workflows GitHub App (also known as Marvin) installed on the GitHub org/repository and linked to your Aspect account, so the CLI can use the App to post the check.
ASPECT_API_TOKEN set. In that case the CLI logs one GitHub status check: authentication failed for <owner>/<repo> — <reason> line per task and the build continues normally. The reason explains what’s missing and includes a link to the setup guide, for example:
GitHub status check: to see what was reported.
GithubStatusChecks failures are isolated from the build/test task: transport errors (DNS, TLS, connection refused), API errors (e.g. GitHub 5xx), and other failures inside the feature are caught and logged but never fail the parent aspect build / aspect test invocation.
Artifact upload
TheArtifactUpload feature uploads build artifacts to the CI platform. All upload kinds are opt-in (off by default) because uploaded artifacts are accessible to anyone with repo read access.
| Artifact | Flag | Risk |
|---|---|---|
| Test logs | --artifact-upload:upload-test-logs=failed | Medium — test output can leak CI secrets if a test prints, asserts on, or otherwise emits values from env vars (e.g. tokens, API keys) |
| Bazel profile | --artifact-upload:upload-profile=true | Low — labels and file paths only |
| Build Event Protocol | --artifact-upload:upload-bep=true | Low — the CLI redacts env-var values that may hold secrets or sensitive data before upload |
| Compact execution log | --artifact-upload:upload-exec-log=true | High — contains raw action env vars (including secrets); keep off on public repositories |
config.axl:
ArtifactUpload does not use the Aspect Workflows GitHub App or ASPECT_API_TOKEN. It uploads to your CI platform’s native artifact storage using the runner’s own credentials: permissions: id-token: write on GitHub Actions, the Buildkite agent token, CI_JOB_TOKEN on GitLab, the CircleCI runner token. Make sure those credentials are present in the job environment. Supported platforms: Buildkite, CircleCI, GitHub Actions, GitLab.
