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/hcl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.16.2
Choose a base ref
...
head repository: hashicorp/hcl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.17.0
Choose a head ref
  • 8 commits
  • 12 files changed
  • 1 contributor

Commits on May 31, 2023

  1. go.mod: Use cty v1.13.0, with support for refined unknown values

    This new concept allows constraining the range of an unknown value beyond
    what can be captured in a type constraint. We'll make more use of this
    in subsequent commits.
    apparentlymart committed May 31, 2023
    Configuration menu
    Copy the full SHA
    adb8823 View commit details
    Browse the repository at this point in the history
  2. hclsyntax: TemplateExpr can refine its unknown results

    If we encounter an interpolated unknown value during template rendering,
    we can report the partial buffer we've completed so far as the refined
    prefix of the resulting unknown value, which can then potentially allow
    downstream comparisons to produce a known false result instead of unknown
    if the prefix is sufficient to satisfy them.
    apparentlymart committed May 31, 2023
    Configuration menu
    Copy the full SHA
    e0058a2 View commit details
    Browse the repository at this point in the history
  3. hclsyntax: ConditionalExpr can refine its unknown results

    When ConditionalExpr has an unknown predicate it can still often infer
    some refinement to the range of its result by noticing characteristics
    that the two results have in common.
    
    In all cases we can test if either result could be null and return a
    definitely-not-null unknown value if not.
    
    For two known numbers we can constrain the range to be between those two
    numbers. This is primarily aimed at the common case where the two possible
    results are zero and one, which significantly constrains the range.
    
    For two known collections of the same kind we can constrain the length
    to be between the two collection lengths.
    
    In these last two cases we can also sometimes collapse the unknown into
    a known value if the range gets reduced enough. For example, if choosing
    between two collections of the same length we might return a known
    collection of that length containing unknown elements, rather than an
    unknown collection.
    apparentlymart committed May 31, 2023
    Configuration menu
    Copy the full SHA
    628da05 View commit details
    Browse the repository at this point in the history
  4. ext/typeexpr: Refinements when applying defaults with unknown values

    If either the given value is refined non-null or if the default value is
    refined non-null then the final attribute value after defaults processing
    is also guaranteed non-null even if we don't yet know exactly what the
    value will be.
    
    This rule is pretty marginal on its own, but refining some types of value
    as non-null creates opportunities to deduce further information when the
    value is used under other operations later, such as collapsing an unknown
    but definitely not null list of a known length into a known list of that
    length containing unknown values.
    apparentlymart committed May 31, 2023
    Configuration menu
    Copy the full SHA
    ea69807 View commit details
    Browse the repository at this point in the history
  5. hclsyntax: Refinements to unknown splat expression results

    We know that a splat expression can never produce a null result, and also
    in many cases we can use length refinements from the source collection to
    also refine the destination collection because we know that a splat
    expression produces exactly one result for each input element.
    
    This also allows us to be a little more precise in the case where the
    splat operator is projecting a non-list/set value into a zero or one
    element list and we know the source value isn't null. This refinement is
    a bit more marginal since it would be weird to apply the splat operator
    to a value already known to be non-null anyway, but the refinement might
    come from far away from the splat expression and so could still have
    useful downstream effects in some cases.
    apparentlymart committed May 31, 2023
    Configuration menu
    Copy the full SHA
    333389d View commit details
    Browse the repository at this point in the history
  6. hcldec: RefineValueSpec

    This new spec type allows adding value refinements to the results of some
    other spec, as long as the wrapped spec does indeed enforce the
    constraints described by the refinements.
    apparentlymart committed May 31, 2023
    Configuration menu
    Copy the full SHA
    e4bd3b4 View commit details
    Browse the repository at this point in the history
  7. Update CHANGELOG.md

    apparentlymart authored May 31, 2023
    Configuration menu
    Copy the full SHA
    58cc29f View commit details
    Browse the repository at this point in the history
  8. v2.17.0 release

    apparentlymart committed May 31, 2023
    Configuration menu
    Copy the full SHA
    7208bce View commit details
    Browse the repository at this point in the history
Loading