Skip to content

Replaced BasePath usage in universe tests, acm, ad, alloydb, and apigee#17370

Merged
melinath merged 2 commits intoGoogleCloudPlatform:mainfrom
melinath:base-paths-rewrite-1
May 1, 2026
Merged

Replaced BasePath usage in universe tests, acm, ad, alloydb, and apigee#17370
melinath merged 2 commits intoGoogleCloudPlatform:mainfrom
melinath:base-paths-rewrite-1

Conversation

@melinath
Copy link
Copy Markdown
Member

@melinath melinath commented Apr 30, 2026

This is an initial set of replacements of BasePath usage in handwritten files with the transport_tpg.BaseUrl function.

Note: String concatenation is used instead of URL joining because URL joining would escape {} characters, preventing ReplaceVars from working properly.

Options considered:

  • This PR
    • Pros: compile time verification; explicit about how the base URL is calculated.
    • Cons: requires rewriting large number of handwritten files; some code duplication in that config has to be passed twice.
  • Pass product to ReplaceVars and implicitly add the base URL to the beginning of the URL
    • Pros: compile time verification; doesn't require passing config twice.
    • Cons: Breaks separation of concerns; ReplaceVars would no longer just be replacing vars. There's probably some usage somewhere outside of URL building that would need to be split out. More implicit behavior.
  • Automatically make ReplaceVars detect {{ProductNameBasePath}} variables, trim the BasePath suffix, look up the relevant product in the registry (with the lowercase productname), and compute its BaseUrl using the config that was also passed in.
    • Pros: ReplaceVars usage could remain unchanged - many fewer files would need to be modified. (There are about 960 uses of BasePaths in services, most of which are via ReplaceVars.)
    • Cons: ReplaceVars can't have compile time checks (this is also a problem today) and base URL calculation is implicit.
    • EDIT: Planning to do this as a compatibility shim to ease the migration off config.*BasePath fields: Handle *BasePath replacement with BaseUrl func #17385

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.


@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented Apr 30, 2026

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 42 files changed, 189 insertions(+), 165 deletions(-)
google-beta provider View Diff 42 files changed, 189 insertions(+), 165 deletions(-)

Test report

Analytics

Total Tests Passed Skipped Affected
6385 5714 655 16
Affected Service Packages
  • All service packages are affected

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 16 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccApigeeOrganization_apigeeOrganizationCloudBasicDisableVpcPeeringTestExample
  • TestAccApigeeOrganization_apigeeOrganizationCloudFullDisableVpcPeeringTestExample
  • TestAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample
  • TestAccCloudRunService_cloudRunServiceGpuExample
  • TestAccComputeRouterPeer_UpdateMd5AuthenticationKey
  • TestAccContainerCluster_updateVersion
  • TestAccContainerCluster_withAutopilotResourceManagerTags
  • TestAccContainerNodePool_autoscaling
  • TestAccContainerNodePool_withHostMaintenancePolicy
  • TestAccDataformConfig_update
  • TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
  • TestAccDataprocMetastoreService_dataprocMetastoreServicePrivateServiceConnectExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample
  • TestAccManagedKafkaConnector_managedkafkaConnectorBasicExample
  • TestAccProjectIamMemberRemove_memberInMultipleBindings
  • TestAccPubsubSubscription_pubsubSubscriptionTagsExample

View the build log


Step 2: Recording Mode

Test Name Recording Mode Replaying Rerun
TestAccApigeeOrganization_apigeeOrganizationCloudBasicDisableVpcPeeringTestExample 🔴 Failed [Error message] [Debug log] -
TestAccApigeeOrganization_apigeeOrganizationCloudFullDisableVpcPeeringTestExample 🔴 Failed [Error message] [Debug log] -
TestAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample 🔴 Failed [Error message] [Debug log] -
TestAccCloudRunService_cloudRunServiceGpuExample 🔴 Failed [Error message] [Debug log] -
TestAccComputeRouterPeer_UpdateMd5AuthenticationKey 🟢 Passed [Debug log] 🟢 Passed
TestAccContainerCluster_updateVersion 🔴 Failed [Error message] [Debug log] -
TestAccContainerCluster_withAutopilotResourceManagerTags 🔴 Failed [Error message] [Debug log] -
TestAccContainerNodePool_autoscaling 🟢 Passed [Debug log] 🟢 Passed
TestAccContainerNodePool_withHostMaintenancePolicy 🔴 Failed [Error message] [Debug log] -
TestAccDataformConfig_update 🟢 Passed [Debug log] 🟢 Passed
TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample 🔴 Failed [Error message] [Debug log] -
TestAccDataprocMetastoreService_dataprocMetastoreServicePrivateServiceConnectExample 🔴 Failed [Error message] [Debug log] -
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample 🔴 Failed [Error message] [Debug log] -
TestAccManagedKafkaConnector_managedkafkaConnectorBasicExample 🔴 Failed [Error message] [Debug log] -
TestAccProjectIamMemberRemove_memberInMultipleBindings 🟢 Passed [Debug log] 🔴 Failed [Error message] [Debug log]
TestAccPubsubSubscription_pubsubSubscriptionTagsExample 🔴 Failed [Error message] [Debug log] -

Caution

Issues requiring attention before PR completion

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

🔴 Replaying Rerun Failed: Some tests failed due to non-determinism when VCR replayed the response. 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 build log or the debug logs folder for detailed results.

@melinath VCR tests complete for b5eddb1!

@melinath melinath requested a review from SirGitsalot May 1, 2026 17:53
@melinath
Copy link
Copy Markdown
Member Author

melinath commented May 1, 2026

VCR failures look unrelated. In particular, the Apigee tests are failing the same way in nightly tests.

@melinath melinath added this pull request to the merge queue May 1, 2026
Merged via the queue into GoogleCloudPlatform:main with commit 3e261ae May 1, 2026
23 of 24 checks passed
@melinath melinath deleted the base-paths-rewrite-1 branch May 1, 2026 22:05
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.

3 participants