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

PF detailed diff #2629

Merged
merged 16 commits into from
Nov 25, 2024
Merged

PF detailed diff #2629

merged 16 commits into from
Nov 25, 2024

Conversation

VenelinMartinov
Copy link
Contributor

@VenelinMartinov VenelinMartinov commented Nov 18, 2024

This change integrates the detailed diff v2 algorithm for the Plugin Framework bridge. This leads to better previews for many common operations.

Will follow-up on #2660 as the only regression compared to not computing the detailed diff in the bridge.

fixes #752
fixes #2647
fixes #2649
fixes #2650

@VenelinMartinov
Copy link
Contributor Author

VenelinMartinov commented Nov 18, 2024

@VenelinMartinov VenelinMartinov changed the title todo secrets PF detailed diff Nov 18, 2024
@VenelinMartinov VenelinMartinov marked this pull request as draft November 18, 2024 18:15
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 71.87500% with 9 lines in your changes missing coverage. Please review.

Project coverage is 69.43%. Comparing base (ea35eb2) to head (897bf79).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/pf/tfbridge/provider_diff.go 67.85% 6 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2629      +/-   ##
==========================================
+ Coverage   69.39%   69.43%   +0.04%     
==========================================
  Files         301      301              
  Lines       38560    38590      +30     
==========================================
+ Hits        26759    26796      +37     
+ Misses      10281    10270      -11     
- Partials     1520     1524       +4     

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


🚨 Try these New Features:

@VenelinMartinov VenelinMartinov force-pushed the vvm/fix_provider_server_detailed_diff1 branch from b677d0f to 3d1d6b5 Compare November 19, 2024 14:09
@VenelinMartinov VenelinMartinov force-pushed the vvm/fix_provider_server_detailed_diff1 branch from 3d1d6b5 to e2a772c Compare November 19, 2024 18:11
@VenelinMartinov VenelinMartinov force-pushed the vvm/fix_provider_server_detailed_diff1 branch from e2a772c to cdb2b0f Compare November 19, 2024 18:41
@VenelinMartinov VenelinMartinov force-pushed the vvm/fix_provider_server_detailed_diff1 branch from cdb2b0f to b1a1cbf Compare November 19, 2024 18:53
@VenelinMartinov VenelinMartinov force-pushed the vvm/fix_provider_server_detailed_diff1 branch from b1a1cbf to 27b43ab Compare November 20, 2024 14:10
@VenelinMartinov VenelinMartinov force-pushed the vvm/fix_provider_server_detailed_diff1 branch from 27b43ab to 906cb5a Compare November 20, 2024 14:13
VenelinMartinov added a commit that referenced this pull request Nov 20, 2024
This change adds additional testing for Diff in PF for sets involving
Computed.

The following schemas are covered:
- Set block with a Computed attribute
- Set block with a Computed attribute and RequiresReplace on the
non-computed attribute
- Set block with a Computed attribute and RequiresReplace on the
computed attribute
- Set block with a Computed attribute and RequiresReplace on the block
- Set block with a Computed attribute and no UseStateForUnknown on the
Computed attribute

For each of these we test both when the Computed attribute is specified
in the program and when it is not.

For each of these schemas we test the full set of scenarios added in
#2592


This should give us some confidence that the changes we are making by
adding Detailed Diff for PF are good for Computed properties.

I will categorize all the issues here as a follow-up before merging
#2629
@VenelinMartinov VenelinMartinov force-pushed the vvm/fix_provider_server_detailed_diff1 branch from 906cb5a to f7fd6eb Compare November 20, 2024 17:42
@VenelinMartinov VenelinMartinov force-pushed the vvm/fix_provider_server_detailed_diff1 branch from f7fd6eb to 0dac56b Compare November 20, 2024 19:18
@VenelinMartinov VenelinMartinov force-pushed the vvm/fix_provider_server_detailed_diff1 branch from 0dac56b to 72c930a Compare November 21, 2024 12:42
@VenelinMartinov VenelinMartinov force-pushed the vvm/fix_provider_server_detailed_diff1 branch from f8aba52 to 12bb0f7 Compare November 25, 2024 14:19
VenelinMartinov added a commit that referenced this pull request Nov 25, 2024
This change fixes an issue with the `provider_server` implementation's
detailed diff handling. Previously passing a detailed diff to it would
result in the previews being deleted. This is tested as part of
#2629

The problem was that we were re-calculating the `diffs` and `replaces`
keys for the GRPC Diff protocol in the `provider_server` implementation
but also doing that incorrectly. Instead this change now makes
`provider_server`'s `marshalDiff` just pass through the `diffs` and
`replaces` which we have already calculated in
https://github.com/pulumi/pulumi-terraform-bridge/blob/1d6b032f3e376af4667c6c4d80a65eff072df807/pkg/pf/tfbridge/provider_diff.go#L108-L109

fixes #2620
Base automatically changed from vvm/fix_provider_server_detailed_diff1 to master November 25, 2024 15:23
@VenelinMartinov VenelinMartinov enabled auto-merge (squash) November 25, 2024 15:48
@VenelinMartinov VenelinMartinov merged commit 005a1f5 into master Nov 25, 2024
31 checks passed
@VenelinMartinov VenelinMartinov deleted the vvm/pf_detailed_diff1 branch November 25, 2024 16:15
VenelinMartinov added a commit that referenced this pull request Nov 26, 2024
This change adds recordings of the detailed diff sent to the engine to
all Diff cross-tests in PF. This helps with spot-checking the results
and troubleshooting issues.

This comes after
#2629 in order to
reduce the noise in the change there.
@pulumi-bot
Copy link
Contributor

This PR has been shipped in release v3.97.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants