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

Fix overeager diffs #1927

Merged
merged 5 commits into from
May 6, 2024
Merged

Fix overeager diffs #1927

merged 5 commits into from
May 6, 2024

Conversation

t0yv0
Copy link
Member

@t0yv0 t0yv0 commented May 6, 2024

With AWS 3880 there is some evidence (derivation in #1917) that sometimes TF has entries in the InstanceDiff.Attributes while still planning to take the resource to the end-state that is identical to the original state. IN these cases, TF does not display a diff but Pulumi does.

The root cause here remains unfixed (#1895) - Pulumi bridge is editing terraform-pulgin-sdk to expose the InstanceDiff structure to connect it to the makeDetailedDiff machinery. Pulumi should, like TF, stick to the gRPC protocol and rely only on the PlannedState value.

We can incrementally approach the desired behavior with this change though which detects PlannedState=PriorState case and suppresses any diffs in this case.

Fixes:

@t0yv0 t0yv0 requested a review from VenelinMartinov May 6, 2024 16:47
Copy link

codecov bot commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.59%. Comparing base (0f364af) to head (69ff096).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1927      +/-   ##
==========================================
+ Coverage   60.26%   60.59%   +0.33%     
==========================================
  Files         329      329              
  Lines       44467    44422      -45     
==========================================
+ Hits        26797    26917     +120     
+ Misses      16170    15995     -175     
- Partials     1500     1510      +10     

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

@VenelinMartinov
Copy link
Contributor

VenelinMartinov commented May 6, 2024

LGTM. Are all the AWS issues you linked of the same shape as the test? Is there a meaningfully different schema on any of these resources which we can use for additional testing here?

@t0yv0 t0yv0 requested a review from iwahbe May 6, 2024 18:06
@t0yv0
Copy link
Member Author

t0yv0 commented May 6, 2024

They are slight variations on the same theme of Wafv2 nested schema.

@t0yv0 t0yv0 marked this pull request as ready for review May 6, 2024 18:07
Copy link
Contributor

@VenelinMartinov VenelinMartinov left a comment

Choose a reason for hiding this comment

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

lgtm

VenelinMartinov added a commit that referenced this pull request May 6, 2024
This reverts commit c57799f, reversing
changes made to e71c1a6.

reverts #1893

We have some downstream failures:

https://github.com/pulumi/pulumi-azure/actions/runs/8945276805/job/24576271881?pr=2001

https://github.com/pulumi/pulumi-github/actions/runs/8945161556/job/24576285007?pr=652

Some opened issues which look like prerequisites:
pulumi/pulumi-azure#1421 (related to the
failure above)
pulumi/pulumi-confluentcloud#264 (we don't
have credentials here, so likely why it did not produce a downstream
failure)

Anton also noted [some
issues](#1927)
with SkipDetailedDiff in AWS, so this change seems much less risky than
initially though.
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.

None yet

2 participants