-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #13981.
- Loading branch information
Showing
15 changed files
with
336 additions
and
4 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
changelog/pending/20240118--cli-display--fix-json-yaml-value-diff-displays.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
changes: | ||
- type: fix | ||
scope: cli/display | ||
description: Fix JSON/YAML value diff displays. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
pkg/backend/display/testdata/json-yaml/json-text-change.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"sequence": 0, | ||
"timestamp": 1677074634, | ||
"preludeEvent": { | ||
"config": {} | ||
} | ||
} | ||
{ | ||
"sequence": 3, | ||
"timestamp": 1677074634, | ||
"resourcePreEvent": { | ||
"metadata": { | ||
"op": "update", | ||
"urn": "urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev", | ||
"type": "pulumi:pulumi:Stack", | ||
"old": { | ||
"type": "pulumi:pulumi:Stack", | ||
"urn": "urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev", | ||
"id": "", | ||
"parent": "", | ||
"inputs": {}, | ||
"outputs": { | ||
"vehicles": { | ||
"taxi": "{\"color\":\"yellow\"}" | ||
} | ||
}, | ||
"provider": "" | ||
}, | ||
"new": { | ||
"type": "pulumi:pulumi:Stack", | ||
"urn": "urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev", | ||
"id": "", | ||
"parent": "", | ||
"inputs": {}, | ||
"outputs": { | ||
"vehicles": { | ||
"taxi": "{\"color\": \"yellow\" }" | ||
} | ||
}, | ||
"provider": "" | ||
}, | ||
"logical": true, | ||
"provider": "" | ||
}, | ||
"planning": true | ||
} | ||
} | ||
{ | ||
"sequence": 21, | ||
"timestamp": 1677074635, | ||
"summaryEvent": { | ||
"maybeCorrupt": false, | ||
"durationSeconds": 0, | ||
"resourceChanges": { | ||
"update": 1 | ||
}, | ||
"PolicyPacks": {} | ||
} | ||
} | ||
{ | ||
"sequence": 22, | ||
"timestamp": 1677074635, | ||
"cancelEvent": {} | ||
} |
Empty file.
10 changes: 10 additions & 0 deletions
10
pkg/backend/display/testdata/json-yaml/json-text-change.json.stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<{%reset%}>Configuration:<{%reset%}> | ||
<{%fg 3%}>~ pulumi:pulumi:Stack: (update) | ||
<{%reset%}> [urn=urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev] | ||
<{%reset%}><{%fg 3%}> ~ vehicles: <{%reset%}><{%fg 3%}>{ | ||
<{%reset%}><{%fg 3%}> ~ taxi: <{%reset%}><{%fg 3%}>"<{%reset%}><{%reset%}>\"{\\\"color\\\":<{%reset%}><{%reset%}>\\\"yellow\\\"<{%reset%}><{%reset%}>}\"<{%reset%}><{%fg 3%}>"<{%reset%}><{%fg 3%}> => <{%reset%}><{%fg 3%}>"<{%reset%}><{%reset%}>\"{\\\"color\\\":<{%reset%}><{%fg 2%}> <{%reset%}><{%reset%}>\\\"yellow\\\"<{%reset%}><{%fg 2%}> <{%reset%}><{%reset%}>}\"<{%reset%}><{%fg 3%}>" | ||
<{%reset%}><{%fg 3%}> } | ||
<{%reset%}><{%reset%}><{%fg 13%}><{%bold%}>Resources:<{%reset%}> | ||
<{%fg 3%}>~ 1 updated<{%reset%}> | ||
|
||
<{%fg 13%}><{%bold%}>Duration:<{%reset%}> 0s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"sequence": 0, | ||
"timestamp": 1677074634, | ||
"preludeEvent": { | ||
"config": {} | ||
} | ||
} | ||
{ | ||
"sequence": 3, | ||
"timestamp": 1677074634, | ||
"resourcePreEvent": { | ||
"metadata": { | ||
"op": "update", | ||
"urn": "urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev", | ||
"type": "pulumi:pulumi:Stack", | ||
"old": { | ||
"type": "pulumi:pulumi:Stack", | ||
"urn": "urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev", | ||
"id": "", | ||
"parent": "", | ||
"inputs": {}, | ||
"outputs": { | ||
"vehicles": { | ||
"taxi": "{\"color\":\"yellow\"}" | ||
} | ||
}, | ||
"provider": "" | ||
}, | ||
"new": { | ||
"type": "pulumi:pulumi:Stack", | ||
"urn": "urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev", | ||
"id": "", | ||
"parent": "", | ||
"inputs": {}, | ||
"outputs": { | ||
"vehicles": { | ||
"taxi": "{\"color\":\"red\"}" | ||
} | ||
}, | ||
"provider": "" | ||
}, | ||
"logical": true, | ||
"provider": "" | ||
}, | ||
"planning": true | ||
} | ||
} | ||
{ | ||
"sequence": 21, | ||
"timestamp": 1677074635, | ||
"summaryEvent": { | ||
"maybeCorrupt": false, | ||
"durationSeconds": 0, | ||
"resourceChanges": { | ||
"update": 1 | ||
}, | ||
"PolicyPacks": {} | ||
} | ||
} | ||
{ | ||
"sequence": 22, | ||
"timestamp": 1677074635, | ||
"cancelEvent": {} | ||
} |
Empty file.
12 changes: 12 additions & 0 deletions
12
pkg/backend/display/testdata/json-yaml/json.json.stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<{%reset%}>Configuration:<{%reset%}> | ||
<{%fg 3%}>~ pulumi:pulumi:Stack: (update) | ||
<{%reset%}> [urn=urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev] | ||
<{%reset%}><{%fg 3%}> ~ vehicles: <{%reset%}><{%fg 3%}>{ | ||
<{%reset%}><{%fg 3%}> ~ taxi: <{%reset%}><{%fg 3%}>(json) <{%reset%}><{%fg 3%}>{ | ||
<{%reset%}><{%fg 3%}> ~ color: <{%reset%}><{%fg 3%}>"<{%reset%}><{%fg 1%}>yellow<{%reset%}><{%fg 3%}>"<{%reset%}><{%fg 3%}> => <{%reset%}><{%fg 3%}>"<{%reset%}><{%fg 2%}>red<{%reset%}><{%fg 3%}>" | ||
<{%reset%}><{%fg 3%}> } | ||
<{%reset%}><{%fg 3%}> } | ||
<{%reset%}><{%reset%}><{%fg 13%}><{%bold%}>Resources:<{%reset%}> | ||
<{%fg 3%}>~ 1 updated<{%reset%}> | ||
|
||
<{%fg 13%}><{%bold%}>Duration:<{%reset%}> 0s |
64 changes: 64 additions & 0 deletions
64
pkg/backend/display/testdata/json-yaml/yaml-text-change.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"sequence": 0, | ||
"timestamp": 1677074634, | ||
"preludeEvent": { | ||
"config": {} | ||
} | ||
} | ||
{ | ||
"sequence": 3, | ||
"timestamp": 1677074634, | ||
"resourcePreEvent": { | ||
"metadata": { | ||
"op": "update", | ||
"urn": "urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev", | ||
"type": "pulumi:pulumi:Stack", | ||
"old": { | ||
"type": "pulumi:pulumi:Stack", | ||
"urn": "urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev", | ||
"id": "", | ||
"parent": "", | ||
"inputs": {}, | ||
"outputs": { | ||
"vehicles": { | ||
"taxi": "color: yellow\ntype: car" | ||
} | ||
}, | ||
"provider": "" | ||
}, | ||
"new": { | ||
"type": "pulumi:pulumi:Stack", | ||
"urn": "urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev", | ||
"id": "", | ||
"parent": "", | ||
"inputs": {}, | ||
"outputs": { | ||
"vehicles": { | ||
"taxi": "# a comment\ncolor: yellow \ntype: car" | ||
} | ||
}, | ||
"provider": "" | ||
}, | ||
"logical": true, | ||
"provider": "" | ||
}, | ||
"planning": true | ||
} | ||
} | ||
{ | ||
"sequence": 21, | ||
"timestamp": 1677074635, | ||
"summaryEvent": { | ||
"maybeCorrupt": false, | ||
"durationSeconds": 0, | ||
"resourceChanges": { | ||
"update": 1 | ||
}, | ||
"PolicyPacks": {} | ||
} | ||
} | ||
{ | ||
"sequence": 22, | ||
"timestamp": 1677074635, | ||
"cancelEvent": {} | ||
} |
Empty file.
10 changes: 10 additions & 0 deletions
10
pkg/backend/display/testdata/json-yaml/yaml-text-change.json.stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<{%reset%}>Configuration:<{%reset%}> | ||
<{%fg 3%}>~ pulumi:pulumi:Stack: (update) | ||
<{%reset%}> [urn=urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev] | ||
<{%reset%}><{%fg 3%}> ~ vehicles: <{%reset%}><{%fg 3%}>{ | ||
<{%reset%}><{%fg 3%}> ~ taxi: <{%reset%}><{%fg 3%}>"<{%reset%}><{%reset%}>\"<{%reset%}><{%reset%}>color: yellow<{%reset%}><{%reset%}>\\ntype: car\"<{%reset%}><{%fg 3%}>"<{%reset%}><{%fg 3%}> => <{%reset%}><{%fg 3%}>"<{%reset%}><{%reset%}>\"<{%reset%}><{%fg 2%}># a comment\\n<{%reset%}><{%reset%}>color: yellow<{%reset%}><{%fg 2%}> <{%reset%}><{%reset%}>\\ntype: car\"<{%reset%}><{%fg 3%}>" | ||
<{%reset%}><{%fg 3%}> } | ||
<{%reset%}><{%reset%}><{%fg 13%}><{%bold%}>Resources:<{%reset%}> | ||
<{%fg 3%}>~ 1 updated<{%reset%}> | ||
|
||
<{%fg 13%}><{%bold%}>Duration:<{%reset%}> 0s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"sequence": 0, | ||
"timestamp": 1677074634, | ||
"preludeEvent": { | ||
"config": {} | ||
} | ||
} | ||
{ | ||
"sequence": 3, | ||
"timestamp": 1677074634, | ||
"resourcePreEvent": { | ||
"metadata": { | ||
"op": "update", | ||
"urn": "urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev", | ||
"type": "pulumi:pulumi:Stack", | ||
"old": { | ||
"type": "pulumi:pulumi:Stack", | ||
"urn": "urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev", | ||
"id": "", | ||
"parent": "", | ||
"inputs": {}, | ||
"outputs": { | ||
"vehicles": { | ||
"taxi": "color: yellow\ntype: car" | ||
} | ||
}, | ||
"provider": "" | ||
}, | ||
"new": { | ||
"type": "pulumi:pulumi:Stack", | ||
"urn": "urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev", | ||
"id": "", | ||
"parent": "", | ||
"inputs": {}, | ||
"outputs": { | ||
"vehicles": { | ||
"taxi": "color: red\ntype: car" | ||
} | ||
}, | ||
"provider": "" | ||
}, | ||
"logical": true, | ||
"provider": "" | ||
}, | ||
"planning": true | ||
} | ||
} | ||
{ | ||
"sequence": 21, | ||
"timestamp": 1677074635, | ||
"summaryEvent": { | ||
"maybeCorrupt": false, | ||
"durationSeconds": 0, | ||
"resourceChanges": { | ||
"update": 1 | ||
}, | ||
"PolicyPacks": {} | ||
} | ||
} | ||
{ | ||
"sequence": 22, | ||
"timestamp": 1677074635, | ||
"cancelEvent": {} | ||
} |
Empty file.
13 changes: 13 additions & 0 deletions
13
pkg/backend/display/testdata/json-yaml/yaml.json.stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<{%reset%}>Configuration:<{%reset%}> | ||
<{%fg 3%}>~ pulumi:pulumi:Stack: (update) | ||
<{%reset%}> [urn=urn:pulumi:dev::pulumi-stack-output-diff::pulumi:pulumi:Stack::pulumi-stack-output-diff-dev] | ||
<{%reset%}><{%fg 3%}> ~ vehicles: <{%reset%}><{%fg 3%}>{ | ||
<{%reset%}><{%fg 3%}> ~ taxi: <{%reset%}><{%fg 3%}>(yaml) <{%reset%}><{%fg 3%}>{ | ||
<{%reset%}><{%fg 3%}> ~ color: <{%reset%}><{%fg 3%}>"<{%reset%}><{%fg 1%}>yellow<{%reset%}><{%fg 3%}>"<{%reset%}><{%fg 3%}> => <{%reset%}><{%fg 3%}>"<{%reset%}><{%fg 2%}>red<{%reset%}><{%fg 3%}>" | ||
<{%reset%}><{%reset%}> type : <{%reset%}><{%reset%}>"car"<{%reset%}><{%reset%}> | ||
<{%reset%}><{%fg 3%}> } | ||
<{%reset%}><{%fg 3%}> } | ||
<{%reset%}><{%reset%}><{%fg 13%}><{%bold%}>Resources:<{%reset%}> | ||
<{%fg 3%}>~ 1 updated<{%reset%}> | ||
|
||
<{%fg 13%}><{%bold%}>Duration:<{%reset%}> 0s |