Skip to content

Pull Request Workflow

Automatic code quality analysis for every pull request. Changed files are scanned instantly and results appear directly in your PR with inline comments and quality gate status.

Prerequisites

Before enabling pull request analysis, ensure you meet all requirements:

Requirements Check

  • Repository linked with initial full scan completed
  • Version Control Account configured with proper token permissions
  • Supported platforms: GitHub, GitLab, Bitbucket, or Azure DevOps
  • All licenses supported (no enterprise requirement)
  • Network access from BrowserStack Code Quality server to your SCM

** Verify Token Permissions →**

Enabling Pull Request Analysis

Option 1: During Repository Linking

  1. Navigate to Projects → [Your Project] → Link Repository
  2. Select your Version Control Account from the dropdown
  3. Choose your repository from the auto-populated list
  4. Enable "Pull Request Analysis"
  5. Click Link Repository

Option 2: For Existing Repositories

  1. Go to Repositories → [Your Repository] → Edit
  2. Enable "Pull Request Analysis"
  3. Click Save

NOTE

Automatic Webhooks: If your VCA has webhook permissions, webhooks are created automatically. Otherwise, configure webhooks manually in your SCM platform.

How It Works

Automated Flow

  1. Developer creates PR in your SCM (GitHub/GitLab/Bitbucket/Azure DevOps)
  2. Webhook triggers instant scan of changed files (delta analysis)
  3. Analysis completes and results are posted as PR comments
  4. Quality gate status appears in PR status checks

Reviewing PR Results

In Your SCM (GitHub/GitLab/etc.):

  • Quality gate status in PR checks (pass/fail)
  • Inline comments highlighting specific issues
  • Overall quality summary in PR status

In BrowserStack Code Quality UI:

  1. Open Development History from repository summary
  2. Navigate to Pull Requests tab
  3. Click your PR to see detailed analysis
  4. Review new issues, fixed issues, and carried-over issues

Quality Gate Configuration

Customize pass/fail thresholds in your repository's Configuration JSON:

  • New issues introduced limit
  • Code coverage thresholds
  • ️ Critical/high severity issue counts
  • ️ Technical debt metrics

Platform Support

NOTE

Azure DevOps Users: You must connect via a Version Control Account to enable Pull Request analysis.

Manual Configuration

If automatic webhook setup fails or you have restricted token permissions:

Manual Webhook Setup

For pull request analysis, configure webhook in your SCM platform with:

  • Events: Pull request/merge request events
  • URL: /api/views/repositories/webhooks
  • Content Type: application/json
  • SSL Verification: Enabled (recommended)

Troubleshooting

Common Issues and Solutions

ProblemQuick Solution
PRs not scannedVerify webhook exists and PR analysis enabled
No inline commentsCheck token has PR comment permissions
Quality gate missingVerify commit status permissions
Fork PR issuesLimited support for fork repositories
Analysis timeoutsCheck server resources and network connectivity
VCA connection errorsVerify token validity and permissions