-
Notifications
You must be signed in to change notification settings - Fork 772
feat: limit searching issues based on type #2186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2186 +/- ##
============================================
+ Coverage 85.03% 85.06% +0.02%
- Complexity 2499 2503 +4
============================================
Files 237 237
Lines 7366 7371 +5
Branches 388 388
============================================
+ Hits 6264 6270 +6
+ Misses 871 870 -1
Partials 231 231 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| * @return the gh issue search builder | ||
| */ | ||
| public GHIssueSearchBuilder isIssue() { | ||
| return q("is:issue"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should also ensure that is:pr is removed if present.
| * @return the gh issue search builder | ||
| */ | ||
| public GHIssueSearchBuilder isPullRequest() { | ||
| return q("is:pr"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should also ensure that is:issue is removed if present.
| .sort(GHIssueSearchBuilder.Sort.UPDATED) | ||
| .list(); | ||
| assertThat(r.getTotalCount(), greaterThan(0)); | ||
| for (GHIssue issue : r) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway to shorten the return list? If we can test this without storing several pages of json that we don't really care about.
Maybe isClosed() and sort.CREATED, then read the first few records?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm fair request! 👍🏼
| .isPullRequest() | ||
| .isOpen() | ||
| .sort(GHIssueSearchBuilder.Sort.UPDATED) | ||
| .list(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway to shorten the return list? If we can test this without storing several pages of json that we don't really care about.
Maybe isClosed() and sort.CREATED, then read the first few records?
19c50cd to
daa5eac
Compare
Description
Changes
isPullRequest=> filter issues down topull_requestsonly.isIssue=> filter issues down toissueonly.repo=> allow limit the search to a specific repository of given organization.https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests
Before submitting a PR:
@linkJavaDoc entries to the relevant documentation on https://docs.github.com/en/rest .mvn -D enable-ci clean install site "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"locally. If this command doesn't succeed, your change will not pass CI.main. You will create your PR from that branch.When creating a PR: