Skip to content

Fix application of pagination options on ListCopilotSeats endpoint#3090

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

Fix application of pagination options on ListCopilotSeats endpoint#3090
gmlewis merged 2 commits intogoogle: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
Copy link
Copy Markdown

google-cla bot commented Mar 4, 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.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 4, 2024

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.

Copy link
Copy Markdown
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, @ryanskidmore !
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Mar 4, 2024
Copy link
Copy Markdown
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.

Ah, whups - my bad, codecov reminded me that we need some more tests.
I'll point you to an example. One moment...


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

Copy link
Copy Markdown
Contributor Author

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!

@ryanskidmore ryanskidmore requested a review from gmlewis March 5, 2024 11:57
Copy link
Copy Markdown
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, @ryanskidmore !
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

@ryanskidmore
Copy link
Copy Markdown
Contributor Author

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

gmlewis commented Mar 21, 2024

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.

Copy link
Copy Markdown
Contributor

@be0x74a be0x74a left a comment

Choose a reason for hiding this comment

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

LGMT! 🚀

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Apr 29, 2024
@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented Apr 29, 2024

Thank you, @be0x74a !
Merging.

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.

3 participants