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 previews show unchanged elements in collections #2647

Closed
VenelinMartinov opened this issue Nov 21, 2024 · 1 comment · Fixed by #2629
Closed

PF previews show unchanged elements in collections #2647

VenelinMartinov opened this issue Nov 21, 2024 · 1 comment · Fixed by #2629
Assignees
Labels
area/plugin-framework Support for Plugin Framework based providers bug/diff Bugs in computing Diffs and planning resource changes kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@VenelinMartinov
Copy link
Contributor

VenelinMartinov commented Nov 21, 2024

When previewing a change in a resource using the Plugin Framework we incorrectly show all the unchanged elements in the collection. This offers a significantly worse experience than users get in TF with long collections:

Previewing update (test):
  pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test]
    +-testprovider:index/test:Test: (replace)
        [id=test-id]
        [urn=urn:pulumi:test::project::testprovider:index/test:Test::p]
      ~ id  : "test-id" => output<string>
      ~ keys: [
            [0]: {
                    nested: "value0"
                }
            [1]: {
                    nested: "value1"
                }
            [2]: {
                    nested: "value2"
                }
            [3]: {
                    nested: "value3"
                }
            [4]: {
                    nested: "value4"
                }
            [5]: {
                    nested: "value5"
                }
            [6]: {
                    nested: "value6"
                }
            [7]: {
                    nested: "value7"
                }
            [8]: {
                    nested: "value8"
                }
            [9]: {
                    nested: "value9"
                }
            [10]: {
                    nested: "value10"
                }
            [11]: {
                    nested: "value11"
                }
            [12]: {
                    nested: "value12"
                }
            [13]: {
                    nested: "value13"
                }
            [14]: {
                    nested: "value14"
                }
            [15]: {
                    nested: "value15"
                }
            [16]: {
                    nested: "value16"
                }
            [17]: {
                    nested: "value17"
                }
            [18]: {
                    nested: "value18"
                }
            [19]: {
                    nested: "value19"
                }
          + [20]: {
                  + nested: "value20"
                }
        ]
Resources:
    +-1 to replace
    1 unchanged

versus

  # testprovider_test.res must be replaced
+/- resource "testprovider_test" "res" {
      ~ id = "test-id" -> (known after apply)

      + key { # forces replacement
          + nested = "value20"
        }

        # (20 unchanged blocks hidden)
    }

See TestDetailedDiffList/attribute_no_replace/long_list_added

@VenelinMartinov VenelinMartinov added area/plugin-framework Support for Plugin Framework based providers bug/diff Bugs in computing Diffs and planning resource changes kind/bug Some behavior is incorrect or out of spec labels Nov 21, 2024
This was referenced Nov 21, 2024
VenelinMartinov added a commit that referenced this issue Nov 21, 2024
This adds a cross-tests for handling long lists in PF Diff. Our handling
is suboptimal but note that TF also struggles with this when there is a
replacement.

Related to #2647
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Nov 25, 2024
@pulumi-bot
Copy link
Contributor

This issue has been addressed in PR #2629 and 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
area/plugin-framework Support for Plugin Framework based providers bug/diff Bugs in computing Diffs and planning resource changes kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants