5.3 KiB
Buildkite Annotation Patterns
Annotations are build-level messages that appear at the top of a build page. They can contain success messages, warnings, errors, or informational content. Not all projects use annotations consistently.
What Are Annotations?
Annotations are created by build steps using the buildkite-agent annotate command. They appear prominently at the top of the build page and can be styled with different colors/icons.
Annotation Styles
success- Green, checkmark icon, positive messageinfo- Blue, info icon, informational message (most common)warning- Yellow, warning icon, something to be aware oferror- Red, error icon, indicates problems
Project-Specific Patterns
Projects That Use Annotations Heavily (e.g., zen-payroll)
These projects surface important information in annotations:
-
Test Failures: RSpec, Jest, or other test failures may be summarized in annotations
- Failed test count
- Links to failed test files
- Stack traces or error messages
-
Coverage Reports: Code coverage changes or drops below thresholds
-
Linting Errors: Rubocop, ESLint violations grouped by severity
-
Build Resources: Links to documentation, help channels, or common issues
-
Security Scans: Dependency vulnerabilities, security warnings
-
Performance Issues: Slow tests, memory issues, or other performance concerns
When checking status: Always look at annotations first for these projects. They often contain the most actionable information.
Projects Without Annotations (e.g., gusto-karafka)
Smaller or simpler projects may not use annotations at all. For these projects:
- All failure information is in job logs: Must read individual job output
- No centralized summary: Need to check each failed job separately
- Simpler debugging path: Less information to parse, but more manual work
Accessing Annotations
Via MCP Tools
// List all annotations for a build
mcp__MCPProxy__call_tool('buildkite:list_annotations', {
org_slug: 'gusto',
pipeline_slug: 'zenpayroll',
build_number: '1359675',
});
Annotation response includes:
context: Unique identifier for the annotationstyle: success/info/warning/errorbody_html: HTML content of the annotationcreated_at: Timestamp
Via bktide
npx bktide annotations gusto/zenpayroll#1359675
Interpreting Annotations
1. Start with Error-Styled Annotations
Check for style: "error" first - these indicate critical problems:
- Test suite failures
- Build failures
- Security issues
2. Check Warning Annotations
style: "warning" may indicate:
- Degraded performance
- Coverage drops
- Flaky tests
- Deprecated dependencies
3. Info Annotations for Context
style: "info" often contains:
- Build metadata
- Links to resources
- Change summaries
- Help information
4. Success Annotations
style: "success" indicates:
- All tests passed
- Coverage improved
- Performance metrics good
Common Annotation Patterns
Test Failure Annotations
Typically include:
❌ 15 tests failed
spec/models/user_spec.rb
- validates email format
- validates password strength
spec/controllers/api_controller_spec.rb
- returns 401 when unauthorized
Action: Read the listed test failures, then examine the job logs for full details.
Build Resource Annotations
Having problems with your build?
- Check build documentation: [link]
- Ask in #build-stability Slack channel
Action: These are informational - reference them if you're stuck debugging.
Coverage Annotations
⚠️ Code coverage decreased by 2.5%
Current: 85.3% | Previous: 87.8%
Action: May or may not be actionable depending on project policy.
When Annotations Are Missing
If a build has no annotations:
- Don't assume success: Check the overall build state
- Look at job logs: All failure information will be in individual jobs
- Check job states: Failed jobs will have
state: "failed" - Read failed job logs: Use MCP tools or bktide to get logs
Inconsistencies Across Projects
Be aware that annotation usage varies wildly:
- Some projects: Every failure is annotated
- Some projects: Only critical failures annotated
- Some projects: No annotations at all
- Some projects: Annotations are informational only, not diagnostic
Never rely solely on annotations. Always check:
- Overall build state
- Job states
- Annotations (if present)
- Job logs for failed jobs
Example Workflows
Checking a Failed Build With Annotations
- Get build status → state is
failed - List annotations → find error-styled annotation with test failures
- Note which tests failed from annotation
- Get detailed logs for failed job
- Read stack traces and error messages
Checking a Failed Build Without Annotations
- Get build status → state is
failed - Check job summary → identify which jobs failed
- Get detailed information for each failed job
- Read logs for each failed job
- Identify root cause from logs
Checking a Passing Build
- Get build status → state is
passed - Optionally check annotations for warnings or info
- Note any "broken" jobs (may be expected)
- No need to read logs unless investigating performance