Skip to content

discoveryengine: add pre-delete hook to detach stores on destroy#17273

Open
btkelly wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
btkelly:fix-data-connector-deletion
Open

discoveryengine: add pre-delete hook to detach stores on destroy#17273
btkelly wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
btkelly:fix-data-connector-deletion

Conversation

@btkelly
Copy link
Copy Markdown
Member

@btkelly btkelly commented Apr 23, 2026

This PR adds a custom pre_delete hook for the google_discovery_engine_data_connector resource to handle destruction order dependencies. It introduces a virtual field detach_stores_on_destroy that, when set to true, detaches linked data stores from search engines before deletion, preventing dependency errors.

Manual tests were successful on a failing module. A test case was added but skipped to avoid failing builds due to IdP setup requirements (matching the pattern for this resource).

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

discoveryengine: added `detach_stores_on_destroy` field to `google_discovery_engine_data_connector` resource to handle destruction order dependencies

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Apr 23, 2026
@github-actions github-actions Bot requested a review from melinath April 23, 2026 21:27
@github-actions
Copy link
Copy Markdown

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

@melinath, 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 service/discoveryengine and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Apr 23, 2026
@modular-magician
Copy link
Copy Markdown
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 ( 4 files changed, 253 insertions(+))
google-beta provider: Diff ( 4 files changed, 253 insertions(+))

@modular-magician
Copy link
Copy Markdown
Collaborator

Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccDiscoveryEngineDataConnector_detachStoresOnDestroy

Tests analytics

Total tests: 41
Passed tests: 35
Skipped tests: 5
Affected tests: 1

Click here to see the affected service packages
  • discoveryengine

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
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample

Get to know how VCR tests work

@modular-magician
Copy link
Copy Markdown
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample [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

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