A fast Buildkite plugin that analyzes Bazel Event Protocol (BEP) protobuf files and creates focused annotations for build failures. Prefers native protobuf parsing when available for accuracy and performance, with a safe string-based fallback.
- β‘ Fast BEP processing β scales to very large builds
- π― Failure-focused β concise, actionable failure details
- π GitHub linking β direct links to failing files/lines
- π Auto-detection β finds BEP files in common locations
- π§° Minimal deps β requires Bash and Python 3; protobuf is optional
- π¨ Clear annotations β designed for Buildkiteβs annotation UI
- π οΈ Bazel-native β understands Bazel BEP failure types
- π Robust β retries annotation creation on transient errors
- Bash
- Python 3
- Bazel (to generate BEP files)
- Optional: Python
protobuf
package (recommended for best parsing)
Without
protobuf
, the analyzer falls back to string-based parsing.
Path to the Bazel Event Protocol protobuf file to parse. If not provided, the plugin looks for common filenames: bazel-events.pb
, bazel-bep.pb
, bep.pb
, events.pb
.
If true
, the plugin exits successfully when no BEP file is found.
Default: false
To ensure reliability and prevent memory issues, the analyzer enforces limits (configurable):
- File size: 100MB max BEP file size (
--max-file-size
in MB) - Failure count: 50 failures max (
--max-failures
) - Annotation size: 1MB (Buildkite platform limit)
When limits are exceeded, warnings are logged and results are truncated safely. Defaults are defined in bin/config.py
.
steps:
- label: "π¨ Build with Bazel"
command: |
bazel build //... --build_event_binary_file=bazel-events.pb
plugins:
- bazel-annotate#v1.0.0:
bep_file: bazel-events.pb
steps:
- label: "π¨ Build with Bazel"
command: |
# Command might not produce a BEP file
bazel build //...
plugins:
- bazel-annotate#v1.0.0:
skip_if_no_bep: true
steps:
- label: "π§ͺ Run Bazel tests"
command: |
bazel test //... --build_event_binary_file=bazel-test-events.pb
plugins:
- bazel-annotate#v1.0.0:
bep_file: bazel-test-events.pb
steps:
- label: "π¨ Build with Bazel"
command: |
bazel build //... --build_event_binary_file=bazel-build-events.pb
plugins:
- bazel-annotate#v1.0.0:
bep_file: bazel-build-events.pb
- label: "π§ͺ Test with Bazel"
command: |
bazel test //... --build_event_binary_file=bazel-test-events.pb
plugins:
- bazel-annotate#v1.0.0:
bep_file: bazel-test-events.pb
- label: "π¦ Package with Bazel"
command: |
bazel run //:package --build_event_binary_file=bazel-package-events.pb
plugins:
- bazel-annotate#v1.0.0:
bep_file: bazel-package-events.pb
- Run shell tests in Docker:
docker compose run --rm tests bats tests
- Run Python unit tests locally:
python3 -m unittest -v tests/test_analyzer.py
- Linting and Shellcheck are covered in the Buildkite pipeline for the plugin (see
.buildkite/pipeline.yml
).
Elastic Stack | Agent Stack K8s | Hosted (Mac) | Hosted (Linux) | Notes |
---|---|---|---|---|
π | π | β | π | Agents on Linux/K8s need Bazel available |
- β Fully supported
- π Agents running on Linux or Kubernetes must provide Bazel
- Fork the repository
- Create a feature branch
- Add your changes, including tests
- Submit a pull request
The package is available as open source under the terms of the MIT License.