Skip to content

Migrate data_source_google_compute_images.go data source to use direct HTTP rather than a client library - #18466

Draft
GitOleksandrBokov wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
GitOleksandrBokov:data_source_google_compute_images-migration
Draft

Migrate data_source_google_compute_images.go data source to use direct HTTP rather than a client library#18466
GitOleksandrBokov wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
GitOleksandrBokov:data_source_google_compute_images-migration

Conversation

@GitOleksandrBokov

Copy link
Copy Markdown
Contributor

Part of the ongoing migration of handwritten compute files from the Apiary client library to direct HTTP calls (transport_tpg.SendRequest). Same pattern as #18444 and the merged data source migrations #17090 / #17117.

  • Replaces NewClient(...).Images.List(project).Filter(filter).Do() with GET projects/{project}/global/images via transport_tpg.SendRequest + transport_tpg.AddQueryParams.
  • Adds pageToken pagination. The previous code issued a single Do() call, which returns only the first page (server default 500 items) and silently truncated larger projects.
  • The filter query parameter is sent unconditionally (even when empty) to keep the request shape identical to the typed client, so the recorded VCR cassette stays replay-compatible. pageToken is only sent when non-empty for the same reason.
  • The REST API serializes int64/uint64 fields as JSON strings; archiveSizeBytes, diskSizeGb and id are parsed explicitly. id is uint64 upstream, so it is parsed with ParseUint and cast to int64 (same numeric behavior as the previous struct-based conversion).
  • No schema, test, or documentation changes.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

compute: migrated `google_compute_images` data source to use direct HTTP rather than a client library
compute: fixed truncation of results at 500 images in `google_compute_images` data source

@modular-magician

modular-magician commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 1 file changed, 73 insertions(+), 18 deletions(-)
google-beta provider View Diff 1 file changed, 73 insertions(+), 18 deletions(-)

Test report

Analytics

Total Tests Passed Skipped Affected
1555 1458 95 2
Affected Service Packages
  • compute

Learn how VCR tests work


Step 1: Replaying Mode

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
  • TestAccComputeInstanceFromMachineImage_diffProject
  • TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccComputeInstanceFromMachineImage_diffProject
❌ Error · Log - TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

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

@GitOleksandrBokov VCR tests complete for 278e059!

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