Skip to content

feat: PR assignee and milestone management (#32)#39

Merged
github-actions[bot] merged 1 commit intomasterfrom
feature/32-assignees-api
Dec 20, 2025
Merged

feat: PR assignee and milestone management (#32)#39
github-actions[bot] merged 1 commit intomasterfrom
feature/32-assignees-api

Conversation

@jordanpartridge
Copy link
Copy Markdown
Contributor

Summary

Implements comprehensive assignee and milestone management for pull requests, enabling team-based automation and project tracking.

Changes

Assignee Management

  • AssigneeManagerInterface - Contract defining fluent API for assignee operations
  • AssigneeManager - Service implementing get/add/addMany/remove/removeMany/replace/clear/has operations
  • PullRequest integration - Added assignees() method returning AssigneeManager instance

Milestone Management

  • Milestone DTO - Complete data transfer object with:
    • All GitHub milestone fields (number, title, description, state, due date, etc.)
    • Helper methods: isOpen(), isClosed(), isOverdue(), progress()
  • MilestoneManager - PR-level milestone operations (get/set/remove)
  • RepositoryMilestoneManager - Repository-level milestone CRUD:
    • get(), whereOpen(), whereClosed() - List milestones
    • find() - Get specific milestone
    • create(), update(), delete() - Manage milestones
  • PullRequest integration - Added milestone() and setMilestone() methods

API Request Classes

  • GetMilestone - Fetch single milestone
  • ListMilestones - List milestones with state filtering (open/closed/all)
  • CreateMilestone - Create new milestone with title, description, due date, state
  • UpdateMilestone - Update existing milestone
  • DeleteMilestone - Delete milestone

Testing

  • 100% test coverage across all new components
  • 290 passing tests (624 assertions)
  • Comprehensive unit tests for:
    • Milestone DTO with all helper methods
    • AssigneeManager service operations
    • MilestoneManager and RepositoryMilestoneManager services
    • All API request classes
    • PullRequest integration methods

Usage Examples

Assignee Management

$pr = PullRequests::find('owner/repo', 123);

// Fluent API
$pr->assignees()->add('jordan');
$pr->assignees()->addMany(['user1', 'user2']);
$pr->assignees()->remove('jordan');
$pr->assignees()->replace(['new-team']);
$pr->assignees()->clear();

// Check assignment
if ($pr->assignees()->has('jordan')) {
    // User is assigned
}

Milestone Management

// Set PR milestone
$pr->setMilestone(5);

// Get milestone with details
$milestone = $pr->milestone()->get();
echo $milestone?->title;
echo $milestone?->progress(); // 66.67

// Remove milestone
$pr->milestone()->remove();

Repository Milestone Operations

use ConduitUI\Pr\Services\RepositoryMilestoneManager;

$milestones = new RepositoryMilestoneManager($github, 'owner/repo');

// List milestones
$all = $milestones->get();
$open = $milestones->whereOpen();
$closed = $milestones->whereClosed();

// Create milestone
$milestone = $milestones->create(
    title: 'v2.0 Release',
    description: 'Major version 2.0',
    dueOn: Carbon::parse('2025-12-31')
);

// Update milestone
$milestones->update(5, state: 'closed');

// Delete milestone
$milestones->delete(5);

Automated Assignment

// Auto-assign based on file changes
$files = $pr->files();

if (collect($files)->wherePath('database/**/*')->isNotEmpty()) {
    $pr->assignees()->add('database-expert');
}

Progress Tracking

foreach ($milestones->whereOpen() as $milestone) {
    echo "{$milestone->title}: {$milestone->progress()}%\n";
    
    if ($milestone->isOverdue()) {
        echo "⚠️ Overdue!\n";
    }
}

Related

🤖 Generated with Claude Code

Implements comprehensive assignee and milestone management for pull requests:

**Assignee Management:**
- AssigneeManagerInterface contract with fluent API
- AssigneeManager service with get/add/remove/replace/clear/has methods
- Integration with PullRequest via assignees() method

**Milestone Management:**
- Milestone DTO with complete field mapping and helper methods (isOpen, isClosed, isOverdue, progress)
- MilestoneManager service for PR milestone operations (get/set/remove)
- RepositoryMilestoneManager for repository-level milestone CRUD operations
- Integration with PullRequest via milestone() and setMilestone() methods

**API Requests:**
- GetMilestone, ListMilestones (with state filtering)
- CreateMilestone, UpdateMilestone, DeleteMilestone
- Supports all milestone fields including due dates and descriptions

**Testing:**
- 100% test coverage for all new components
- Comprehensive unit tests for DTOs, services, and request classes
- Integration tests for PullRequest class methods

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 20, 2025

Warning

Rate limit exceeded

@jordanpartridge has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 53 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d4d6b06 and bd28018.

📒 Files selected for processing (17)
  • src/Contracts/AssigneeManagerInterface.php (1 hunks)
  • src/DataTransferObjects/Milestone.php (1 hunks)
  • src/PullRequest.php (2 hunks)
  • src/Requests/CreateMilestone.php (1 hunks)
  • src/Requests/DeleteMilestone.php (1 hunks)
  • src/Requests/GetMilestone.php (1 hunks)
  • src/Requests/ListMilestones.php (1 hunks)
  • src/Requests/UpdateMilestone.php (1 hunks)
  • src/Services/AssigneeManager.php (1 hunks)
  • src/Services/MilestoneManager.php (1 hunks)
  • src/Services/RepositoryMilestoneManager.php (1 hunks)
  • tests/Unit/DataTransferObjects/MilestoneTest.php (1 hunks)
  • tests/Unit/PullRequestAssigneesAndMilestonesTest.php (1 hunks)
  • tests/Unit/Requests/MilestoneRequestsTest.php (1 hunks)
  • tests/Unit/Services/AssigneeManagerTest.php (1 hunks)
  • tests/Unit/Services/MilestoneManagerTest.php (1 hunks)
  • tests/Unit/Services/RepositoryMilestoneManagerTest.php (1 hunks)
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/32-assignees-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot merged commit 23fee0d into master Dec 20, 2025
2 checks passed
@github-actions github-actions bot deleted the feature/32-assignees-api branch December 20, 2025 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assignees: PR assignee and milestone management

1 participant