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. 05 Jan, 2022 10 commits
    • Martin Atkins's avatar
      build: CGO_ENABLED when building for macOS · 63b7f461
      Martin Atkins authored
      Normally when we cross-compile we do so without CGo, because we don't have
      suitable C headers available for systems other than the host.
      
      However, building for macOS on macOS is special because there are
      sufficient headers available on darwin_amd64 to build for both
      darwin_amd64 _and_ darwin_arm64. Also, we _must_ use CGo on macOS because
      the system resolver is only available via darwin's libc, and so building
      without CGo produces executables that don't resolve hostnames correctly.
      
      This is a conditional in bash to avoid having to duplicate the entire
      step. Perhaps later we'll find a more general version of this which can
      avoid the special case, but this is sufficient for the moment.
      63b7f461
    • Martin Atkins's avatar
      build: Separate Linux distro package builds into separate job · 28a6036c
      Martin Atkins authored
      In our build workflow we'll treat Linux distribution packaging (currently
      .deb and .rpm packages) as a separate job, instead of embedding it into
      the "build" job, so that this step can happen concurrently with the other
      derived actions like the docker image build, and the e2etest runs.
      28a6036c
    • Martin Atkins's avatar
      build: Constrain permissions for the "build" workflow steps · c1699ea8
      Martin Atkins authored
      This workflow only generates artifacts and doesn't need to modify anything
      about the repository.
      c1699ea8
    • Martin Atkins's avatar
      build: Consolidate build-darwin job into just "build" · 3bf758ea
      Martin Atkins authored
      We can use an extra matrix dimension to select which execution environment
      we'll use for each GOOS/GOARCH pair, and thus avoid duplicating the
      job definition for darwin just to set runs-on: macos-latest for it.
      
      This is not really an intended use of a matrix dimension because it's
      directly related to the existing "goos" one, rather than being an
      independent third dimension, but it doesn't matter in practice because
      we're using the "include" option to specify exact combinations, and thus
      we're not relying on the built-in functionality to generate all possible
      matrix combinations.
      3bf758ea
    • Martin Atkins's avatar
      build: Build docs source package as part of the release pipeline · 218e55b2
      Martin Atkins authored
      This should eventually grow to be a step that actually verifies the
      validity of the docs source prior to publishing the artifact that a
      downstream publishing pipeline can consume, but for the moment it's really
      just a placeholder since we have no such validation step and no downstream
      pipeline consuming this artifact.
      
      The general idea here is that the artifacts from this workflow should be
      sufficient for all downstream release steps to occur without any direct
      access to the Terraform CLI repository, and so this is intended to
      eventually meet that ideal but as of this commit the website docs
      publishing step _does_ still depend on direct access to this repository.
      218e55b2
    • Martin Atkins's avatar
      build: Build and run e2etest as part of the release build pipeline · b802db75
      Martin Atkins authored
      This uses the decoupled build and run strategy to run the e2etests so that
      we can arrange to run the tests against the real release packages produced
      elsewhere in this workflow, rather than ones generated just in time by
      the test harness.
      
      The modifications to make-archive.sh here make it more consistent with its
      originally-intended purpose of producing a harness for testing "real"
      release executables. Our earlier compromise of making it include its own
      terraform executable came from a desire to use that script as part of
      manual cross-platform testing when we weren't yet set up to support
      automation of those tests as we're doing here. That does mean, however,
      that the terraform-e2etest package content must be combined with content
      from a terraform release package in order to produce a valid contest for
      running the tests.
      
      We use a single job to cross-compile the test harness for all of the
      supported platforms, because that build is relatively fast and so not
      worth the overhead of matrix build, but then use a matrix build to
      actually run the tests so that we can run them in a worker matching the
      target platform.
      
      We currently have access only to amd64 (x64) runners in GitHub Actions
      and so for the moment this process is limited only to the subset of our
      supported platforms which use that architecture.
      b802db75
    • Martin Atkins's avatar
      Initial work on a new package build process · 6704f8c7
      Martin Atkins authored
      For the moment this is just an experimental additional sidecar package
      build process, separate from the one we really use for releases, so that
      we can get some experience building in the GitHub Actions environment
      before hopefully eventually switching to using the artifacts from this
      process as the packages we'll release through the official release
      channels.
      
      It will react to any push to one of our release branches or to a release
      tag by building official-release-like .zip, .deb, and .rpm packages, along
      with Docker images, based on the content of the corresponding commit.
      
      For the moment this doesn't actually produce _shippable_ packages because
      in particular it doesn't know how to update our version/version.go file
      to hard-code the correct version number. Once Go 1.18 is release and we've
      upgraded to it we'll switch to using debug.ReadBuildInfo to determine
      our version number at runtime and so no longer need to directly update
      a source file for each release, but that functionality isn't yet available
      in our current Go 1.17 release.
      6704f8c7
    • Alisdair McDiarmid's avatar
      Merge pull request #30205 from hashicorp/alisdair/fix-show-plan-against-non-default-state · 535da4eb
      Alisdair McDiarmid authored
      command/show: Disable plan state lineage checks
      535da4eb
    • kmoe's avatar
      Merge pull request #30292 from hashicorp/kmoe/dag-basicedge-hashcode · 73f5c777
      kmoe authored
      dags: fix BasicEdge pointer issue
      73f5c777
    • Katy Moe's avatar
      do not use pointer addr strings as map keys in set · f8fdb6de
      Katy Moe authored
      When creating a Set of BasicEdges, the Hashcode function is used to determine
      map keys for the underlying set data structure.
      
      The string hex representation of the two vertices' pointers is unsafe to use
      as a map key, since these addresses may change between the time they are added
      to the set and the time the set is operated on.
      
      Instead we modify the Hashcode function to maintain the references to the
      underlying vertices so they cannot be garbage collected during the lifetime
      of the Set.
      f8fdb6de
  2. 04 Jan, 2022 10 commits
    • Dylan Staley's avatar
      Merge pull request #30237 from hashicorp/ds.submodule-nav-main · a8bc7a01
      Dylan Staley authored
      Store website nav files (main)
      a8bc7a01
    • James Bardin's avatar
      Merge pull request #30286 from hashicorp/jbardin/dag · 9272ff2c
      James Bardin authored
      dag: minor cleanup
      9272ff2c
    • James Bardin's avatar
      Merge pull request #30253 from hashicorp/jbardin/move-graph · 8bbba22f
      James Bardin authored
      cleanup some move graph handling
      8bbba22f
    • Alisdair McDiarmid's avatar
      Merge pull request #30067 from hashicorp/alisdair/redact-sensitive-values-from-function-errors · ef01d5d1
      Alisdair McDiarmid authored
      lang/funcs: Redact sensitive values from function errors
      ef01d5d1
    • James Bardin's avatar
      clarify dag comments · 344adb6c
      James Bardin authored
      TransitiveReduction does not rely on having a single root, and only
      must be free of cycles.
      
      DepthFirstWalk and ReverseDepthFirstWalk do not do a topological sort,
      so if order matters TransitiveReduction must be run first.
      344adb6c
    • James Bardin's avatar
      Remove sorted walk functions · fae68f16
      James Bardin authored
      These two functions were left during a refactor to ensure the old
      behavior of a sorted walk was still accessible in some manner. The
      package has since been removed from any public API, and the sorted
      versions are no longer called, so we can remove them.
      fae68f16
    • James Bardin's avatar
      cleanup some move graph handling · f46cf7b8
      James Bardin authored
      Create a separate `validateMoveStatementGraph` function so that
      `ValidateMoves` and `ApplyMoves` both check the same conditions. Since
      we're not using the builtin `graph.Validate` method, because we may have
      multiple roots and want better cycle diagnostics, we need to add checks
      for self references too. While multiple roots are an error enforced by
      `Validate` for the concurrent walk, they are OK when using
      `TransitiveReduction` and `ReverseDepthFirstWalk`, so we can skip that
      check.
      
      Apply moves must first use `TransitiveReduction` to reduce the graph,
      otherwise nodes may be skipped if they are passed over by a transitive
      edge.
      f46cf7b8
    • James Bardin's avatar
      check for nested module index changes · 22dc6850
      James Bardin authored
      Changing only the index on a nested module will cause all nested moves
      to create cycles, since their full addresses will match both the From
      and To addresses. When building the dependency graph, check if the
      parent is only changing the index of the containing module, and prevent
      the backwards edge for the move.
      22dc6850
    • James Bardin's avatar
      find implied moves in nested modules · deb82daf
      James Bardin authored
      Implied moves in nested modules were being skipped
      deb82daf
    • James Bardin's avatar
      IsModuleMoveReIndex · 3d769b72
      James Bardin authored
      Add a method for checking if the From and To addresses in a move
      statement are only changing the indexes of modules relative to the
      statement module.
      
      This is needed because move statement nested within the module will be
      able to match against both the From and To addresses, causing cycles in
      the order of move operations.
      3d769b72
  3. 03 Jan, 2022 1 commit
    • Martin Atkins's avatar
      getmodules: Use go-getter v1.5.10 and return to upstream GitGetter · 74761b2f
      Martin Atkins authored
      There was an unintended regression in go-getter v1.5.9's GitGetter which
      caused us to temporarily fork that particular getter into Terraform to
      expedite a fix. However, upstream v1.5.10 now includes a
      functionally-equivalent fix and so we can heal that fork by upgrading.
      
      We'd also neglected to update the Module Sources docs when upgrading to
      go-getter v1.5.9 originally and so we were missing documentation about the
      new "depth" argument to enable shadow cloning, which I've added
      retroactively here along with documenting its restriction of only
      supporting named refs.
      
      This new go-getter release also introduces a new credentials-passing
      method for the Google Cloud Storage getter, and so we must incorporate
      that into the Terraform-level documentation about module sources.
      74761b2f
  4. 22 Dec, 2021 5 commits
  5. 21 Dec, 2021 6 commits
  6. 20 Dec, 2021 4 commits
  7. 17 Dec, 2021 4 commits
    • Martin Atkins's avatar
      providercache: Discard lock entries for unused providers · 23395a10
      Martin Atkins authored
      Previously we would only ever add new lock entries or update existing
      ones. However, it's possible that over time a module may _cease_ using
      a particular provider, at which point we ought to remove it from the lock
      file so that operations won't fail when seeing that the provider cache
      directory is inconsistent with the lock file.
      
      Now the provider installer (EnsureProviderVersions) will remove any lock
      file entries that relate to providers not included in the given
      requirements, which therefore makes the resulting lock file properly match
      the set of packages the installer wrote into the cache.
      
      This does potentially mean that someone could inadvertently defeat the
      lock by removing a provider dependency, running "terraform init", then
      undoing that removal, and finally running "terraform init" again. However,
      that seems relatively unlikely compared to the likelihood of removing
      a provider and keeping it removed, and in the event it _did_ happen the
      changes to the lock entry for that provider would be visible in the diff
      of the provider lock file as usual, and so could be noticed in code
      review just as for any other change to dependencies.
      23395a10
    • Alisdair McDiarmid's avatar
      command/show: Disable plan state lineage checks · 768741c0
      Alisdair McDiarmid authored
      When showing a saved plan, we do not need to check the state lineage
      against current state, because the plan cannot be applied. This is
      relevant when plan and apply specify a `-state` argument to choose a
      non-default state file. In this case, the stored prior state in the plan
      will not match the default state file, so a lineage check will always
      error.
      768741c0
    • James Bardin's avatar
      Merge pull request #30199 from hashicorp/jbardin/apply-failure-diags · 2c8edfb2
      James Bardin authored
      Apply graph failure handling
      2c8edfb2
    • James Bardin's avatar
      don't persist a nil state from Apply · 8c4031ef
      James Bardin authored
      Apply should not return a nil state to be persisted.
      8c4031ef