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 application of pagination options on ListCopilotSeats endpoint #3090

Merged

Conversation

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

Copy link

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.

Copy link

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

@@ -473,7 +477,7 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) {
lastActivityAt2 := Timestamp{tmp}

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

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

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

@ryanskidmore
Copy link
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
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
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
Collaborator

gmlewis commented Apr 29, 2024

Thank you, @be0x74a !
Merging.

@gmlewis gmlewis merged commit 715be39 into google:master Apr 29, 2024
6 of 7 checks passed
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