-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix!: Fix pagination support for IssuesService list methods
#3984
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: master
Are you sure you want to change the base?
fix!: Fix pagination support for IssuesService list methods
#3984
Conversation
|
@gmlewis, @alexandear and @Not-Dhananjay-Mishra can you please review this PR? |
IssuesService list methods
IssuesService list methodsIssuesService list methods
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3984 +/- ##
==========================================
- Coverage 93.53% 93.53% -0.01%
==========================================
Files 207 207
Lines 17610 17606 -4
==========================================
- Hits 16471 16467 -4
Misses 938 938
Partials 201 201 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gmlewis
left a comment
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.
Thank you, @maishivamhoo123!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra
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.
Also SubIssueService.ListByIssue ( Point 3 in #3976 ) also accepts IssueListOptions as one of the parameters so we can also include that in BREAKING CHANGE description
|
|
||
| // IssueListOptions specifies the optional parameters to the IssuesService.List | ||
| // and IssuesService.ListByOrg methods. | ||
| type IssueListOptions struct { |
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.
Since we are updating this struct, How about using * with omitempty fields to be consistent with rest of the repo.
Filter *string `url:"filter,omitempty"`
State *string `url:"state,omitempty"`
Labels []string `url:"labels,comma,omitempty"`
Sort *string `url:"sort,omitempty"`
Direction *string `url:"direction,omitempty"`
Since *time.Time `url:"since,omitempty"`After updating please remove these line from .golangci.yml
Lines 290 to 294 in e5024aa
| - IssueListOptions.Direction # TODO: Issues | |
| - IssueListOptions.Filter # TODO: Issues | |
| - IssueListOptions.Since # TODO: Issues | |
| - IssueListOptions.Sort # TODO: Issues | |
| - IssueListOptions.State # TODO: Issues |
| // Since filters issues by time. | ||
| Since time.Time `url:"since,omitempty"` | ||
|
|
||
| ListCursorOptions |
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.
I apologize for not trying IssuesService.ListByRepo endpoint manually previously. It supports cursor based pagination, so we can undo these changes.
Also, I tried IssuesService.List it works perfectly fine for me with page=100 and per_page=100. But I am not assigned to many issues so someone else please try and verify.
BREAKING CHANGE:
ListCursorOptionsis removed fromIssuesService.ListandIssuesService.ListByRepo.Updates: #3976.
Removed unsupported cursor pagination IssuesService.List and IssuesService.ListByRepo by deleting ListCursorOptions from issue option structs. Updated related unit tests accordingly.