Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.

11893: update package details anchors r=sean1588 a=sean1588

fixes: pulumi/registry#1819

OK taking this for round 2. The first [PR](#11861) to make this change I ended up reverting because there were some pages (the function pages and module pages) still being generated with empty href tags. 

I have addressed this and updated the change to define the DisplayName and RepositoryName props on the `packageDetails` struct for the individual module pages and function pages. This updates the repository anchor in the Package Details section of the api docs pages. I updated it to display `<package name> repository` for the anchor text in place of the url that was previously shown there. 

![image](https://user-images.githubusercontent.com/16751381/213036900-2938a9ad-1992-4170-9b83-0fbbcef409a0.png)

So now this will show the following on the following pages:
1. the root index package pages
2. the module pages
3. the resource pages
4. the function pages

11903: ApplyT: Coerce new type wrappers r=abhinav a=abhinav

Adds support to ApplyT to automatically coerce new type wrappers
when calling the provided functions.

With this change, the following is valid:

    var idout pu.IDOutput = ...
    idout.ApplyT(func(id string) string {
        // ...
    })

Note that this does not use `To{Type}Output` methods at this time.
We will likely want to add that in the future given #11750.
We can do that in a backwards compatible way.

This coerces only those values that are defined
with language-level type wrappers in the following form:

    type ID string

This *does not* coerce types with different undedrlying representations.
Specifically, the following conversons are not supported
even though they're supported by Go using the `T(v)` syntax.

    string => int
    string => []byte
    []byte => string

The choice to convert between these types
should be made explicitly by the user
so that they get the semantics they want.

Resolves #11784


11922: ci: freeze 3.52.1 for release r=dixler a=dixler

Patch release to provide better stack traces for python #11887

Co-authored-by: aq17 <aqiu@pulumi.com>
Co-authored-by: Sean Holung <sean.holung@gmail.com>
Co-authored-by: Robbie McKinstry <robbie@pulumi.com>
Co-authored-by: Abhinav Gupta <abhinav@pulumi.com>
Co-authored-by: Kyle Dixler <kyle@pulumi.com>
  • Loading branch information
6 people committed Jan 19, 2023
5 parents dd1c715 + cdd95f8 + a81a516 + 772a5fd + 6e5c8ac commit 2ef87d8
Show file tree
Hide file tree
Showing 218 changed files with 963 additions and 284 deletions.
2 changes: 1 addition & 1 deletion .version
@@ -1 +1 @@
3.52.1
3.52.2
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: cli/display
description: Display text-based diff if yaml/json diff is semantically equal
@@ -0,0 +1,4 @@
changes:
- type: feat
scope: sdk/go
description: Coerces output values in ApplyT calls if the types are equivalent.
14 changes: 7 additions & 7 deletions pkg/backend/display/object_diff.go
Expand Up @@ -233,7 +233,7 @@ func (p *propertyPrinter) printObject(props resource.PropertyMap) {

// Now print out the values intelligently based on the type.
for _, k := range keys {
if v := props[k]; !resource.IsInternalPropertyKey(k) && shouldPrintPropertyValue(v, p.planning) {
if v := props[k]; !resource.IsInternalPropertyKey(k) {
p.printObjectProperty(k, v, maxkey)
}
}
Expand Down Expand Up @@ -477,9 +477,6 @@ func shouldPrintPropertyValue(v resource.PropertyValue, outs bool) bool {
if v.IsObject() && len(v.ObjectValue()) == 0 {
return false // skip objects with no properties, since they are also uninteresting.
}
if v.IsObject() && len(v.ObjectValue()) == 0 {
return false // skip objects with no properties, since they are also uninteresting.
}
if v.IsOutput() && !outs {
// also don't show output properties until the outs parameter tells us to.
return false
Expand Down Expand Up @@ -1180,10 +1177,13 @@ func (p *propertyPrinter) printEncodedValueDiff(old, new string) bool {
return false
}

if oldKind == newKind {
p.write("(%s) ", oldKind)
} else {
if oldKind != newKind {
p.write("(%s => %s) ", oldKind, newKind)
} else if old != new {
p.printTextDiff(strconv.Quote(old), strconv.Quote(new))
return true
} else {
p.write("(%s) ", oldKind)
}

diff := oldValue.Diff(newValue, resource.IsInternalPropertyKey)
Expand Down
2 changes: 2 additions & 0 deletions pkg/backend/display/testdata/not-truncated/template-body.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Expand Up @@ -2435,6 +2435,52 @@
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTableAssociation vpc-private-1 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:Route vpc-private-1-nat-1 
more⬇  <{%underline%}><{%fg 12%}>Type<{%reset%}> <{%underline%}><{%fg 12%}>Name<{%reset%}> 
<{%bold%}><{%reset%}> <{%reset%}> pulumi:pulumi:Stack aws-ts-eks-dev 
<{%reset%}> <{%reset%}> ├─ awsx:x:ec2:Vpc vpc 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:NatGateway vpc-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Eip vpc-0 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:NatGateway vpc-0 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:Subnet vpc-public-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-public-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-public-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Route vpc-public-0-ig 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:RouteTableAssociation vpc-public-0 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:Subnet vpc-private-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-private-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-private-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTableAssociation vpc-private-0 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:Route vpc-private-0-nat-0 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:InternetGateway vpc 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:InternetGateway vpc 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:Subnet vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTableAssociation vpc-private-1 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:Route vpc-private-1-nat-1 
more⬇  <{%underline%}><{%fg 12%}>Type<{%reset%}> <{%underline%}><{%fg 12%}>Name<{%reset%}> 
<{%bold%}><{%reset%}> <{%reset%}> pulumi:pulumi:Stack aws-ts-eks-dev 
<{%reset%}> <{%reset%}> ├─ awsx:x:ec2:Vpc vpc 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:NatGateway vpc-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Eip vpc-0 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:NatGateway vpc-0 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:Subnet vpc-public-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-public-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-public-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Route vpc-public-0-ig 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:RouteTableAssociation vpc-public-0 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:Subnet vpc-private-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-private-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-private-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTableAssociation vpc-private-0 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:Route vpc-private-0-nat-0 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:InternetGateway vpc 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:InternetGateway vpc 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:Subnet vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTableAssociation vpc-private-1 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:Route vpc-private-1-nat-1 
more⬇  <{%underline%}><{%fg 12%}>Type<{%reset%}> <{%underline%}><{%fg 12%}>Name<{%reset%}> 
<{%reset%}> <{%reset%}> pulumi:pulumi:Stack aws-ts-eks-dev 
Expand Down
Expand Up @@ -2435,6 +2435,52 @@
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTableAssociation vpc-private-1 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:Route vpc-private-1-nat-1 
more⬇  <{%underline%}><{%fg 12%}>Type<{%reset%}> <{%underline%}><{%fg 12%}>Name<{%reset%}> 
<{%bold%}><{%reset%}> <{%reset%}> pulumi:pulumi:Stack aws-ts-eks-dev 
<{%reset%}> <{%reset%}> ├─ awsx:x:ec2:Vpc vpc 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:NatGateway vpc-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Eip vpc-0 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:NatGateway vpc-0 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:Subnet vpc-public-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-public-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-public-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Route vpc-public-0-ig 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:RouteTableAssociation vpc-public-0 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:Subnet vpc-private-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-private-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-private-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTableAssociation vpc-private-0 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:Route vpc-private-0-nat-0 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:InternetGateway vpc 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:InternetGateway vpc 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:Subnet vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTableAssociation vpc-private-1 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:Route vpc-private-1-nat-1 
more⬇  <{%underline%}><{%fg 12%}>Type<{%reset%}> <{%underline%}><{%fg 12%}>Name<{%reset%}> 
<{%bold%}><{%reset%}> <{%reset%}> pulumi:pulumi:Stack aws-ts-eks-dev 
<{%reset%}> <{%reset%}> ├─ awsx:x:ec2:Vpc vpc 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:NatGateway vpc-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Eip vpc-0 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:NatGateway vpc-0 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:Subnet vpc-public-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-public-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-public-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Route vpc-public-0-ig 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:RouteTableAssociation vpc-public-0 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:Subnet vpc-private-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-private-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-private-0 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTableAssociation vpc-private-0 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:Route vpc-private-0-nat-0 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:InternetGateway vpc 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:InternetGateway vpc 
<{%reset%}> <{%reset%}> │ ├─ awsx:x:ec2:Subnet vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTable vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:Subnet vpc-private-1 
<{%reset%}> <{%reset%}> │ │ ├─ aws:ec2:RouteTableAssociation vpc-private-1 
<{%reset%}> <{%reset%}> │ │ └─ aws:ec2:Route vpc-private-1-nat-1 
more⬇  <{%underline%}><{%fg 12%}>Type<{%reset%}> <{%underline%}><{%fg 12%}>Name<{%reset%}> 
<{%reset%}> <{%reset%}> pulumi:pulumi:Stack aws-ts-eks-dev 
Expand Down
Expand Up @@ -59,6 +59,8 @@
<{%bold%}><{%reset%}> <{%reset%}> aws:ec2:LaunchConfiguration cluster-nodeLaunchConfiguration <{%bold%}><{%reset%}><{%reset%}>
<{%bold%}><{%fg 3%}>~ <{%reset%}> aws:cloudformation:Stack cluster-nodes <{%bold%}><{%fg 3%}>updating<{%reset%}> [diff: <{%fg 3%}>~templateBody<{%reset%}><{%reset%}>]
<{%fg 3%}>~ <{%reset%}> aws:cloudformation:Stack cluster-nodes <{%fg 3%}>updated<{%reset%}> [diff: <{%fg 3%}>~templateBody<{%reset%}><{%reset%}>]
<{%fg 3%}>~ <{%reset%}> aws:cloudformation:Stack cluster-nodes <{%fg 3%}>updated<{%reset%}> [diff: <{%fg 3%}>~templateBody<{%reset%}><{%reset%}>]
<{%fg 3%}>~ <{%reset%}> aws:cloudformation:Stack cluster-nodes <{%fg 3%}>updated<{%reset%}> [diff: <{%fg 3%}>~templateBody<{%reset%}><{%reset%}>]
<{%bold%}><{%reset%}> <{%reset%}> pulumi:providers:kubernetes cluster-provider <{%bold%}><{%reset%}><{%reset%}>
<{%reset%}> <{%reset%}> pulumi:pulumi:Stack aws-ts-eks-dev <{%reset%}><{%reset%}>

Expand Down

0 comments on commit 2ef87d8

Please sign in to comment.