Skip to content

Conversation

@VenelinMartinov
Copy link
Contributor

@VenelinMartinov VenelinMartinov commented May 29, 2025

In #2945 we accidentally changed the behaviour for providers where RawStateDeltas were not enabled. After 2945 we would unconditionally produce the JSON serialization of the state even if it isn't used.

It is only used for upgrading state and for RawStateDeltas. The unintended effect here is that we exposed #3078 to all users of attributes of DynamicType even if no upgrades or RawStateDeltas are used.

This PR changes that to not produce the JSON serialization if not necessary. I've also added some tests for both the behaviour fixed here and the behaviour which needs #3078

fixes #3095

@VenelinMartinov
Copy link
Contributor Author

VenelinMartinov commented May 29, 2025

@codecov
Copy link

codecov bot commented May 29, 2025

Codecov Report

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

Project coverage is 68.78%. Comparing base (d1e4da9) to head (0939cb1).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/pf/tfbridge/resource_state.go 40.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3098      +/-   ##
==========================================
- Coverage   68.80%   68.78%   -0.03%     
==========================================
  Files         335      335              
  Lines       43560    43560              
==========================================
- Hits        29971    29962       -9     
- Misses      11877    11887      +10     
+ Partials     1712     1711       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@VenelinMartinov VenelinMartinov requested review from a team and t0yv0 May 29, 2025 09:28
@VenelinMartinov VenelinMartinov force-pushed the vvm/pf_dynamic_diff_err branch from ed7bd76 to 23a824c Compare May 29, 2025 09:29
if err != nil {
return nil, fmt.Errorf("[pf/tfbridge] Error calling EncodePropertyMap: %w", err)
}
rawState, err := pfutils.NewRawState(tfType, value)
Copy link
Member

Choose a reason for hiding this comment

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

Subtle! Thank you!

@VenelinMartinov VenelinMartinov merged commit 2093fe3 into main May 29, 2025
136 checks passed
@VenelinMartinov VenelinMartinov deleted the vvm/pf_dynamic_diff_err branch May 29, 2025 13:13
@pulumi-bot
Copy link
Contributor

This PR has been shipped in release v3.109.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

Development

Successfully merging this pull request may close these issues.

PF resources with DynamicType attribute error with "DynamicPseudoType is not supported"

3 participants