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. |
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @ryanskidmore !
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
gmlewis
left a comment
There was a problem hiding this comment.
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
|
|
||
| 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.
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.
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!
gmlewis
left a comment
There was a problem hiding this comment.
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. |
|
Thank you, @be0x74a ! |
The pagination options were previously being applied as the Request body, instead of applied to the URL as in other
Listendpoints. This PR ensures that these options are correctly applied to the URL and introduces additional parameters in the test case to ensure this.