feat: Implement Core PullRequestQuery Builder#38
Conversation
Enhanced QueryBuilder with comprehensive filtering and querying capabilities: - Added label filtering: whereLabel(), whereLabels() (match any), whereAllLabels() (match all) - Added execution methods: exists(), pluck() - Added state filter aliases: whereOpen(), whereClosed(), whereState(), whereAuthor() - Added ordering shortcuts: orderByCreated(), orderByUpdated(), orderByPopularity(), orderByLongRunning() - Added pagination alias: perPage() - Added repository alias: repo() - Implemented client-side filtering for whereAllLabels() All methods support fluent chaining and maintain existing QueryBuilder patterns. 100% test coverage with 20 new tests covering all enhanced features.
|
Caution Review failedThe pull request is closed. WalkthroughThe pull request adds 15 public convenience methods to the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
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 |
Adds seven new interface contracts and two supporting DTOs that scope out the API surface for features still in flight (Checks, Merge strategies, Files API, PR creation, Comments). Implementation PRs for those features can target these contracts directly. New interfaces: - CheckRunQueryInterface (#23) - CommentManagerInterface (#29) - FileQueryInterface (#25) - MergeManagerInterface (#24) - PullRequestBuilderInterface (#26) - PullRequestManagerInterface - ReviewQueryInterface New DTOs: - CheckSummary — aggregated check run statistics - FileStats — aggregated file change statistics Excluded vs. the original branch: - PullRequestQueryInterface — already shipped in master via #38, kept as-is. - ReviewBuilderInterface — already shipped via #36, kept as-is. - PullRequestActionsInterface — the package adopted a role-trait pattern instead (Assignable, Closeable, Mergeable, Labelable, Commentable, Reviewable, Auditable), so the bundled actions interface is omitted. Closes #27.
Adds seven new interface contracts and two supporting DTOs that scope out the API surface for features still in flight (Checks, Merge strategies, Files API, PR creation, Comments). Implementation PRs for those features can target these contracts directly. New interfaces: - CheckRunQueryInterface (#23) - CommentManagerInterface (#29) - FileQueryInterface (#25) - MergeManagerInterface (#24) - PullRequestBuilderInterface (#26) - PullRequestManagerInterface - ReviewQueryInterface New DTOs: - CheckSummary — aggregated check run statistics - FileStats — aggregated file change statistics Excluded vs. the original branch: - PullRequestQueryInterface — already shipped in master via #38, kept as-is. - ReviewBuilderInterface — already shipped via #36, kept as-is. - PullRequestActionsInterface — the package adopted a role-trait pattern instead (Assignable, Closeable, Mergeable, Labelable, Commentable, Reviewable, Auditable), so the bundled actions interface is omitted. Closes #27.
Summary
Implements the core PullRequestQuery builder with comprehensive fluent filtering API, addressing issue #20.
Enhanced Capabilities
Label Filtering
whereLabel(string $label)- Filter by single label (alias for existinglabel())whereLabels(array $labels)- Filter by multiple labels (match any)whereAllLabels(array $labels)- Filter by multiple labels (match all, client-side)Execution Methods
exists(): bool- Check if any results existpluck(string $key): array- Extract a single field from all resultsFluent Aliases
whereOpen(),whereClosed(),whereState()- State filtering aliaseswhereAuthor()- Author filtering aliasrepo()- Repository context aliasOrdering Shortcuts
orderByCreated(string $direction = 'desc')orderByUpdated(string $direction = 'desc')orderByPopularity()- Order by comment countorderByLongRunning()- Order by oldest updated firstPagination
perPage(int $count)- Alias fortake()Implementation Details
whereAllLabels()to support complex label matchingTest Coverage
Quality Gates
Closes #20
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.