Skip to content

Batch Projects.Get requests for google_project_service - #18890

Open
joscha-alisch wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
joscha-alisch:batch-project-service-read-project
Open

Batch Projects.Get requests for google_project_service#18890
joscha-alisch wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
joscha-alisch:batch-project-service-read-project

Conversation

@joscha-alisch

@joscha-alisch joscha-alisch commented Sep 3, 2026

Copy link
Copy Markdown

In the past, batching was introduced for service list requests in google_project_service to fix slow refreshes and prevent running into rate limiting. This already improved the situation a lot. However, there is still an additional request to Project.Get being made for every single google_project_service, to identify whether the containing project had been scheduled for deletion in the meantime.

I tested this with a project with ~100 services enabled. Without batching i could see the ~100 requests to list services, in addition to another ~100 requests to get the same project all over again. With batching enabled (and the necessary parallelism enabled), the requests to list services were all correctly batched to a single request. The ~100 Project.Get requests however stayed, effectively only realising half of the potential speed up that batching can achieve here.

This PR introduces request batching also for the Project.Get requests, bringing the number of requests for any number of google_project_service (on the same project) to a static 2 (if parallelism is sufficient).

Contributes to

Release Note Template for Downstream PRs (will be copied)

resourcemanager: reduced redudant `Projects.Get` API calls in `google_project_service` during refresh by batching them per project

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Googlers: For automatic test runs see go/terraform-auto-test-runs.

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

@github-actions
github-actions Bot requested a review from rileykarson September 3, 2026 21:12
@modular-magician modular-magician added service/serviceusage and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Sep 3, 2026
@modular-magician

modular-magician commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 3 files changed, 184 insertions(+), 16 deletions(-)
google-beta provider View Diff 3 files changed, 184 insertions(+), 16 deletions(-)

Test report

Analytics

Total Tests Passed Skipped Affected
188 156 31 1
Affected Service Packages
  • resourcemanager

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccProjectIamMemberRemove_memberInMultipleBindings

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccProjectIamMemberRemove_memberInMultipleBindings

🟢 All tests passed!

View the recording VCR build log or the debug logs folder for detailed results.

@joscha-alisch, @rileykarson VCR tests complete for 499b110!

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.

2 participants