-
Notifications
You must be signed in to change notification settings - Fork 44
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
Inserting an element in a list presents as multiple edits #2239
Comments
CC @VenelinMartinov another example of collection insertion diffs. To resolve we might need something like minimal edit distance detection https://github.com/t0yv0/godifft |
This adds tests for the SDKv2 bridge detailed diff for lists with many elements. Some previews are suboptimal because of #2239
This is not fixed because if I understand the fix correctly it is scoped down to lists of primitive types such as "string" on account of TF doing this and additional implementation difficulty presented by attributing "replace" to a particular sub-property causing replacements? Is this right? In fact the LaunchTemplate example wouldn't be fixed as yet? |
Yup, that's correct. |
This issue has been addressed in PR #2863 and shipped in release v3.103.0. |
What happened?
Consider this program that inserts a new element into a TypeList property. When planning the change from step=0 to step=1, the user would expect Pulumi to display the planned change as an insertion at index 1. However, Pulumi does not recognize the insertion and instead projects multiple edits.
repro:
The diff is displayed like this:
Disregarding the empty/missing diff entries that are confusing, the diff still thinks that elements at index 1,2 were edited, instead of thinking of this change as a plain insertion/addition at index 1. This can be confusing especially for large collections.
Example
See above.
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: