Skip to content

feat: add deletion_policy field to reasoning engine resource#16744

Merged
slevenick merged 2 commits intoGoogleCloudPlatform:mainfrom
gwendal-lecren:feat/add_force_destroy
Mar 19, 2026
Merged

feat: add deletion_policy field to reasoning engine resource#16744
slevenick merged 2 commits intoGoogleCloudPlatform:mainfrom
gwendal-lecren:feat/add_force_destroy

Conversation

@gwendal-lecren
Copy link
Contributor

@gwendal-lecren gwendal-lecren commented Mar 17, 2026

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

vertexai: added `deletion_policy` field to `resource_vertex_ai_reasoning_engine` resource

@google-cla
Copy link

google-cla bot commented Mar 17, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot requested a review from slevenick March 17, 2026 18:51
@github-actions
Copy link

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

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

@gwendal-lecren
Copy link
Contributor Author

Related issue: hashicorp/terraform-provider-google#26443

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Mar 17, 2026
external_providers: ["time"]
ignore_read_extra:
- 'force_destroy'
virtual_fields:
Copy link
Contributor Author

@gwendal-lecren gwendal-lecren Mar 17, 2026

Choose a reason for hiding this comment

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

What the internal Magic Modules documentation says (mmv1/api/resource.go):

Virtual fields are similar to url_param_only fields in that they create a schema entry
which is not read from or submitted to the API.
However virtual fields are meant to provide toggles for Terraform-specific behavior 
in a resource (eg: delete_contents_on_destroy) whereas url_param_only fields 
should be used for url construction (like region or location).

So we should probably go with virtual field per my understanding, but not sure actually

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Ok this makes sense as written but I'm going to ask you to change some things to match an upcoming pattern that we are adding to the provider. Here's what needs to change:

  1. Change the name of the field to deletion_policy
  2. Change the type to an enum with a single value of FORCE
  3. Add a custom pre_delete for this resource that checks if the enum is set to FORCE and if so, adds the force query parameter to the deletion URL

This will allow us to add standardized support for the other deletion_policy possibilities in the future

@github-actions github-actions bot requested a review from slevenick March 17, 2026 22:07
@gwendal-lecren gwendal-lecren force-pushed the feat/add_force_destroy branch from df14a69 to 61ccc87 Compare March 17, 2026 22:12
@gwendal-lecren
Copy link
Contributor Author

gwendal-lecren commented Mar 17, 2026

Ok this makes sense as written but I'm going to ask you to change some things to match an upcoming pattern that we are adding to the provider. Here's what needs to change:

  1. Change the name of the field to deletion_policy
  2. Change the type to an enum with a single value of FORCE
  3. Add a custom pre_delete for this resource that checks if the enum is set to FORCE and if so, adds the force query parameter to the deletion URL

This will allow us to add standardized support for the other deletion_policy possibilities in the future

Nice, thanks! Changes applied :)

cc @slevenick

@gwendal-lecren gwendal-lecren changed the title feat: add force_destroy field to reasonin engine resource feat: add deletion_policy field to reasoning engine resource Mar 19, 2026
@slevenick
Copy link
Contributor

Are you able to sign the CLA?

@modular-magician modular-magician added service/aiplatform-agent-engine and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Mar 19, 2026
@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 ( 5 files changed, 25 insertions(+), 227 deletions(-))
google-beta provider: Diff ( 5 files changed, 25 insertions(+), 227 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_vertex_ai_reasoning_engine (10 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_vertex_ai_reasoning_engine" "primary" {
  deletion_policy = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 85
Passed tests: 82
Skipped tests: 3
Affected tests: 0

Click here to see the affected service packages
  • vertexai

🟢 All tests passed!

View the build log

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, this looks good. Can you add a test that sets this?

@gwendal-lecren gwendal-lecren force-pushed the feat/add_force_destroy branch from 61ccc87 to 797188a Compare March 19, 2026 21:30
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Mar 19, 2026
@github-actions github-actions bot requested a review from slevenick March 19, 2026 21:31
@gwendal-lecren gwendal-lecren force-pushed the feat/add_force_destroy branch from 797188a to f78985f Compare March 19, 2026 21:33
@gwendal-lecren gwendal-lecren force-pushed the feat/add_force_destroy branch from f78985f to a79d82e Compare March 19, 2026 21:42
@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Mar 19, 2026
@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 ( 5 files changed, 61 insertions(+), 227 deletions(-))
google-beta provider: Diff ( 5 files changed, 61 insertions(+), 227 deletions(-))
Open in Cloud Shell: Diff ( 4 files changed, 107 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 86
Passed tests: 82
Skipped tests: 3
Affected tests: 1

Click here to see the affected service packages
  • vertexai

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@slevenick slevenick added this pull request to the merge queue Mar 19, 2026
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