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

  1. Install Integration

    • BugBrain Settings → Integrations → GitLab
    • Connect GitLab account
    • Authorize scopes (read/write issues, MR comments)
  2. Select Projects

    • Choose which GitLab projects receive issues
  3. 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 report

Auto-assigned to:

  • GitLab project lead
  • Custom team members (configurable)

MR Integration

Post test results to merge requests:

  1. Enable in GitLab settings
  2. BugBrain runs tests on MR creation
  3. Comments with results:
    ✅ BugBrain Smoke Tests: PASSED (45 tests)
    🟡 Full Test Suite: IN PROGRESS

Configuration

OptionValuesDefault
Create issuesAll / Critical / NeverAll
Severity → LabelMap severitieshigh→”🔴 critical”
Auto-closeYes / NoYes
Assign toTeam membersProject 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_requests

Troubleshooting

  • Issues not creating — Check GitLab project authorization
  • MR comments missing — Verify merge request integration is enabled
  • Duplicate issues — Increase deduplication window in settings