feat: Issue model with chainable actions #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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