feat: Batch operations and collection methods (#27)#34
feat: Batch operations and collection methods (#27)#34jordanpartridge wants to merge 1 commit intomasterfrom
Conversation
…27) - Add IssueCollection class extending Laravel Collection - Filtering methods: withLabel, withoutLabel, open, closed, assigned, unassigned - Grouping methods: groupByLabel, groupByState, groupByAssignee - Statistics method for collection analysis - Add BatchOperations service for bulk issue operations - Batch processing with error handling - Progress tracking support - Graceful exception handling - Update IssueQuery to return IssueCollection instead of Collection - Enables higher-order proxy pattern ($collection->each->method()) - Provides specialized filtering and grouping capabilities - Comprehensive test coverage for all new functionality - IssueCollection filtering and grouping tests - BatchOperations processing and error handling tests - Updated IssueQuery tests for IssueCollection return type Closes #27
|
Warning Rate limit exceeded@jordanpartridge has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 15 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. 📒 Files selected for processing (6)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Summary
Implements batch operation support and higher-order collection methods for performing actions on multiple issues at once, as specified in issue #27.
Changes
IssueCollection Class (
src/Support/IssueCollection.php)A custom collection class extending Laravel's
Collectionwith specialized methods for working with issues:Filtering Methods:
withLabel(string $label)- Filter issues with a specific labelwithoutLabel(string $label)- Filter issues without a specific labelopen()- Filter open issuesclosed()- Filter closed issuesassigned()- Filter assigned issuesunassigned()- Filter unassigned issuesGrouping Methods:
groupByLabel()- Group issues by their labelsgroupByState()- Group issues by state (open/closed)groupByAssignee()- Group issues by assignee (with "unassigned" group)Analysis:
statistics()- Get comprehensive statistics about the collectionBatchOperations Service (
src/Services/BatchOperations.php)A service class for performing bulk operations on issues:
batch(IssueCollection $issues, callable $operation, ?callable $progress)- Process issues in batch with:Updated IssueQuery (
src/Services/IssueQuery.php)CollectiontoIssueCollection$issues->each->method()Usage Examples
Testing
IssueCollectionwith 14 test casesBatchOperationswith 8 test casesIssueQuerytests to expectIssueCollectionImplementation Notes
Closes #27