GitLab Integration
Integrate BugBrain with GitLab to automatically create issues from test failures and post results to merge requests.
Features
- Auto-create issues on test failures
- MR comments — Post test results to merge requests
- Auto-assign — Assign to team members or project leads
- Label mapping — Tag issues by severity
- Close on fix — Auto-close resolved issues
- CI/CD integration — Run tests via GitLab CI pipelines
Quick Setup
-
Install Integration
- BugBrain Settings → Integrations → GitLab
- Connect GitLab account
- Authorize scopes (read/write issues, MR comments)
-
Select Projects
- Choose which GitLab projects receive issues
-
Configure Rules
- Set failure severity threshold
- Map severity levels to labels
Issue Creation
BugBrain creates GitLab issues with:
Title: [BugBrain] Test Failure: <test_name>
Description:
- Test name and description
- Failure type and evidence
- Suggested fix (AI-generated)
- Link to execution reportAuto-assigned to:
- GitLab project lead
- Custom team members (configurable)
MR Integration
Post test results to merge requests:
- Enable in GitLab settings
- BugBrain runs tests on MR creation
- Comments with results:
✅ BugBrain Smoke Tests: PASSED (45 tests) 🟡 Full Test Suite: IN PROGRESS
Configuration
| Option | Values | Default |
|---|---|---|
| Create issues | All / Critical / Never | All |
| Severity → Label | Map severities | high→”🔴 critical” |
| Auto-close | Yes / No | Yes |
| Assign to | Team members | Project lead |
Deduplication
- 24-hour window — Prevents duplicate issues
- Matching criteria — Same test + same error
- Action — Updates existing issue with new details
Example: GitLab CI Integration
Add to .gitlab-ci.yml:
test_bugbrain:
stage: test
script:
- curl -X POST https://api.bugbrain.tech/webhooks/ci \
-H "X-Bugbrain-Secret: $BUGBRAIN_SECRET" \
-d '{"mr_iid": "'$CI_MERGE_REQUEST_IID'"}'
only:
- merge_requestsTroubleshooting
- Issues not creating — Check GitLab project authorization
- MR comments missing — Verify merge request integration is enabled
- Duplicate issues — Increase deduplication window in settings