1. Resources
  2. /
  3. Plugins
  4. /
  5. bazel-annotate-buildkite-plugin

Bazel BEP Failure Analyzer Buildkite Plugin Build status

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.

Features

  • ⚡ 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

Prerequisites

  • 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.

Plugin Options

bep_file (optional)

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.

skip_if_no_bep (optional, boolean)

If true, the plugin exits successfully when no BEP file is found. Default: false

Processing Limits and Behavior

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.

Examples

Basic usage with explicit BEP file

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

Skip annotations if no BEP file found

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

Running tests with annotations

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

Multiple Bazel jobs in a pipeline with separate annotations

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

Development

  • 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).

Compatibility

Elastic StackAgent Stack K8sHosted (Mac)Hosted (Linux)Notes
📝📝📝Agents on Linux/K8s need Bazel available
  • ✅ Fully supported
  • 📝 Agents running on Linux or Kubernetes must provide Bazel

👩‍💻 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add your changes, including tests
  4. Submit a pull request

📜 License

The package is available as open source under the terms of the MIT License.

The plugins listed on this webpage are provided for informational purposes only. They have not undergone any formal security review or assessment. While we strive to provide useful resources, we cannot guarantee the safety, reliability, or integrity of these plugins. Users are strongly advised to conduct their own security evaluations before downloading, installing, or using any plugin. By using these plugins, you acknowledge and accept any risks associated with their use. We disclaim any liability for any harm or damages arising from the use of the plugins listed.

Start turning complexity into an advantage

Create an account to get started with a 30-day free trial. No credit card required.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Public pipelines
  3. Test Engine
  4. Package Registries
  5. Mobile Delivery Cloud
  6. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Example pipelines
  5. Plugins
  6. Webinars
  7. Case studies
  8. Events
  9. Migration Services
  10. Comparisons

Company

  1. About
  2. Careers
  3. Press
  4. Brand assets
  5. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML
  3. Testing at scale
  4. Monorepo mojo
  5. Bazel orchestration

Legal

  1. Terms of Service
  2. Acceptable Use Policy
  3. Privacy Policy
  4. Subprocessors
  5. Service Level Agreement

Support

  1. System status
  2. Forum
© Buildkite Pty Ltd 2025