Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hashicorp/terraform
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.4
Choose a base ref
...
head repository: hashicorp/terraform
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.5
Choose a head ref
  • 20 commits
  • 15 files changed
  • 3 contributors

Commits on Aug 4, 2021

  1. Verified

    This commit was signed with the committer’s verified signature.
    AVVS Vitaly Aminev
    Copy the full SHA
    d909f88 View commit details

Commits on Aug 6, 2021

  1. json-output: Add output changes to plan logs

    Extend the outputs JSON log message to support an `action` field (and
    make the `type` and `value` fields optional). This allows us to emit a
    useful output change summary as part of the plan, bringing the JSON log
    output into parity with the text output.
    
    While we do have access to the before/after values in the output
    changes, attempting to wedge those into a structured log message is not
    appropriate. That level of detail can be extracted from the JSON plan
    output from `terraform show -json`.
    alisdair committed Aug 6, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    AVVS Vitaly Aminev
    Copy the full SHA
    cf4c6de View commit details
  2. Merge pull request #29317 from hashicorp/backport/alisdair/json-outpu…

    …t-planned-output-change/usefully-tidy-whippet
    
    Backport of json-output: Add output changes to plan logs into v1.0
    alisdair authored Aug 6, 2021
    Copy the full SHA
    24c10ec View commit details
  3. Update CHANGELOG.md

    alisdair authored Aug 6, 2021
    Copy the full SHA
    a38f384 View commit details

Commits on Aug 16, 2021

  1. backport of commit fbfb141

    jbardin committed Aug 16, 2021
    Copy the full SHA
    fe8ce7c View commit details
  2. backport of commit 296a757

    jbardin committed Aug 16, 2021
    Copy the full SHA
    0b07048 View commit details

Commits on Aug 17, 2021

  1. Merge pull request #29400 from hashicorp/backport/jbardin/diff-nested…

    …-attrs/incredibly-trusted-goldfish
    
    Backport of Empty nested attribute handling in diffs into v1.0
    jbardin authored Aug 17, 2021
    Copy the full SHA
    486d39e View commit details
  2. update CHANGELOG.md

    jbardin committed Aug 17, 2021
    Copy the full SHA
    fd25b77 View commit details
  3. Copy the full SHA
    a3686d6 View commit details
  4. Merge pull request #29405 from hashicorp/jbardin/backport-29397

    unmark object ID or Name for formatting
    jbardin authored Aug 17, 2021
    Copy the full SHA
    adf71ef View commit details
  5. update CHANGELOG.md

    jbardin committed Aug 17, 2021
    Copy the full SHA
    282b2bd View commit details

Commits on Aug 18, 2021

  1. backport of commit d3ea864

    jbardin committed Aug 18, 2021
    Copy the full SHA
    1069348 View commit details
  2. Merge pull request #29408 from hashicorp/backport/jbardin/update-cty/…

    …kindly-unbiased-yak
    
    Backport of update github.com/zclconf/go-cty@v1.9.1 into v1.0
    jbardin authored Aug 18, 2021
    Copy the full SHA
    a931900 View commit details
  3. update CHANGELOG.md

    jbardin committed Aug 18, 2021
    Copy the full SHA
    5f3e20e View commit details
  4. backport of commit da00751

    jbardin committed Aug 18, 2021
    Copy the full SHA
    1bde8e1 View commit details
  5. Merge pull request #29412 from hashicorp/backport/jbardin/plan-nestin…

    …g-single/neatly-coherent-cod
    
    Backport of handle null NestingSingle values into v1.0
    jbardin authored Aug 18, 2021
    Copy the full SHA
    04c2c8d View commit details
  6. handle null and unknown values in attr diffs

    The code adopted from block diffs was not set to handle null and unknown
    values, as those are not allowed for blocks.
    
    We also revert the change to formatting nested object types as single
    attributes, because the attribute formatter cannot handle sensitive
    values from the schema. This presents some awkward syntax for diffs for
    now, but should suffice until the entire formatter can be refactored to
    better handle these new nested types.
    jbardin committed Aug 18, 2021
    Copy the full SHA
    81fca75 View commit details
  7. Merge pull request #29414 from hashicorp/jbardin/backport-29410

    handle null and unknown values in attr diffs
    jbardin authored Aug 18, 2021
    Copy the full SHA
    3d8aafd View commit details
  8. update CHANGELOG.md

    jbardin committed Aug 18, 2021
    Copy the full SHA
    ff686c5 View commit details
  9. Release v1.0.5

    hc-github-team-tf-core committed Aug 18, 2021
    Copy the full SHA
    1fc7ee1 View commit details
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 1.0.5 (August 18, 2021)

BUG FIXES:

* json-output: Add an output change summary message as part of the `terraform plan -json` structured logs, bringing this format into parity with the human-readable UI. ([#29312](https://github.com/hashicorp/terraform/issues/29312))
* core: Handle null nested single attribute values ([#29411](https://github.com/hashicorp/terraform/issues/29411))
* cli: Fix crash when planning a diff between null and empty sets in nested attributes ([#29398](https://github.com/hashicorp/terraform/issues/29398))
* cli: Fix crash when planning a new resource containing a set of nested object attributes ([#29398](https://github.com/hashicorp/terraform/issues/29398))
* cli: Fix crash when displaying a resource diff where a possibly identifying attribute is sensitive ([#29397](https://github.com/hashicorp/terraform/issues/29397))
* cli: Fix crash when a diff with unknown nested map attributes ([#29410](https://github.com/hashicorp/terraform/issues/29410))
* config: Fix handling of dynamically types arguments in `formatlist`, ensuring the correct resulting type. ([#29408](https://github.com/hashicorp/terraform/issues/29408))
* config: Floating point operations like `floor` and `ceil` can no longer mutate their arguments. ([#29408](https://github.com/hashicorp/terraform/issues/29408))

## 1.0.4 (August 04, 2021)


2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ require (
github.com/tombuildsstuff/giovanni v0.15.1
github.com/xanzy/ssh-agent v0.2.1
github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557
github.com/zclconf/go-cty v1.9.0
github.com/zclconf/go-cty v1.9.1
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b
github.com/zclconf/go-cty-yaml v1.0.2
go.etcd.io/etcd v0.5.0-alpha.5.0.20210428180535-15715dcf1ace
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -620,8 +620,8 @@ github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLE
github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty v1.9.0 h1:IgJxw5b4LPXCPeqFjjhLaNEA8NKXMyaEUdAd399acts=
github.com/zclconf/go-cty v1.9.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty v1.9.1 h1:viqrgQwFl5UpSxc046qblj78wZXVDFnSOufaOTER+cc=
github.com/zclconf/go-cty v1.9.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI=
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8=
github.com/zclconf/go-cty-yaml v1.0.2 h1:dNyg4QLTrv2IfJpm7Wtxi55ed5gLGOlPrZ6kMd51hY0=
44 changes: 37 additions & 7 deletions internal/command/format/diff.go
Original file line number Diff line number Diff line change
@@ -605,14 +605,24 @@ func (p *blockBodyDiffPrinter) writeNestedAttrDiff(
p.buf.WriteString(strings.Repeat(" ", indent+2))
p.buf.WriteString("]")

if !new.IsKnown() {
p.buf.WriteString(" -> (known after apply)")
}

case configschema.NestingSet:
oldItems := ctyCollectionValues(old)
newItems := ctyCollectionValues(new)

allItems := make([]cty.Value, 0, len(oldItems)+len(newItems))
allItems = append(allItems, oldItems...)
allItems = append(allItems, newItems...)
all := cty.SetVal(allItems)
var all cty.Value
if len(oldItems)+len(newItems) > 0 {
allItems := make([]cty.Value, 0, len(oldItems)+len(newItems))
allItems = append(allItems, oldItems...)
allItems = append(allItems, newItems...)

all = cty.SetVal(allItems)
} else {
all = cty.SetValEmpty(old.Type().ElementType())
}

p.buf.WriteString(" = [")

@@ -624,11 +634,18 @@ func (p *blockBodyDiffPrinter) writeNestedAttrDiff(
case !val.IsKnown():
action = plans.Update
newValue = val
case !old.HasElement(val).True():
case !new.IsKnown():
action = plans.Delete
// the value must have come from the old set
oldValue = val
// Mark the new val as null, but the entire set will be
// displayed as "(unknown after apply)"
newValue = cty.NullVal(val.Type())
case old.IsNull() || !old.HasElement(val).True():
action = plans.Create
oldValue = cty.NullVal(val.Type())
newValue = val
case !new.HasElement(val).True():
case new.IsNull() || !new.HasElement(val).True():
action = plans.Delete
oldValue = val
newValue = cty.NullVal(val.Type())
@@ -658,6 +675,10 @@ func (p *blockBodyDiffPrinter) writeNestedAttrDiff(
p.buf.WriteString(strings.Repeat(" ", indent+2))
p.buf.WriteString("]")

if !new.IsKnown() {
p.buf.WriteString(" -> (known after apply)")
}

case configschema.NestingMap:
// For the sake of handling nested blocks, we'll treat a null map
// the same as an empty map since the config language doesn't
@@ -666,7 +687,12 @@ func (p *blockBodyDiffPrinter) writeNestedAttrDiff(
new = ctyNullBlockMapAsEmpty(new)

oldItems := old.AsValueMap()
newItems := new.AsValueMap()

newItems := map[string]cty.Value{}

if new.IsKnown() {
newItems = new.AsValueMap()
}

allKeys := make(map[string]bool)
for k := range oldItems {
@@ -688,6 +714,7 @@ func (p *blockBodyDiffPrinter) writeNestedAttrDiff(
for _, k := range allKeysOrder {
var action plans.Action
oldValue := oldItems[k]

newValue := newItems[k]
switch {
case oldValue == cty.NilVal:
@@ -723,6 +750,9 @@ func (p *blockBodyDiffPrinter) writeNestedAttrDiff(
p.writeSkippedElems(unchanged, indent+4)
p.buf.WriteString(strings.Repeat(" ", indent+2))
p.buf.WriteString("}")
if !new.IsKnown() {
p.buf.WriteString(" -> (known after apply)")
}
}

return
Loading