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

Add missing pagination for data source google_service_accounts #12763

Conversation

bestefreund
Copy link
Contributor

@bestefreund bestefreund commented Jan 15, 2025

Adds pagination for querying service accounts

Fixes: hashicorp/terraform-provider-google#20920

Release Note Template for Downstream PRs (will be copied)

iam: fixed missing result by adding pagination for data source `google_service_accounts`.

@github-actions github-actions bot requested a review from BBBmau January 15, 2025 16:10
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@BBBmau, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 15, 2025
@bestefreund bestefreund changed the title fix(resourcemanager): pagination for data_source_google_service_accounts Add missing pagination for data source google_service_accounts Jan 15, 2025
@modular-magician modular-magician added service/iam-serviceaccount and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jan 15, 2025
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 1 file changed, 21 insertions(+), 15 deletions(-))
google-beta provider: Diff ( 1 file changed, 21 insertions(+), 15 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 159
Passed tests: 127
Skipped tests: 30
Affected tests: 2

Click here to see the affected service packages
  • resourcemanager

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDataSourceGoogleServiceAccounts_basic
  • TestAccEphemeralServiceAccountKey_basic

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccDataSourceGoogleServiceAccounts_basic [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccEphemeralServiceAccountKey_basic [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@bestefreund
Copy link
Contributor Author

bestefreund commented Jan 17, 2025

Hi @BBBmau ,

please, have a look on this bugfix and let me know, if there's anything more I can contribute to resolve it.

Kind regards!

}
request := config.NewIamClient(userAgent).Projects.ServiceAccounts.List("projects/" + project)

err = request.Pages(context.Background(), func(accountList *iam.ListServiceAccountsResponse) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

glad to see that there's a simple way to do pagination! If you're interested you can work on hashicorp/terraform-provider-google#19157

standardizing pagination is something we should really look into with more and more issues being brought up about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @BBBmau ,

thank you very much!
I'll have a look on it.

Kind regards!

@BBBmau
Copy link
Collaborator

BBBmau commented Jan 18, 2025

/gcbrun

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 18, 2025
@BBBmau BBBmau merged commit 5b7326c into GoogleCloudPlatform:main Jan 18, 2025
13 of 17 checks passed
@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 18, 2025
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing pagination support for data source google_service_accounts
3 participants