GitHub App Installation
Configure Mesrai’s GitHub integration to enable automatic AI-powered code reviews on your repositories.
Prerequisites
Before installing the Mesrai GitHub App, ensure you have:
- A Mesrai account (Sign up)
- Admin access to the GitHub organization or repositories
- Active subscription plan (View plans)
Installation Steps
1. Install the GitHub App
Navigate to the Mesrai GitHub App installation page:
- Click Install or Configure
- Select the organization or account
- Choose repositories:
- All repositories (recommended for teams)
- Only select repositories (for testing)
2. Grant Permissions
The Mesrai GitHub App requires the following permissions:
| Permission | Access Level | Purpose |
|---|---|---|
| Pull requests | Read & Write | Post review comments and suggestions |
| Repository contents | Read | Analyze code changes and file structure |
| Commit statuses | Read & Write | Report review status on PRs |
| Repository metadata | Read | Access repository information |
3. Configure Repository Settings
After installation, configure per-repository settings via the Mesrai Dashboard:
- Go to Repositories → Select your repo → Settings
- Configure review options:
- Auto-review: Enable automatic reviews on PRs
- Review triggers: Pull requests, push to main
- Ignore patterns:
*.md,docs/**,test/fixtures/** - Context settings: Include dependencies, max files (50)
- Feedback style: Conversational with medium severity threshold
4. Test the Integration
Create a test pull request to verify the setup:
- Make a small code change
- Create a pull request
- Mesrai will automatically analyze and comment within 30 seconds
Repository Configuration
Enable/Disable Reviews
Toggle AI reviews per repository in your Mesrai Dashboard:
- Go to Repositories → Select repo → Settings
- Enable/disable Automatic Reviews
- Configure review triggers
Custom Review Rules
Create custom rules for your team’s workflow via the dashboard:
- Go to Settings → Custom Rules
- Configure rule categories:
- Security: Enable and block on critical issues
- Performance: Monitor complexity metrics
- Style: Enforce coding conventions
Webhook Configuration
Mesrai automatically configures webhooks. If you need to manually verify:
- Go to Repository Settings → Webhooks
- Find the Mesrai webhook
- Verify Recent Deliveries show successful responses
Webhook Events
Mesrai listens to these GitHub events:
pull_request(opened, synchronized, reopened)pull_request_review(submitted)push(to protected branches)issue_comment(for manual review triggers)
Manual Review Triggers
Trigger reviews manually by commenting on a PR:
@mesrai review
@mesrai review --full
@mesrai review securityTroubleshooting
Reviews Not Appearing
Symptom: No comments from Mesrai on new PRs
Solutions:
- Verify webhook deliveries in repository settings
- Check Mesrai dashboard for repository status
- Verify auto-review is enabled in dashboard settings
- Confirm subscription is active
Permission Errors
Symptom: “Mesrai doesn’t have access to this repository”
Solutions:
- Reinstall the GitHub App with correct permissions
- Verify repository is included in app installation
- Check organization permissions if using GitHub Enterprise
Slow Review Times
Symptom: Reviews take longer than 2 minutes
Solutions:
- Check Status Page
- Reduce context size in dashboard settings
- Contact support if issue persists
Advanced Configuration
Branch Protection Rules
Integrate Mesrai with GitHub branch protection:
- Go to Repository Settings → Branches
- Edit protection rule for
main - Enable Require status checks to pass
- Select mesrai/review check
Custom Workflow Integration
Use Mesrai in GitHub Actions:
name: Code Review
on: [pull_request]
jobs:
mesrai:
runs-on: ubuntu-latest
steps:
- uses: mesrai/review-action@v1
with:
api-key: ${{ secrets.MESRAI_API_KEY }}
pr-number: ${{ github.event.pull_request.number }}Uninstallation
To remove Mesrai from your repositories:
- Go to GitHub Settings → Applications → Installed GitHub Apps
- Find Mesrai → Click Configure
- Scroll down and click Uninstall
Your data will be retained for 30 days as per our privacy policy.