Skip to content

feat: PullRequestQuery builder with fluent filtering API#33

Merged
github-actions[bot] merged 1 commit intomasterfrom
feat/pr-query
Dec 19, 2025
Merged

feat: PullRequestQuery builder with fluent filtering API#33
github-actions[bot] merged 1 commit intomasterfrom
feat/pr-query

Conversation

@jordanpartridge
Copy link
Copy Markdown
Contributor

Summary

Implements the core PullRequestQuery builder enhancements with a fluent filtering API as specified in issue #20.

Changes

  • Created Contracts\PullRequestQueryInterface with all required method signatures
  • Enhanced QueryBuilder to implement PullRequestQueryInterface
  • Added new filtering methods:
    • whereMerged() - Filter for merged pull requests (client-side filtering)
    • whereDraft() - Filter for draft pull requests (client-side filtering)
    • whereBase(string $branch) - Filter by base branch (API-level)
    • whereHead(string $branch) - Filter by head branch (API-level)
  • All methods maintain fluent chainable interface
  • Client-side filtering for merged/draft states (GitHub API limitation)
  • API-level filtering for base/head branches (native GitHub API support)

Testing

  • 100% test coverage achieved
  • Added comprehensive test suite covering:
    • Interface implementation verification
    • All new filtering methods
    • Client-side filtering behavior
    • Method chaining capabilities
  • All quality gates passing:
    • ✓ Pest test suite (186 tests, 426 assertions)
    • ✓ Laravel Pint (code style)
    • ✓ PHPStan (static analysis)

Technical Notes

  • whereMerged() and whereDraft() use client-side filtering because GitHub's PR list API doesn't support these filters natively
  • Client-side filters are prefixed with _ internally to separate from API parameters
  • whereBase() and whereHead() map directly to GitHub API parameters for efficient server-side filtering

Closes #20

- Created PullRequestQueryInterface with all method signatures
- Enhanced QueryBuilder to implement PullRequestQueryInterface
- Added whereMerged() for filtering merged PRs (client-side)
- Added whereDraft() for filtering draft PRs (client-side)
- Added whereBase() for filtering by base branch
- Added whereHead() for filtering by head branch
- Comprehensive test suite with 100% coverage
- All quality gates passing (Pint, PHPStan)

Closes #20
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 19, 2025

Warning

Rate limit exceeded

@jordanpartridge has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 26 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between f56a7d2 and f105263.

📒 Files selected for processing (3)
  • src/Contracts/PullRequestQueryInterface.php (1 hunks)
  • src/QueryBuilder.php (5 hunks)
  • tests/Unit/QueryBuilderTest.php (1 hunks)
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/pr-query

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot merged commit 52a40fa into master Dec 19, 2025
2 checks passed
@github-actions github-actions bot deleted the feat/pr-query branch December 19, 2025 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Core: PullRequestQuery builder with fluent filtering API

1 participant