feat: Label management API with fluent builder#29
feat: Label management API with fluent builder#29jordanpartridge wants to merge 1 commit intomasterfrom
Conversation
- Added Label DTO with default field and color utility methods (hexColor, isLightColor) - Implemented RepositoryLabelManager for repository-level label operations - Implemented IssueLabelManager for issue-level label operations - Created LabelBuilder with fluent API and predefined GitHub color presets - Added sync functionality to RepositoryLabelManager for batch operations - Created all required Saloon Request classes for both repository and issue label operations - 100% test coverage with comprehensive unit tests - PHPStan level max compliance Closes #23
|
Warning Rate limit exceeded@jordanpartridge has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 6 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 (18)
✨ 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 a comprehensive label management system with support for creating, updating, deleting, and querying labels at both the repository and issue level with a fluent API for batch operations and color management.
Closes #23
Changes
Label DTO Enhancements
defaultfield to Label DTO to track default labelshexColor()method to get color with#prefixisLightColor()method to detect light/dark colors using brightness calculationRepository-Level Label Management
all()- Get all repository labelsfind(string $name)- Get a specific labelcreate(string $name, string $color, ?string $description)- Create new labelupdate(string $name, array $attributes)- Update existing labeldelete(string $name)- Delete a labelsync(array $labels)- Sync labels from array (create/update/delete)builder()- Get fluent builder instanceIssue-Level Label Management
all()- Get all labels for an issueadd(string|array $labels)- Add single or multiple labelsremove(string $label)- Remove a labelset(array $labels)- Replace all labelsclear()- Remove all labelsFluent Label Builder
name(string $name)- Set label namecolor(string $color)- Set custom colordescription(string $description)- Set descriptionred()- d73a4a (bugs, critical)orange()- d4a72c (warnings)yellow()- fef2c0 (needs attention)green()- 0e8a16 (improvements)blue()- 1d76db (information)purple()- 5319e7 (questions)pink()- e99695 (design)gray()- d1d5da (stale)create()- Execute label creationRequest Classes
Created 10 new Saloon Request classes for GitHub API integration:
Usage Examples
Testing
Quality Gates