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

Respect schema timeouts on Delete and Update #1751

Merged
merged 1 commit into from
Mar 12, 2024
Merged

Respect schema timeouts on Delete and Update #1751

merged 1 commit into from
Mar 12, 2024

Conversation

t0yv0
Copy link
Member

@t0yv0 t0yv0 commented Mar 11, 2024

Fixes #1651

With this change, resources written against SDKv2 that specify a preferred timeout for Update and Delete operations in their schema will now have this preference respected in the bridged providers.

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 59.28%. Comparing base (54802d5) to head (ab4df10).

Files Patch % Lines
pkg/tfbridge/provider.go 57.14% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1751      +/-   ##
==========================================
- Coverage   59.79%   59.28%   -0.51%     
==========================================
  Files         300      307       +7     
  Lines       42025    42410     +385     
==========================================
+ Hits        25129    25143      +14     
- Misses      15474    15843     +369     
- Partials     1422     1424       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -1350,6 +1357,7 @@ func (p *Provider) Delete(ctx context.Context, req *pulumirpc.DeleteRequest) (*p
// Create a new destroy diff.
diff := p.tf.NewDestroyDiff(ctx, res.TFName, shim.TimeoutOptions{
TimeoutOverrides: newTimeoutOverrides(shim.TimeoutDelete, req.Timeout),
ResourceTimeout: res.TF.Timeouts(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you not need to decode them here but had to decode the timeouts in Update?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah it looks really weird. I copied what's in Create to what's in Update however in Delete there's no data to decode. I'm wondering if these two forms are equivalent actually.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can take a deeper dive to figure out if we can just use res.TF.Timeouts() everywhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

#1753 I've posted findings here, there is a slight difference and I'm inclined to keep it as is with keeping the mystery for later.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm happy with that, just wanted to make sure it is intentional

@t0yv0 t0yv0 merged commit 0dd1910 into master Mar 12, 2024
9 checks passed
@t0yv0 t0yv0 deleted the t0yv0/fix-1651 branch March 12, 2024 15:27
@t0yv0 t0yv0 added this to the 0.102 milestone Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incomplete schema timeouts handling
2 participants