Skip to content

Fix application of pagination options on ListCopilotSeats endpoint - #3090

Merged
gmlewis merged 2 commits into
google:masterfrom
ryanskidmore:ryanskidmore/fix-copilot-pagination
Apr 29, 2024
Merged

Fix application of pagination options on ListCopilotSeats endpoint#3090
gmlewis merged 2 commits into
google:masterfrom
ryanskidmore:ryanskidmore/fix-copilot-pagination

Conversation

@ryanskidmore

Copy link
Copy Markdown
Contributor

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.

@google-cla

google-claBot commented Mar 4, 2024

Copy link
Copy Markdown

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

codecovBot commented Mar 4, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.87%. Comparing base (2b8c7fa) to head (1289d98).
Report is 19 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

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.

@gmlewisgmlewis added the NeedsReview PR is awaiting a review before merging. label Mar 4, 2024

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

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...

Comment threadgithub/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})

Copy link
Copy Markdown
Collaborator

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)
...constmethodName="ListCopilotSeats"testBadOptions(t, methodName, func() (errerror) {
_, _, err=client.Copilot.ListCopilotSeats(ctx, "\n", opts)
returnerr
})
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
got, resp, err:=client.Copilot.ListCopilotSeats(ctx, "o", opts)
ifgot!=nil {
t.Errorf("Copilot.ListCopilotSeats returned %+v, want nil", got)
}
returnresp, err
})

Copy link
Copy Markdown
ContributorAuthor

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!

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

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.

@ryanskidmore

Copy link
Copy Markdown
ContributorAuthor

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?

@gmlewis

Copy link
Copy Markdown
Collaborator

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.

@be0x74abe0x74a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT! 🚀

@gmlewisgmlewis removed the NeedsReview PR is awaiting a review before merging. label Apr 29, 2024
@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you, @be0x74a !
Merging.

@gmlewis
gmlewis merged commit 715be39 into google:masterApr 29, 2024
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ryanskidmore@gmlewis@be0x74a