This project is mirrored from https://:*****@github.com/hashicorp/terraform.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
  1. 29 Oct, 2021 3 commits
    • Martin Atkins's avatar
    • Martin Atkins's avatar
      command: Experimental validate "hints" mode · 88832277
      Martin Atkins authored
      With a particular compile-time flag set (not by default) this adds an
      extra -hints option to "terraform validate" which makes it run Terraform
      Core's validate operation in hints mode.
      
      For the moment this is just here to let us easily experiment with hints
      in development environments. It's not yet ready to graduate to being
      included in real releases because we still need to get a sense of what the
      "rules" are for what makes sense as a hint, and we might also decide to
      use a different CLI argument style or other interface to access the hints
      mode.
      88832277
    • Martin Atkins's avatar
      core: Validate's "lint" mode is now its "hint" mode · 768f62a5
      Martin Atkins authored
      The noun "hint" seems to better describe what this mode actually does,
      which is to make suggestions that hopefully improve readability overall
      but may not be appropriate in all situations.
      
      This retains the previous suggestions about depends_on and doesn't
      introduce any others, but they are now presented as hint diagnostics
      instead of warning diagnostics.
      768f62a5
  2. 28 Oct, 2021 6 commits
    • Martin Atkins's avatar
      tfdiags: A new specialized diagnostics severity for "hints" · 202a2749
      Martin Atkins authored
      This is here to support a forthcoming "hint mode" for validation, which
      opts in to generating additional hints that will hopefully help with
      debugging and improving module understandability but do not imply that a
      module is necessarily "incorrect" or need to be fixed in all cases.
      
      Not all of our codepaths will be able to handle this severity well,
      because it's arriving on the scene late and so some existing codepaths
      won't be aware of it, but that's okay because it's constrained only to
      the validation codepath in particular, and only when hint mode is enabled,
      and so we only really need to deal with it in that particular situation.
      202a2749
    • Martin Atkins's avatar
      core: New lint-checking mode for Validate · cd747a53
      Martin Atkins authored
      Here we establish a new mode for Context.Validate which enables some extra
      checks which can produce warnings that don't necessarily need to be fixed
      in order for a Terraform module to be accepted, but that which are
      indicative of common mistakes that might lead to unintended behavior or
      of non-idiomatic style.
      
      The idea of this mode is that users could potentially enable it if they
      are seeing some unexpected behavior, to potentially get some additional
      hints as to what might be causing it. Since linting might sometimes
      generate false negatives, this mode probably won't be suitable for use
      as a pre-merge automated check.
      
      For this first round, the lint checks are focused on the depends_on
      arguments within "resource" and "data" blocks, catching situations where
      entries in depends_on are redundant with other declarations or refer to
      individual resource instances when Terraform only considers whole
      resources.
      
      This new mode is currently not exposed in the UI anywhere, so this is all
      just dead code for the moment. Perhaps in future it will be exposed either
      as a new mode for "terraform validate" or as a new command
      "terraform lint", but we'll save that decision for later work.
      cd747a53
    • Martin Atkins's avatar
      core: Make ValidateOpts visible to validateGraphBuilder · d751faef
      Martin Atkins authored
      The graph builder doesn't actually use this information yet, but this
      will allow us to make the graph builder react to future options without
      causing any further changes in the validateGraphBuilder callers.
      d751faef
    • Martin Atkins's avatar
      core: Un-export the validate graph builder function · e184d3c5
      Martin Atkins authored
      This is another small step in our ongoing effort to refine the exported
      API of the "terraform" package to be only what external callers need.
      
      The validate graph is an implementation detail of Context.Validate and
      need not be exposed outside of this package.
      e184d3c5
    • Martin Atkins's avatar
      core: Context.Validate takes ValidateOpts argument · 5a3e4be1
      Martin Atkins authored
      This follows a similar principle as Context.Plan and Context.Eval.
      Although we don't have any special extra options to add right now, adding
      a new argument to the Validate method causes disruptive changes to callers
      in various other files, whereas adding a new optional member to
      ValidateOpts will typically touch fewer files and thus allow more of our
      code to stay unmodified (and thus more backport-friendly) across future
      updates.
      5a3e4be1
    • James Bardin's avatar
      Merge pull request #29648 from hashicorp/jbardin/tfproto6.1 · 9b62dd69
      James Bardin authored
      tfproto version 6.1
      9b62dd69
  3. 26 Oct, 2021 2 commits
  4. 25 Oct, 2021 6 commits
  5. 23 Oct, 2021 1 commit
  6. 22 Oct, 2021 1 commit
  7. 21 Oct, 2021 3 commits
    • Alisdair McDiarmid's avatar
      backend/remote: Fix version check when migrating · 17294315
      Alisdair McDiarmid authored
      When migrating state to an existing Terraform Cloud workspace using the
      remote backend, we check the remote version is compatible with the local
      one by default.
      
      This commit fixes two bugs in this code:
      
      - If using the "name" strategy for the remote backend, the list of
        destination workspaces is empty. This resulted in no version checking
        of the remote workspace, and we fell back to the string equality
        check.
      - The user-specified CLI flag `-ignore-remote-version` was not being
        applied for the state migration version checking.
      17294315
    • Alisdair McDiarmid's avatar
      cli: Fix init failure with deleted cache · 39de3ebe
      Alisdair McDiarmid authored
      The init command needs to initialize a backend, in order to access
      state, in turn to derive provider requirements from state. The backend
      initialization step requires building provider factories, which
      previously would fail if a lockfile was present without a corresponding
      local provider cache.
      
      This commit ensures that in this situation only, errors with the
      provider factories are temporarily ignored. This allows us to continue
      to initialize the backend, fetch providers, and then report any errors
      as necessary.
      39de3ebe
    • Alisdair McDiarmid's avatar
      command/e2etest: Ensure init fixes missing cache · 1190b95f
      Alisdair McDiarmid authored
      We test that a deleted provider cache results in an error when running
      terraform plan, but previously did not test that running init (as
      instructed) would resolve the issue. This (failing) e2e test adds that
      step.
      1190b95f
  8. 20 Oct, 2021 6 commits
  9. 19 Oct, 2021 4 commits
  10. 16 Oct, 2021 1 commit
  11. 15 Oct, 2021 1 commit
  12. 14 Oct, 2021 5 commits
  13. 13 Oct, 2021 1 commit