Skip to content

Releases: jordanpartridge/github-client

v3.0.0 - Releases API & Optional Authentication

10 Aug 01:40
ffb5c47

Choose a tag to compare

🚀 What's New

Major Features

  • Releases Endpoint - Full support for GitHub Releases API

    • List all releases with pagination
    • Get specific release by ID
    • Get latest release
    • Complete DTO support for releases and assets
  • Optional Authentication - Work with public repos without tokens!

    • Automatic token discovery (GitHub CLI → env vars → config)
    • Public repositories accessible without authentication
    • Better rate limit messages with helpful guidance
  • Custom GitHub Connector - Full control over authentication

    • Replaced vendor dependency with our own implementation
    • Context-aware exception handling
    • Helpful error messages

💥 Breaking Changes

  • Dropped Laravel 10 support - Now requires Laravel 11+
    • Clean architecture decision - no workarounds, no tech debt
    • Supports Laravel 11 and 12 only
    • If you need Laravel 10, use v2.x

🔧 Technical Improvements

  • Removed conduit-ui/github-connector dependency
  • Better error handling throughout
  • Comprehensive test coverage (223 tests)
  • PSR-12 code style compliance

📦 Installation

composer require jordanpartridge/github-client:^3.0

🎯 Perfect for THE SHIT Ecosystem

This release is optimized for THE SHIT component system:

  • Check component versions without authentication
  • Automatic GitHub CLI token usage
  • Clean, modern Laravel support

Requirements

  • PHP 8.2+
  • Laravel 11+ (Laravel 10 users should stay on v2.x)

No workarounds. No tech debt. Just clean code.

v2.9.0: Complete Comment Management & API Consistency

26 Jul 22:52
d0c3612

Choose a tag to compare

🎯 v2.9.0: Complete Comment Management & API Consistency

This major release delivers comprehensive comment management capabilities and API consistency improvements, making github-client the most complete GitHub API client for comment automation.

🚀 Major Features

✅ Complete Comment Management CRUD (Issues #91, #92, #93)

Full lifecycle management for both issue/PR general comments and PR review comments:

Issue/PR General Comments

  • IssuesResource::getComment($owner, $repo, $commentId): IssueCommentDTO
  • IssuesResource::updateComment($owner, $repo, $commentId, $body): IssueCommentDTO
  • IssuesResource::deleteComment($owner, $repo, $commentId): bool

PR Review Comments (Inline Code Comments)

  • PullRequestResource::getComment($owner, $repo, $commentId): PullRequestCommentDTO
  • PullRequestResource::updateComment($owner, $repo, $commentId, $body): PullRequestCommentDTO
  • PullRequestResource::deleteComment($owner, $repo, $commentId): bool

✅ API Consistency Improvements (Issue #16)

Standardized repository operations with consistent validation:

  • All repository methods now use Repo value objects
  • Added convenience methods: Github::getRepo() and Github::deleteRepo()
  • Consistent validation patterns across all operations
  • 100% backward compatible

✅ Conduit CLI Integration Ready (Issue #93)

Complete design documentation for CLI development:

  • CONDUIT_CLI_INTEGRATION.md with command architecture
  • Implementation patterns for unified comment management
  • Ready-to-use examples for CLI developers

🎯 Use Cases Enabled

Developer Workflows

// Edit any comment type
$comment = Github::issues()->getComment('owner', 'repo', 12345);
$updated = Github::issues()->updateComment('owner', 'repo', 12345, 'Fixed in v2.9.0\!');

// Clean up review comments  
$reviewComment = Github::pullRequests()->getComment('owner', 'repo', 67890);
Github::pullRequests()->deleteComment('owner', 'repo', 67890);

// Consistent repo operations
$repo = Github::getRepo('owner/repo');  // Auto-validates
$success = Github::deleteRepo('owner/repo');  // Auto-validates

Automation Ready

  • CI/CD Comment Management: Update PRs with build status
  • Code Review Automation: Clean up resolved discussions
  • Issue Management: Programmatic comment updates
  • Bulk Operations: Process multiple comments efficiently

🔧 Technical Excellence

Quality Assurance

  • 204 tests passing (719 assertions)
  • PHPStan clean (0 errors)
  • PHP Pint compliant (auto-formatted)
  • Full backward compatibility maintained

New Request Classes (6 total)

  • Issues: GetComment.php, UpdateComment.php, DeleteComment.php
  • Pulls: GetComment.php, UpdateComment.php, DeleteComment.php

Enhanced Resources

  • IssuesResource: 3 new comment management methods
  • PullRequestResource: 3 new review comment methods
  • Consistent patterns and error handling throughout

📊 Impact

This release transforms github-client into a complete comment management platform, enabling:

  • Full Comment Lifecycle: Create, Read, Update, Delete for all comment types
  • Advanced Automation: Perfect for CI/CD and review workflows
  • Type-Safe APIs: Robust development with comprehensive validation
  • Conduit CLI Foundation: All APIs needed for CLI comment commands

🎉 Resolves

  • #91: Add CRUD operations for Issue/PR General Comments
  • #92: Add CRUD operations for PR Review Comments
  • #93: Add unified Comment Management commands to Conduit CLI (design)
  • #16: Inconsistent API Design and Parameter Handling
  • #94: Add missing pr_data fields (already resolved in v2.8.0)
  • #95: Add missing merge_data fields (already resolved in v2.8.0)

Perfect foundation for advanced GitHub automation and the most comprehensive comment management available! 🚀

🚀 Enhanced PR Analysis v2.8.0

21 Jul 13:56
1781241

Choose a tag to compare

🎯 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

v2.7.0: PR Diff Analysis Suite + Laravel 12 Support

21 Jul 04:03
e7e84fd

Choose a tag to compare

🎉 Major Feature Release: Comprehensive Pull Request Analysis

🆕 What's New

  • Issue #65: Advanced comment filtering & batch operations ✅
  • Issue #66: AI comment metadata extraction with reviewer patterns ✅
  • Issue #74: Complete PR diff analysis with file categorization ✅
  • Laravel 12 Support: Future-proofed for latest Laravel version ✅

🔍 PR Analysis Capabilities

  • File change analysis with 20+ language detection
  • Smart categorization: tests, configs, docs, code
  • Large change detection for security reviews
  • AI reviewer pattern recognition (CodeRabbit, SonarQube, etc.)

🏗️ Architecture Improvements

  • Revolutionary DTO pattern: Summary vs Detail DTOs
  • Enhanced comment filtering with severity analysis
  • Performance-optimized GitHub API usage
  • Memory-efficient batch operations

📊 Developer Experience

  • 31 comprehensive test cases added
  • Complete documentation guides
  • Backward compatible (100%)
  • Rich example usage patterns

🛡️ Security & Quality

  • Config change detection
  • Suspicious modification patterns
  • Audit trail capabilities
  • Rate limit protection

Perfect for CI/CD integration, code review automation, and AI-powered development tools! 🚀

📈 Stats

  • +3,494 lines of new functionality
  • 24 new files including DTOs, tests, and docs
  • 197 total tests with comprehensive coverage
  • Laravel 10, 11, 12 version support

v2.5.0 - Complete GitHub Issues API

19 Jul 20:05

Choose a tag to compare

v2.5.0 - Complete GitHub Issues API

🚀 Major New Features

Complete GitHub Issues API Implementation

This release brings comprehensive GitHub Issues functionality to the package, including full CRUD operations, comment management, and advanced filtering capabilities.

🎯 Core Features

  • Full CRUD Operations: Create, read, update, and close issues
  • Issue Comments: Add, list, and manage issue comments
  • Auto-Pagination: Seamlessly paginate through large issue lists
  • Advanced Filtering: Filter by state, labels, assignee, creator, and more
  • Defensive Programming: Robust error handling and null-safe operations

📦 New Components

Request Classes:

  • Get - Retrieve individual issues by number
  • Index - List user issues across all repositories
  • RepoIndex - List issues for specific repositories
  • Create - Create new issues with full metadata
  • Update - Update existing issues (title, body, state, etc.)
  • Comments - List issue comments
  • CreateComment - Add comments to issues

Data Transfer Objects:

  • IssueDTO - Complete issue data representation
  • IssueCommentDTO - Issue comment data structure
  • LabelDTO - Issue label information

Enums:

  • Issues\State - Issue states (open, closed, all)
  • Issues\Sort - Sort options (created, updated, comments)

Utilities:

  • HandlesIssueResponses - Trait for consistent response processing

💡 Usage Examples

// List user issues
$issues = GitHub::issues()->index(
    state: State::OPEN,
    labels: 'bug,enhancement',
    sort: Sort::CREATED,
    direction: Direction::DESC
);

// Get specific issue
$issue = GitHub::issues()->get('owner', 'repo', 42);

// Create new issue
$newIssue = GitHub::issues()->create('owner', 'repo', 'Bug Report', 
    bodyText: 'Detailed description...',
    labels: ['bug', 'priority-high'],
    assignees: ['username']
);

// Add comment
$comment = GitHub::issues()->createComment('owner', 'repo', 42, 'Thanks for reporting\!');

// Auto-pagination support
$allIssues = GitHub::issues()->index()->collect();

🛡️ Quality Improvements

  • Comprehensive Testing: 17 new test cases covering all functionality
  • Parameter Validation: Client-side validation for issue numbers and content
  • Pull Request Filtering: Automatically filters out PRs from issue listings
  • Error Handling: Graceful handling of incomplete API responses
  • Documentation: Full PHPDoc coverage for all public methods

🐛 Bug Fixes

  • PullRequestDTO Defensive Programming: Fixed missing null coalescing operators for optional fields
  • Issue/PR Separation: Proper filtering since GitHub's Issues API returns both
  • Empty Response Handling: Robust handling of malformed or incomplete API data

📊 Technical Details

  • 92 Test Cases with 256 assertions - all passing
  • 100% Backward Compatibility maintained
  • Defensive Programming patterns throughout
  • Type Safety with comprehensive DTOs and enums

Full Changelog: v2.4.0...v2.5.0

What's Changed

Full Changelog: v2.4.0...v2.5.0

v2.4.0 - Auto-Pagination & Enhanced PullRequest Operations

19 Jul 05:40
82e1b88

Choose a tag to compare

v2.4.0 - Auto-Pagination & Enhanced PullRequest Operations

🚀 Features

Auto-Pagination Enhancements

  • Enhanced auto-pagination functionality for repositories
  • Improved pagination handling with better error management
  • Seamless collection of large datasets

PullRequest Operations Improvements

  • Improved PullRequest operations with better error handling
  • Enhanced data validation and processing
  • More robust API response handling

Laravel 12 Support

  • Added full Laravel 12 compatibility
  • Updated dependencies and streamlined test matrix
  • Ensured backward compatibility with Laravel 10 and 11

Full Changelog: v2.3.0...v2.4.0

v2.3.0 - Simplify architecture: Remove Laravel Data dependency and migrate to conduit-ui/github-connector

27 Jun 08:01
40368f4

Choose a tag to compare

What's Changed

Full Changelog: v1.4.0...v2.3.0

🚀 Repository Search: Unlock the GitHub Universe\!

27 Jun 04:55
3b3aecd

Choose a tag to compare

🌟 GitHub Client v2.2.0: Repository Search is Here!

We're thrilled to announce the most exciting addition to GitHub Client yet - powerful repository search functionality! 🎉

✨ What's New

🔍 Repository Search Superpowers

Discover repositories like never before with our new search capabilities:

// Find all your favorite Laravel packages
$results = Github::repos()->search('laravel framework');

// Discover Conduit components 
$results = Github::repos()->search('topic:conduit-component');

// Get the most starred PHP projects
$results = Github::repos()->search(
    query: 'language:php',
    sort: 'stars',
    order: Direction::DESC,
    per_page: 50
);

🎯 Key Features

  • 🔥 Powerful Query Syntax: Leverage GitHub's full search capabilities with topics, languages, stars, and more
  • 📊 Smart Sorting: Sort by stars, forks, help-wanted-issues, or last updated
  • 📃 Pagination Support: Navigate through thousands of results effortlessly
  • 🛡️ Type Safety: Fully typed with DTOs and comprehensive validation
  • 📚 Rich Documentation: Complete with usage examples and best practices

🏗️ Built for the Future

This release builds on our solid v2.x foundation (Repository management + Issues support) and adds the final piece for Conduit component ecosystem - enabling dynamic discovery and installation of components based on GitHub topics.

🧪 Rock-Solid Quality

  • ✅ Comprehensive test suite with realistic mock data
  • ✅ Full CodeRabbit approval
  • ✅ Zero breaking changes - completely backwards compatible with v2.1.0
  • ✅ Follows established package patterns and conventions

🎊 What This Completes

With v2.2.0, GitHub Client now provides the complete toolkit:

  • v2.0: Repository management foundation
  • v2.1: Issues support for bug tracking
  • v2.2: Repository search for component discovery

Perfect for building component marketplaces, automated package systems, and CI/CD pipelines!

🙏 Thank You

This release represents a major milestone in making GitHub's vast repository ecosystem more accessible and discoverable. We can't wait to see what amazing things you'll build!

Happy coding! 🚀✨


P.S. - Keep an eye out for upcoming Conduit releases that will leverage this new search functionality for automatic component discovery!

v2.1.0 - GitHub Issues Support

17 Jun 04:29
b98ff9b

Choose a tag to compare

✨ New Features

📋 GitHub Issues Support

Complete GitHub Issues management functionality added to the client.

New IssueResource Methods:

  • 🔍 List issues - ->issues()->all('owner/repo', ['state' => 'open'])
  • 📝 Create issues - ->issues()->create('owner/repo', 'Title', 'Body', ['labels' => ['bug']])
  • 👁️ Get specific issue - ->issues()->get('owner/repo', 123)
  • ✏️ Update issues - ->issues()->update('owner/repo', 123, ['state' => 'closed'])

Request Classes Added:

  • ListIssuesRequest - List issues with filtering
  • GetIssueRequest - Get specific issue details
  • CreateIssueRequest - Create new issues
  • UpdateIssueRequest - Update existing issues

Filtering & Options:

  • Filter by state (open, closed, all)
  • Filter by labels, assignees, milestones
  • Sort by created, updated, or comments
  • Full pagination support

🔧 Integration:

  • Added issues() method to Github class
  • Added issues() method to GithubConnector
  • Updated GithubConnectorInterface with Issues support
  • Proper DTO support using Issue::from() pattern

🚀 AI & Automation Ready

Perfect foundation for:

  • AI-driven issue management
  • Automated bug reporting
  • Issue workflow automation
  • GitHub Zero CLI Issues commands

📦 Installation

composer require jordanpartridge/github-client:^2.1.0

💡 Usage Example

$github = new Github($connector);

// List open issues
$issues = $github->issues()->all('owner/repo', ['state' => 'open']);

// Create a new issue
$issue = $github->issues()->create('owner/repo', 'Bug Report', 'Description here', [
    'labels' => ['bug', 'priority-high']
]);

v2.0.0: The Great Service Provider Awakening 🚀

14 Jun 06:03
cc2f9bf

Choose a tag to compare

v2.0.0: The Great Service Provider Awakening 🚀

Breaking: This release might make your code slightly more organized. Viewer discretion advised.

🎭 What's New (In Order of Dramatic Impact)

🔧 Service Provider Gets Its Life Together

  • Fixed the facade alias because apparently GithubClient and Github are different things (who knew?)
  • Added explicit Github class binding - no more mysterious "I can't find my binding" errors
  • Token validation with attitude - now throws InvalidArgumentException with a passive-aggressive message about setting your GITHUB_TOKEN

🎪 The Command That Actually Does Something

  • Rewrote github-client command from "hello world" stub to actually useful functionality
  • Now supports test, repo info, and commits operations
  • Switched from constructor injection to facades because "facades are cheatting i would have dependecy injected but who cares" - actual user quote

🧪 Tests That Don't Hate You

  • Fixed all test failures by discovering GitUserData needs 19 fields, not 4 (GitHub is picky)
  • Added proper mock data structures that actually match what GitHub sends
  • Tests now pass instead of having existential crises

🤖 CI/CD Zen Master

  • Fixed nunomaduro/collision conflicts across Laravel versions (it's complicated)
  • Excluded PHP 8.2 + Laravel 12 combo because Laravel 12 is too cool for old PHP
  • Fixed testbench version mapping (Laravel 12 uses testbench 10., not 11. - mathematics is hard)
  • Added GITHUB_TOKEN to CI because static analysis gets lonely without it

📝 Documentation Renaissance

  • Enhanced README with actual examples instead of "TODO: write examples"
  • Added comprehensive ARCHITECTURE.md (because we're fancy now)
  • Updated Resource documentation with real information

🎯 PHPStan Enlightenment

  • Added proper PHPDoc annotations to facades so PHPStan stops complaining
  • Created phpstan-bootstrap.php to handle token requirements gracefully
  • Static analysis now works without real GitHub tokens (revolutionary!)

🎬 The Dramatic Stats

  • 1,095 total changes across 30+ files
  • 852 additions, 243 deletions (we're growing!)
  • All CI checks passing (miracles do happen)

🎪 Breaking Changes

  • Facade alias changed from GithubClient to Github (update your imports)
  • Service provider now validates GitHub token on boot (set GITHUB_TOKEN or face the consequences)

🏆 Credits

  • Jordan Partridge for asking "can you make this actually work?"
  • Claude for the over-engineering and then un-over-engineering
  • GitHub for having an API that's actually well-documented
  • Coffee for existing

🚀 What's Next?

  • World domination (or more GitHub API endpoints)
  • Maybe some OAuth improvements
  • Definitely more humorous release notes

Generated with excessive enthusiasm by Claude Code 🤖

Co-Authored-By: Claude noreply@anthropic.com