-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix application of pagination options on ListCopilotSeats endpoint #3090
Fix application of pagination options on ListCopilotSeats endpoint #3090
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3090 +/- ##
==========================================
- Coverage 97.72% 92.87% -4.86%
==========================================
Files 153 170 +17
Lines 13390 11406 -1984
==========================================
- Hits 13085 10593 -2492
- Misses 215 723 +508
Partials 90 90 ☔ View full report in Codecov by Sentry. |
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, @ryanskidmore !
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
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.
Ah, whups - my bad, codecov reminded me that we need some more tests.
I'll point you to an example. One moment...
github/copilot_test.go
Outdated
@@ -473,7 +477,7 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { | |||
lastActivityAt2 := Timestamp{tmp} | |||
|
|||
ctx := context.Background() | |||
got, _, err := client.Copilot.ListCopilotSeats(ctx, "o", nil) | |||
got, _, err := client.Copilot.ListCopilotSeats(ctx, "o", &ListOptions{Page: 1, PerPage: 100}) |
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.
In this test, we will also want to add:
opts := &ListOptions{Page: 1, PerPage: 100}
got, _, err := client.Copilot.ListCopilotSeats(ctx, "o", opts)
...
const methodName = "ListCopilotSeats"
testBadOptions(t, methodName, func() (err error) {
_, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", opts)
return err
})
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
got, resp, err := client.Copilot.ListCopilotSeats(ctx, "o", opts)
if got != nil {
t.Errorf("Copilot.ListCopilotSeats returned %+v, want nil", got)
}
return resp, err
})
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.
Added these in - ty for the heads up. I don't think I can trigger the codecov workflow so I'm not sure if this has increased the coverage by enough!
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, @ryanskidmore !
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
Hey @gmlewis just wanted to follow up on this. I noticed codecov is still failing, do I need to add any more tests to this? |
No, codecov has been pretty unreliable lately. You can ignore it in this case. |
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.
LGMT! 🚀
Thank you, @be0x74a ! |
The pagination options were previously being applied as the Request body, instead of applied to the URL as in other
List
endpoints. This PR ensures that these options are correctly applied to the URL and introduces additional parameters in the test case to ensure this.