{"id":32789751,"url":"https://github.com/buildkite-plugins/bazel-annotate-buildkite-plugin","last_synced_at":"2025-11-05T11:02:00.949Z","repository":{"id":284271329,"uuid":"954318342","full_name":"buildkite-plugins/bazel-annotate-buildkite-plugin","owner":"buildkite-plugins","description":"🔌 A Buildkite plugin that creates rich annotations from Bazel Event Protocol (BEP) output files","archived":false,"fork":false,"pushed_at":"2025-10-31T11:46:14.000Z","size":139,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-31T13:23:15.212Z","etag":null,"topics":["bazel","buildkite-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buildkite-plugins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-24T22:38:58.000Z","updated_at":"2025-10-31T11:45:57.000Z","dependencies_parsed_at":"2025-03-26T02:40:40.758Z","dependency_job_id":"eaabcd76-15d0-4baf-8dc1-99a4d4a8d8ca","html_url":"https://github.com/buildkite-plugins/bazel-annotate-buildkite-plugin","commit_stats":null,"previous_names":["mcncl/bazel-annotate-buildkite-plugin","buildkite-plugins/bazel-annotate-buildkite-plugin"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/buildkite-plugins/bazel-annotate-buildkite-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildkite-plugins%2Fbazel-annotate-buildkite-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildkite-plugins%2Fbazel-annotate-buildkite-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildkite-plugins%2Fbazel-annotate-buildkite-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildkite-plugins%2Fbazel-annotate-buildkite-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buildkite-plugins","download_url":"https://codeload.github.com/buildkite-plugins/bazel-annotate-buildkite-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildkite-plugins%2Fbazel-annotate-buildkite-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282807270,"owners_count":26730414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-05T02:00:05.946Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel","buildkite-plugin"],"created_at":"2025-11-05T11:01:06.381Z","updated_at":"2025-11-05T11:02:00.929Z","avatar_url":"https://github.com/buildkite-plugins.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bazel BEP Failure Analyzer Buildkite Plugin [![Build status](https://badge.buildkite.com/522d5a765d9856d57c8ce69162540279b81db9d2852b5f7060.svg?branch=main)](https://buildkite.com/buildkite/plugins-bazel-annotate)\n\nA 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.\n\n## Features\n\n- ⚡ Fast BEP processing — scales to very large builds\n- 🎯 Failure-focused — concise, actionable failure details\n- 🔗 GitHub linking — direct links to failing files/lines\n- 🔍 Auto-detection — finds BEP files in common locations\n- 🧰 Minimal deps — requires Bash and Python 3; protobuf is optional\n- 🚨 Clear annotations — designed for Buildkite’s annotation UI\n- 🛠️ Bazel-native — understands Bazel BEP failure types\n- 🔁 Robust — retries annotation creation on transient errors\n\n## Prerequisites\n\n- Bash\n- Python 3\n- Bazel (to generate BEP files)\n- Optional: Python `protobuf` package (recommended for best parsing)\n\n\u003e Without `protobuf`, the analyzer falls back to string-based parsing.\n\n## Plugin Options\n\n### `bep_file` (optional)\nPath 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`.\n\n### `skip_if_no_bep` (optional, boolean)\nIf `true`, the plugin exits successfully when no BEP file is found.\nDefault: `false`\n\n## Processing Limits and Behavior\n\nTo ensure reliability and prevent memory issues, the analyzer enforces limits (configurable):\n\n- File size: 100MB max BEP file size (`--max-file-size` in MB)\n- Failure count: 50 failures max (`--max-failures`)\n- Annotation size: 1MB (Buildkite platform limit)\n\nWhen limits are exceeded, warnings are logged and results are truncated safely. Defaults are defined in [`bin/config.py`](bin/config.py).\n\n## Examples\n\n### Basic usage with explicit BEP file\n\n```yaml\nsteps:\n  - label: \"🔨 Build with Bazel\"\n    command: |\n      bazel build //... --build_event_binary_file=bazel-events.pb\n    plugins:\n      - bazel-annotate#v1.1.1:\n          bep_file: bazel-events.pb\n```\n\n### Skip annotations if no BEP file found\n\n```yaml\nsteps:\n  - label: \"🔨 Build with Bazel\"\n    command: |\n      # Command might not produce a BEP file\n      bazel build //...\n    plugins:\n      - bazel-annotate#v1.1.1:\n          skip_if_no_bep: true\n```\n\n### Running tests with annotations\n\n```yaml\nsteps:\n  - label: \"🧪 Run Bazel tests\"\n    command: |\n      bazel test //... --build_event_binary_file=bazel-test-events.pb\n    plugins:\n      - bazel-annotate#v1.1.1:\n          bep_file: bazel-test-events.pb\n```\n\n### Multiple Bazel jobs in a pipeline with separate annotations\n\n```yaml\nsteps:\n  - label: \"🔨 Build with Bazel\"\n    command: |\n      bazel build //... --build_event_binary_file=bazel-build-events.pb\n    plugins:\n      - bazel-annotate#v1.1.1:\n          bep_file: bazel-build-events.pb\n\n  - label: \"🧪 Test with Bazel\"\n    command: |\n      bazel test //... --build_event_binary_file=bazel-test-events.pb\n    plugins:\n      - bazel-annotate#v1.1.1:\n          bep_file: bazel-test-events.pb\n\n  - label: \"📦 Package with Bazel\"\n    command: |\n      bazel run //:package --build_event_binary_file=bazel-package-events.pb\n    plugins:\n      - bazel-annotate#v1.1.1:\n          bep_file: bazel-package-events.pb\n```\n\n## Development\n\n- Run shell tests in Docker:\n\n```bash\ndocker compose run --rm tests bats tests\n```\n\n- Run Python unit tests locally:\n\n```bash\npython3 -m unittest -v tests/test_analyzer.py\n```\n\n- Linting and Shellcheck are covered in the Buildkite pipeline for the plugin (see `.buildkite/pipeline.yml`).\n\n## Compatibility\n\n| Elastic Stack | Agent Stack K8s | Hosted (Mac) | Hosted (Linux) | Notes |\n| :-----------: | :-------------: | :----------: | :------------: | :---- |\n| 📝            | 📝              | ✅           | 📝             | Agents on Linux/K8s need Bazel available |\n\n- ✅ Fully supported\n- 📝 Agents running on Linux or Kubernetes must provide Bazel\n\n## 👩‍💻 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Add your changes, including tests\n4. Submit a pull request\n\n## 📜 License\n\nThe package is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildkite-plugins%2Fbazel-annotate-buildkite-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuildkite-plugins%2Fbazel-annotate-buildkite-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildkite-plugins%2Fbazel-annotate-buildkite-plugin/lists"}