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:
# .mesrai.yml
version: 1
reviews:
enabled: true
auto_review: true
review_on:
- pull_request
- push_to_main
ignore_patterns:
- "*.md"
- "docs/**"
- "test/fixtures/**"
context:
include_dependencies: true
max_context_files: 50
feedback:
style: conversational
severity_threshold: medium4. 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:
# .mesrai.yml
rules:
security:
enabled: true
block_on: critical
performance:
enabled: true
monitor_complexity: true
style:
enabled: true
follow_conventions: trueWebhook 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
- Ensure
.mesrai.ymlconfig is valid - 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
.mesrai.yml - 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.