Skip to content
/ go-cty Public
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: zclconf/go-cty
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.16.4
Choose a base ref
...
head repository: zclconf/go-cty
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.17.0
Choose a head ref
  • 7 commits
  • 39 files changed
  • 1 contributor

Commits on Aug 20, 2025

  1. cty: Modern iter.Seq2 equivalents of Value.ElementIterator and Walk

    cty now requires Go 1.23, because package iter is not available in earlier
    versions of Go.
    apparentlymart committed Aug 20, 2025
    Configuration menu
    Copy the full SHA
    d95a68c View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2025

  1. cty+ctymarks: Deep mark wrangling helper

    Having now got some experience using marks more extensively in some
    callers, it's become clear that it's often necessary for different
    subsystems to be able to collaborate using independent marks without
    upsetting each other's assumptions. Today that tends to be achieved using
    hand-written transforms either with cty.Transform or
    cty.Value.UnmarkDeepWithPaths/cty.Value.MarkWithPaths, both of which can
    be pretty expensive even in the common case where there are no marks
    present at all.
    
    This new function allows inspecting and transforming marks with far less
    overhead, by creating new values only for parts of a structure that
    actually need to change and by reusing (rather than recreating) the
    "payloads" of the values being modified when we know that only the marks
    have changed.
    apparentlymart committed Aug 30, 2025
    Configuration menu
    Copy the full SHA
    31572cf View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2025

  1. cty: Various new mark-inspecting helpers

    I've seen variants of each of these hand-written many times in callers, so
    it's well past time to bring them upstream to better support the common
    marks-related usage patterns that have emerged downstream.
    apparentlymart committed Aug 31, 2025
    Configuration menu
    Copy the full SHA
    d4bb9d4 View commit details
    Browse the repository at this point in the history
  2. Bulk replace interface{} -> any

    Go 1.18 introduced "any" as a shorthand for the empty interface type, and
    we'd already started using it in a few places so for consistency let's
    switch all existing uses of empty interface to "any" now.
    apparentlymart committed Aug 31, 2025
    Configuration menu
    Copy the full SHA
    f833b10 View commit details
    Browse the repository at this point in the history
  3. cty: Use DeepValues instead of Walk for deep marks inspections

    An earlier commit added cty.DeepValues as an iter.Seq2-based alternative
    to Walk, and that's much easier to use for deep inspections because it
    doesn't require weird trickery to get the Walk to stop at the right time
    and smuggle result values out.
    
    However, in the process of doing this I discovered that cty.DeepValues
    itself was falling into that very trap of failing to terminate Walk
    correctly, and so this also includes a fixed version of that which will
    stop yielding new values once commanded to do so.
    apparentlymart committed Aug 31, 2025
    Configuration menu
    Copy the full SHA
    4453ac2 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2025

  1. cty: Use WrangleMarksDeep for UnmarkDeep and UnmarkDeepWithPaths

    These functions were previously using the "Transformer" mechanism, which is
    very general but as a result ends up always conservatively rebuilding
    the entire data structure it's given.
    
    The recently-added WrangleMarksDeep relies on the fact that it can only
    possibly change marks (not the actual values) to avoid building a new
    value at all in the common case where there are no marks, to rebuild
    only the parts of the structure that have mark changes when changes are
    being made, and to reuse the internal "payload" values from the source
    values while just wrapping them in a new outer cty.Value.
    
    Testing with a benchmark in another codebase that makes heavy use of both
    UnmarkDeep and UnmarkDeepWithPaths shows this being a material performance
    improvement.
    
    This also includes a bonus fast path for MarkWithPaths where it will skip
    doing anything at all if the given slice of ParkValueMarks is empty.
    apparentlymart committed Sep 5, 2025
    Configuration menu
    Copy the full SHA
    b13ddd4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    da4c600 View commit details
    Browse the repository at this point in the history
Loading