feat: Issue model with chainable actions#32
Conversation
Implements IssueInstance service providing fluent API for managing GitHub issues: - Add Issue DTO enhancements (apiUrl, activeLockReason fields) - Add helper methods (isLocked, hasLabel, isAssignedTo) - Implement IssueInstance service with chainable methods: - update(), title(), body() - close(), reopen() - addLabel(), addLabels(), removeLabel(), setLabels() - assign(), assignTo(), unassign() - milestone() - lock(), unlock() - comment() - Add find() method to IssuesService - Create LockIssueRequest and UnlockIssueRequest - Comprehensive test coverage (99.4%) Closes #21
|
Warning Rate limit exceeded@jordanpartridge has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 12 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 (8)
✨ 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 IssueInstance service providing a fluent API for managing individual GitHub issues, following the RepositoryInstance pattern from conduit-ui/repo.
Changes
Issue DTO Enhancements
apiUrlfield for API endpoint referenceactiveLockReasonfield to track lock statusisLocked()- Check if issue is lockedhasLabel(string $label)- Check if issue has specific labelisAssignedTo(string $username)- Check if issue is assigned to userIssueInstance Service
Created new chainable service for managing individual issues:
Issue Updates:
update(array $attributes)- Update issue with custom attributestitle(string $title)- Update issue titlebody(string $body)- Update issue bodyState Management:
close(?string $reason)- Close issue (with optional reason: 'completed' or 'not_planned')reopen()- Reopen closed issueLabel Management:
addLabel(string $label)- Add single labeladdLabels(array $labels)- Add multiple labelsremoveLabel(string $label)- Remove specific labelsetLabels(array $labels)- Replace all labelsAssignment:
assign(string|array $assignees)- Assign to user(s)assignTo(string $username)- Convenience method for single assignmentunassign(string|array $assignees)- Remove assigneesmilestone(int|null $milestoneNumber)- Set milestoneLock Management:
lock(?string $reason)- Lock issue with optional reasonunlock()- Unlock issueComments:
comment(string $body)- Add comment to issueData Access:
get()- Get cached issue datafresh()- Fetch fresh issue data from API__get()for property accessSupporting Requests
LockIssueRequest- PUT request to lock issuesUnlockIssueRequest- DELETE request to unlock issuesIssuesService Integration
find(string $fullName, int $number)method to get IssueInstanceFacade Update
find()method documentationUsage Example
Test Coverage
Quality Gates
Closes #21