Skip to content

Fix pagination for ListCopilotSeats - #3112

Merged
gmlewis merged 2 commits into
google:masterfrom
alinbalutoiu:master
Mar 26, 2024
Merged

Fix pagination for ListCopilotSeats#3112
gmlewis merged 2 commits into
google:masterfrom
alinbalutoiu:master

Conversation

@alinbalutoiu

Copy link
Copy Markdown
Contributor

The pagination must be passed as query parameters instead of request body according to the docs.

Currently this is silently failing but the pagination is broken if you've got lots of Copilot users.

@google-cla

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.

@alinbalutoiualinbalutoiu changed the title Fix pagination for Copilot SeatsFix pagination for ListCopilotSeatsMar 26, 2024
@codecov

codecovBot commented Mar 26, 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 (8c842e5).
Report is 27 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #3112 +/- ##
==========================================
- Coverage 97.72% 92.87% -4.85% 
==========================================
Files 153 170 +17 Lines 13390 11410 -1980 ==========================================
- Hits 13085 10597 -2488 - 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, @alinbalutoiu !

Before line 587 of copilot_test.go, could you please change those lines from:

testBadOptions(t, methodName, func() (errerror) {
_, _, err=client.Copilot.ListCopilotSeats(ctx, "\n", nil)

to:

opts:=&ListOptions{Page: 2}
testBadOptions(t, methodName, func() (errerror) {
_, _, err=client.Copilot.ListCopilotSeats(ctx, "\n", opts)

That should fix our code coverage problem.

@alinbalutoiu

Copy link
Copy Markdown
ContributorAuthor

Thank you @gmlewis, I missed that initially. Fixed it!

@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, @alinbalutoiu !
LGTM.
Merging.

@gmlewis
gmlewis merged commit 1891239 into google:masterMar 26, 2024
@alinbalutoiu

Copy link
Copy Markdown
ContributorAuthor

@gmlewis do you know when this will make into a release version? It would be super helpful to be able to pull a specific version of the library with this fix.

@gmlewis

Copy link
Copy Markdown
Collaborator

@gmlewis do you know when this will make into a release version? It would be super helpful to be able to pull a specific version of the library with this fix.

You can always pull in a specific version using the commit hash:
https://go.dev/wiki/Modules#daily-workflow

Otherwise, we try to release this repo approximately monthly which would be in a couple-ish weeks.

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.

2 participants

@alinbalutoiu@gmlewis