-
Notifications
You must be signed in to change notification settings - Fork 735
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
Feature/#1025 #1239
Feature/#1025 #1239
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1239 +/- ##
============================================
+ Coverage 77.28% 77.42% +0.14%
- Complexity 1889 1899 +10
============================================
Files 188 189 +1
Lines 5943 5972 +29
Branches 328 327 -1
============================================
+ Hits 4593 4624 +31
+ Misses 1152 1150 -2
Partials 198 198
Continue to review full report at Codecov.
|
@bloslo I've invited you to the |
Yeah, probably. I'm also wondering if |
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.
Sorry for the second round of feedback. I took a closer look this time around and saw a couple things I missed. The label
change is pretty much as written in the suggestions. The class structure change, the suggested code is for clarity and there are a bunch more changes to be made.
Thanks for you patience and perseverance.
|
||
public class GHIssueQueryBuilder extends GHQueryBuilder<GHIssue> { | ||
private final GHRepository repo; | ||
private List<String> labels = new ArrayList<>(); |
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.
private List<String> labels = new ArrayList<>(); | |
private final List<String> labels = new ArrayList<>(); |
return req.with("labels", labels.stream().collect(Collectors.joining(","))) | ||
.withUrlPath(repo.getApiTailUrl("issues")) |
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.
return req.with("labels", labels.stream().collect(Collectors.joining(","))) | |
.withUrlPath(repo.getApiTailUrl("issues")) | |
return req.withUrlPath(repo.getApiTailUrl("issues")) |
@@ -2,7 +2,7 @@ | |||
"id": "a70d05ac-5820-4749-8318-e422f0f6eaf5", | |||
"name": "repos_hub4j_github-api_issues", | |||
"request": { | |||
"url": "/repos/hub4j/github-api/issues?state=closed", | |||
"url": "/repos/hub4j/github-api/issues?state=closed&labels=", |
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.
&labels=
is a no-op parameter and should not be present.
"url": "/repos/hub4j/github-api/issues?state=closed&labels=", | |
"url": "/repos/hub4j/github-api/issues?state=closed", |
@@ -2,7 +2,7 @@ | |||
"id": "b87318fd-8120-4fad-8c4d-553dafde3319", | |||
"name": "repos_hub4j_github-api_issues", | |||
"request": { | |||
"url": "/repos/hub4j/github-api/issues?state=closed", | |||
"url": "/repos/hub4j/github-api/issues?state=closed&labels=", |
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.
"url": "/repos/hub4j/github-api/issues?state=closed&labels=", | |
"url": "/repos/hub4j/github-api/issues?state=closed", |
"id": "92abb44d-1298-496e-a8e9-ae447ffc68a1", | ||
"name": "repos_hub4j-test-org_testqueryissues_issues", | ||
"request": { | ||
"url": "/repos/hub4j-test-org/testQueryIssues/issues?state=all&mentioned=bloslo&since=1970-01-19T21%3A26%3A51Z&sort=comments&direction=asc&labels=", |
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.
"url": "/repos/hub4j-test-org/testQueryIssues/issues?state=all&mentioned=bloslo&since=1970-01-19T21%3A26%3A51Z&sort=comments&direction=asc&labels=", | |
"url": "/repos/hub4j-test-org/testQueryIssues/issues?state=all&mentioned=bloslo&since=1970-01-19T21%3A26%3A51Z&sort=comments&direction=asc", |
List<GHIssue> openBugIssues = gitHub.getOrganization("hub4j-test-org") | ||
.getRepository("testQueryIssues") |
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.
These don't need to request the repo again each time. Once you make this change, re-record to test data.
List<GHIssue> openBugIssues = gitHub.getOrganization("hub4j-test-org") | |
.getRepository("testQueryIssues") | |
final GHRepository repo = gitHub.getOrganization("hub4j-test-org") | |
.getRepository("testQueryIssues"); | |
List<GHIssue> openBugIssues = repo |
List<GHIssue> openIssuesWithAssignee = gitHub.getOrganization("hub4j-test-org") | ||
.getRepository("testQueryIssues") |
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.
List<GHIssue> openIssuesWithAssignee = gitHub.getOrganization("hub4j-test-org") | |
.getRepository("testQueryIssues") | |
List<GHIssue> openIssuesWithAssignee = repo |
List<GHIssue> allIssuesSince = gitHub.getOrganization("hub4j-test-org") | ||
.getRepository("testQueryIssues") |
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.
List<GHIssue> allIssuesSince = gitHub.getOrganization("hub4j-test-org") | |
.getRepository("testQueryIssues") | |
List<GHIssue> allIssuesSince = repo |
…ory` as suggested.
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.
Excellent!
Description
Add
GHIssueQueryBuilder
. Closes #1025.I didn't use the
GHIssueQueryBuilder
as a base class for theGHPullRequestQueryBuilder
as suggested in the issue because of the different query parameters the two endpoints list.I was wondering should the
listIssues
method inGHRepository
be marked for deprecation? Similar to thelistPullRequests
method in the same class.