Skip to content
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 pagination for ListCopilotSeats #3112

Merged
merged 2 commits into from
Mar 26, 2024
Merged

Conversation

alinbalutoiu
Copy link
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.

Copy link

google-cla bot commented Mar 26, 2024

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.

@alinbalutoiu alinbalutoiu changed the title Fix pagination for Copilot Seats Fix pagination for ListCopilotSeats Mar 26, 2024
Copy link

codecov bot commented Mar 26, 2024

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.

Copy link
Collaborator

@gmlewis gmlewis left a comment

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() (err error) {
		_, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", nil)

to:

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

That should fix our code coverage problem.

@alinbalutoiu
Copy link
Contributor Author

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

Copy link
Collaborator

@gmlewis gmlewis left a comment

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:master Mar 26, 2024
6 of 7 checks passed
@alinbalutoiu
Copy link
Contributor Author

@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
Collaborator

gmlewis commented Mar 26, 2024

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

Sign up for free to 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