Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command/format: minor adjustments to plan rendering #15362

Merged
merged 3 commits into from
Jun 22, 2017

Commits on Jun 22, 2017

  1. core: ResourceAddress.Less for sorting resource addresses

    Lexicographic sorting by the string form produces the wrong result because
    [9] sorts after [10], so this custom comparison function takes that into
    account and compares each portion separately to get a more intuitive
    result.
    apparentlymart committed Jun 22, 2017
    Configuration menu
    Copy the full SHA
    49f5d77 View commit details
    Browse the repository at this point in the history
  2. core: ParseResourceAddressForInstanceDiff function

    This is a specialized thin wrapper around parseResourceAddressInternal
    that can be used to obtain a ResourceAddress from the keys in
    ModuleDiff.Resources.
    
    This is not something we'd ideally expose, but since the internal address
    format is already exposed in the ModuleDiff object this ends up being
    necessary to process the ModuleDiff from other packages, e.g. for
    display in the UI.
    apparentlymart committed Jun 22, 2017
    Configuration menu
    Copy the full SHA
    386c8b6 View commit details
    Browse the repository at this point in the history
  3. command/format: minor adjustments to plan rendering

    This change makes various minor adjustments to the rendering of plans
    in the output of "terraform plan":
    
    - Resources are identified using the standard resource address syntax,
      rather than exposing the legacy internal representation used in the
      module diff resource keys. This fixes #8713.
    
    - Subjectively, having square brackets in the addresses made it look more
      visually "off" when the same name but with different indices were
      shown together with differing-length "symbols", so the symbols are now
      all padded and right-aligned to three characters for consistent layout
      across all operations.
    
    - The -/+ action is now more visually distinct, using several different
      colors to help communicate what it will do and including a more obvious
      "(new resource required)" marker to help draw attention to this not
      being just an update diff. This fixes #15350.
    
    - The resources are now sorted in a manner that sorts index [10] after
      index [9], rather than after index [1] as we did before. This makes it
      easier to scan the list and avoids the common confusion where it seems
      that there are only 10 items when in fact there are 11-20 items with
      all the tens hiding further up in the list.
    apparentlymart committed Jun 22, 2017
    Configuration menu
    Copy the full SHA
    deca0fb View commit details
    Browse the repository at this point in the history