π Enhanced PR Analysis v2.8.0
π― Major Enhancement: Intelligent Pull Request Analysis
Transforms github-client from basic PR operations into an enterprise-grade merge decision platform with comprehensive GitHub integration capabilities.
π New Features
Merge Decision Intelligence
- New Fields:
mergeable,mergeable_state,rebaseablein PullRequestDetailDTO - Smart Methods:
isReadyToMerge(),hasMergeConflicts(),canRebase() - Human-Readable:
getMergeStatusDescription()for UI display - Null Handling: Proper support for GitHub's async "checking..." states
Laravel Collection Integration
- Reviews Endpoint: Now returns Collection instead of array
- Laravel Methods:
isEmpty(),filter(),map()now work correctly - Type Safety: Better IDE support and error prevention
π― Usage Examples
Intelligent Merge Decisions
$pr = Github::pullRequests()->detail('owner', 'repo', 42);
if ($pr->isReadyToMerge()) {
// β
Safe to merge - no conflicts
echo "β
" . $pr->getMergeStatusDescription();
} elseif ($pr->hasMergeConflicts()) {
// β οΈ Needs conflict resolution
echo "β οΈ " . $pr->getMergeStatusDescription();
}Enhanced Review Analysis
$reviews = Github::pullRequests()->reviews('owner', 'repo', 42);
if ($reviews->isEmpty()) {
echo "No reviews yet";
} else {
$approvals = $reviews->where('state', 'APPROVED');
echo "Approved by: " . $approvals->pluck('user.login')->join(', ');
}β Quality Assurance
- Tests: 7 comprehensive test scenarios (56 assertions)
- Coverage: All GitHub merge states (draft, blocked, behind, unstable, clean, dirty)
- Compatibility: Laravel 10, 11, 12 support maintained
- Static Analysis: PHPStan clean, PHP Pint formatted
π― Resolves Issues
- #87 - Add missing pr_data fields: mergeable, mergeable_state, merge_commit_sha
- #88 - Fix reviews endpoint to return Collection instead of array
- #89 - Add missing merge_data fields: mergeable, mergeable_state, rebaseable
π Impact
Perfect foundation for advanced GitHub automation workflows and tools like conduit that require intelligent PR analysis capabilities.
Full Changelog: v2.7.0...v2.8.0