-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Diff display for string values with YAML contents displays empty objects incorrectly #11799
Comments
Not rendering |
I think the deeper issue might be point (2). Fundamentally, it feels like we should never show an empty diff if there is a diff. So my assumption is that the behaviour should be that if there is a diff being reported: |
reply race condition. commenting this for future context to link the PRs to this issue. I've done more digging to address 2 and 3
#9380 and #9484 introduced changes that render JSON/YAML parsable strings as objects in diffs. as such, |
11803: Display text-based diff if yaml/json diff is semantically equal r=aq17 a=aq17 Fixes #11799 #9380 and #9484 introduced changes that render JSON/YAML parsable strings as objects in diffs – therefore, examples such as`"foo:\n bar: {}\n baz: {}\n"` and `"#foo\nfoo:\n bar: {}\n baz: {}\n"` are recognized as equal. This change causes the display to fall back to showing the text-based diff if the JSON/YAML rendering does not indicate any diff. It also prints all object keys even if the value is empty, i.e. `bar: {}` or `bar: ""` will be printed instead of `bar` being omitted. Co-authored-by: aq17 <aqiu@pulumi.com>
11803: Display text-based diff if yaml/json diff is semantically equal r=aq17 a=aq17 Fixes #11799 #9380 and #9484 introduced changes that render JSON/YAML parsable strings as objects in diffs – therefore, examples such as`"foo:\n bar: {}\n baz: {}\n"` and `"#foo\nfoo:\n bar: {}\n baz: {}\n"` are recognized as equal. This change causes the display to fall back to showing the text-based diff if the JSON/YAML rendering does not indicate any diff. It also prints all object keys even if the value is empty, i.e. `bar: {}` or `bar: ""` will be printed instead of `bar` being omitted. Co-authored-by: aq17 <aqiu@pulumi.com>
11803: Display text-based diff if yaml/json diff is semantically equal r=aq17 a=aq17 Fixes #11799 #9380 and #9484 introduced changes that render JSON/YAML parsable strings as objects in diffs – therefore, examples such as`"foo:\n bar: {}\n baz: {}\n"` and `"#foo\nfoo:\n bar: {}\n baz: {}\n"` are recognized as equal. This change causes the display to fall back to showing the text-based diff if the JSON/YAML rendering does not indicate any diff. It also prints all object keys even if the value is empty, i.e. `bar: {}` or `bar: ""` will be printed instead of `bar` being omitted. Co-authored-by: aq17 <aqiu@pulumi.com>
This program:
Renders this on
pulumi up
:Note that it fails to render
bar
andbaz
.If a diff is introduced - like adding a comment to the YAML string - the update diff is also wrong:
Note that:
bar
andbaz
are still missing~
indicating a diff, but not diff in the objectThe text was updated successfully, but these errors were encountered: