Skip to content

πŸš€ Enhanced PR Analysis v2.8.0

Choose a tag to compare

@jordanpartridge jordanpartridge released this 21 Jul 13:56
· 12 commits to master since this release
1781241

🎯 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, rebaseable in 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