Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: Add support for Manual Deferred Actions #999

Merged
merged 27 commits into from
May 16, 2024

Conversation

SBGoods
Copy link
Contributor

@SBGoods SBGoods commented May 7, 2024

Ref: hashicorp/terraform-plugin-go#403

This PR implements manual deferred action support for ReadResource, ReadDataSource, ImportResourceState, and PlanResourceChange RPCs. It adds new resource.DeferredResponse and datasource.DeferredResponse structs so that providers can indicate a deferral to the Terraform client.

Deferred actions is an experimental feature introduced in Terraform v1.9.0-alpha20240404 and is only available in experimental Terraform builds.

A follow up PR will implement automatic deferred action support for PROVIDER_CONFIG_UNKNOWN during the ConfigureProvider RPC.

@SBGoods SBGoods requested a review from a team as a code owner May 7, 2024 21:20
Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

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

Changes look great! I have a couple questions about default values + an on-going discussion about experimental wording.

We'll need to figure out internally how we want to release this work (wait for automatic deferral work?)

.changes/unreleased/FEATURES-20240508-105105.yaml Outdated Show resolved Hide resolved
datasource/deferred.go Outdated Show resolved Hide resolved
datasource/deferred.go Outdated Show resolved Hide resolved
datasource/read.go Outdated Show resolved Hide resolved
internal/fwserver/server_importresourcestate.go Outdated Show resolved Hide resolved
internal/toproto5/importresourcestate.go Outdated Show resolved Hide resolved
resource/import_state.go Outdated Show resolved Hide resolved
resource/modify_plan.go Outdated Show resolved Hide resolved
resource/read.go Outdated Show resolved Hide resolved
@austinvalle austinvalle added this to the v1.9.0 milestone May 9, 2024
@austinvalle austinvalle added the enhancement New feature or request label May 9, 2024
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Drive-by minor comments since @austinvalle is already reviewing -- please let me know if you have any questions. 😄

datasource/read.go Outdated Show resolved Hide resolved
datasource/read.go Outdated Show resolved Hide resolved
internal/fromproto6/readdatasource_test.go Outdated Show resolved Hide resolved
internal/fwserver/server_readdatasource.go Outdated Show resolved Hide resolved
@SBGoods SBGoods requested review from bflad and austinvalle May 13, 2024 21:20
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, nice work. I'll let @austinvalle give the final 👍

datasource/read.go Outdated Show resolved Hide resolved
internal/fwserver/server_importresourcestate_test.go Outdated Show resolved Hide resolved
internal/toproto5/importresourcestate.go Outdated Show resolved Hide resolved
resource/modify_plan.go Outdated Show resolved Hide resolved
resource/read.go Outdated Show resolved Hide resolved
Co-authored-by: Brian Flad <bflad417@gmail.com>
Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

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

I have one final thought about the defaulting and perhaps moving it up to fromproto

internal/fromproto5/client_capabilities.go Outdated Show resolved Hide resolved
internal/fwserver/server_importresourcestate.go Outdated Show resolved Hide resolved
internal/fwserver/server_importresourcestate_test.go Outdated Show resolved Hide resolved
@SBGoods SBGoods requested a review from austinvalle May 14, 2024 20:37
@SBGoods SBGoods requested a review from austinvalle May 15, 2024 15:27
Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

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

LGTM, great work @SBGoods! 🚀

@SBGoods SBGoods merged commit 24d09fe into main May 16, 2024
28 checks passed
@SBGoods SBGoods deleted the SBGoods/deferred-action-support branch May 16, 2024 15:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants