Creating Pull Requests and Review Triggers
After setting up your repository, diffray will automatically start reviewing your pull requests.
Automatic Triggers
diffray starts reviews automatically in the following cases:
1. Opening a New PR (opened)
When you create a new pull request in the repository:
# Create a branch and make changes
git checkout -b feature/new-feature
# ... make changes ...
git add .
git commit -m "Add new feature"
git push origin feature/new-feature
Then open a PR through GitHub UI:
- Go to the repository on GitHub
- Click "Pull requests" → "New pull request"
- Select your branch
- Click "Create pull request"
→ Review will start automatically right after creating the PR
2. Updating PR (synchronize)
When you push new commits to an existing PR:
# While on the PR branch
git add .
git commit -m "Fix review comments"
git push origin feature/new-feature
→ Review will start automatically after each push
3. Reopening PR (reopened)
If you closed a PR and then reopened it:
- Find the closed PR
- Click "Reopen pull request"
→ Review will start automatically when reopening
4. Manual Trigger via Label (labeled)
You can start a review manually by adding a special label:
- Open the PR on GitHub
- In the right panel find the "Labels" section
- Add the
diffray-reviewlabel
→ Review will start immediately after adding the label
When this is useful:
- Restart review after an error
- Get an additional review without changing code
- Start review for an old PR created before connecting diffray
What Happens When Review Starts
1. GitHub Check Run is Created
A "diffray Code Review" status check appears in the PR:
- Pending (🟡) - review is starting
- In Progress (🟡) - review is running
- Success (✅) - review completed
- Failure (❌) - review failed with error
2. Status Label is Added
diffray automatically adds the diffray-review-started label to indicate review has begun.
Learn more: Labels and Status
3. Review Executes (5-10 minutes)
In the background:
- Repository is cloned
- PR changes are analyzed
- AI analyzes the code
- Checks for duplicate issues from previous reviews
4. Results are Published
After completion:
- Comment with results appears in the PR
- Label updates to
diffray-review-completed - GitHub Check Run updates to Success
- You receive a notification from GitHub (if enabled)
Example PR Lifecycle
1. Create PR
└─> Review starts automatically
└─> Label: diffray-review-started
└─> Check: In Progress
└─> [5-10 minutes of analysis]
└─> Result published
└─> Label: diffray-review-completed
└─> Check: Success
2. Push new commits
└─> Labels completed/failed are removed
└─> New review starts
└─> Label: diffray-review-started
└─> ... (cycle repeats)
3. Manual restart (adding label)
└─> Add label: diffray-review
└─> Old labels completed/failed are removed
└─> New review starts
└─> ... (cycle repeats)
What Does NOT Trigger Review
diffray does NOT start reviews in the following cases:
- Changing PR description (edit)
- Adding other labels (except
diffray-review) - Changing assignees or reviewers
- Comments in PR
- Changing milestone or project
- Closing PR (closed)
- Merging PR (merged)
These events are ignored to conserve your review limits.
Canceling a Started Review
In the current version, there is no way to cancel a review after it starts. The review will complete or fail with an error.
Workaround: If you need to urgently stop a review:
- Close the PR (this won't stop current execution but will prevent publishing)
- Contact support for a refund of the spent review
Review Execution Time
Typical execution time:
- Small PR (1-5 files, <500 lines): 5-7 minutes
- Medium PR (5-15 files, 500-2000 lines): 7-10 minutes
- Large PR (15+ files, 2000+ lines): 10-15 minutes
Factors affecting time:
- Size of changes (number of files and lines)
- Code complexity
- System load
Monitoring Progress
During review execution you can track progress:
In GitHub PR
- Check Run status shows "In Progress"
diffray-review-startedlabel is present
In diffray Dashboard
- Go to Dashboard section
- In "Recent Reviews" find your review
- Status will be "pending" or "processing"
Via URL
Each review has a unique URL:
https://app.diffray.ai/dashboard/reviews/{reviewId}
You can find reviewId in logs or through Dashboard.
Next step: Understanding Labels and Status →