You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Prepare for a potential future 1.6.1 release
* build: remove go 1.11 and 1.12 from travis config
* cty: RawEquals correct behavior for sets with partially-unknown values
Sets with the same type and same unknown values are equal enough for
RawEqual's purposes. This commit takes advantage of the setRules's
defined ordering to compare each element of the sets as lists.
* v1.6.1
* Prepare for an assumed future v1.6.2 release
* cty: Utilities to unmark with marks at specific paths
This allows a caller to call a method like Unmark, but instead of getting a superset of marks, get an array of marks and their associated paths. This allows for a Value to be unmarked and then remarked later without losing so much detail about the marks.
* Update CHANGELOG.md
* cty: Fix deep marks functions with new transformer
The UnmarkDeep, UnmarkDeepWithPaths, and MarkWithPaths functions could
previously panic with nested complex values. This was due to the
Transform callback function only being called as part of a postorder
traversal, when it is not permitted to traverse a marked value.
This commit introduces a new TransformWithTransformer function,
requiring an implementation of a new Transformer interface. Using this
interface, callers can implement either preorder or postorder
traversals.
In turn, this allows us to write deep transformation for marks which
successfully cope with all nested structures.
The commit includes significantly more tests for these functions, which
should now cover all complex value types.
* cty: Remove already-fixed FIXME for SetVal
The immediately preceding code already unmarks the values and applies
the marking to the set, so this comment and panic are out of date.
* functions/stdlib: formatdate to correctly handle literals at the end of the format string
* Update CHANGELOG.md
* cty: Fix path array reuse with UnmarkDeepWithPaths
When unmarking a complex value and retaining the marked paths, a
sufficiently deep structure would result in incorrect duplicate path
output. For example, this structure (in HCL syntax):
{
environment = [
{
variables = {
"x" = 1
"y" = 2
}
}
]
}
If the 1 and 2 values are marked, the resulting path value marks from
UnmarkDeepWithPaths would have two entries, as expected. However, both
would have the same Path attribute, like so:
[
{ environment[0].variables["x"], "mark" },
{ environment[0].variables["x"], "mark" },
]
This is caused by calling `append` in the walk transform function with
the same path object repeatedly, which eventually does not result in
array reallocation, and therefore the path object is modified in-place.
* stdlib: Add tests for join function
* function: Deeply unmark function arguments
For functions which do not explicitly support marks, we now deeply
unmark arguments before calling, and reapply those marks to the return
value. This ensures that these functions do not panic with arguments
which are collection values with marked descendants.
This does result in overly conservatively applying marks in some cases,
but that can be fixed with later work to add explicit support for marks
to those functions.
* Update CHANGELOG.md
* v1.7.0
* Update CHANGELOG.md
---------
Co-authored-by: Martin Atkins <[email protected]>
Co-authored-by: Kristin Laemmert <[email protected]>
Co-authored-by: Pam Selle <[email protected]>
Co-authored-by: Alisdair McDiarmid <[email protected]>
Co-authored-by: OwenTuz <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,12 @@
1
+
# 1.7.0 (Unreleased)
2
+
3
+
*`cty`: `Value.UnmarkDeepWithPaths` and `Value.MarkWithPaths` are like `Value.UnmarkDeep` and `Value.Mark` but they retain path information for each marked value, so that marks can be re-applied later without all the loss of detail that results from `Value.UnmarkDeep` aggregating together all of the nested marks.
4
+
*`function`: Unless a parameter has `AllowMarks: true` explicitly set, the functions infrastructure will now guarantee that it never sees a marked value even if the mark is deep inside a data structure. Previously that guarantee was only shallow for the top-level value, similar to `AllowUnknown`, but because marks are a relatively new addition to `cty` and numerous existing functions are not written to deal with them this is the more conservative and robust default. ([#72](https://github.com/zclconf/go-cty/pull/72))
5
+
*`function/stdlib`: The `formatdate` function was not correctly handling literal sequences at the end of the format string. It will now handle those as intended. ([#69](https://github.com/zclconf/go-cty/pull/69))
6
+
1
7
# 1.6.1 (Unreleased)
2
8
3
-
* Fix a regression from 1.6.0 where `Value.RawEqual` no longer returned the correct result given a pair of sets containing partially-unknown values. ([#64](https://github.com/zclconf/go-cty/pull/64))
9
+
*`cty`:: Fix a regression from 1.6.0 where `Value.RawEqual` no longer returned the correct result given a pair of sets containing partially-unknown values. ([#64](https://github.com/zclconf/go-cty/pull/64))
0 commit comments