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. 12 Mar, 2021 5 commits
    • Martin Atkins's avatar
      exprstress: A randomized stress tester for expression evaluation · bfbe6a55
      Martin Atkins authored
      Although we have a fair number of hand-written unit tests for different
      permutations of expression evaluation, when writing those we tend to
      favor relatively straightforward situations which only include a single
      operator or function at a time, and thus we can sometimes miss including
      test cases for less common situations that can arise when combining
      different features together.
      
      This new package and its associated CLI tool are intended to randomly
      generate various valid expressions with different combinations of
      expression operators and functions from the Terraform language, and then
      check to make sure that they evaluate successfully and produce a result
      of the expected type, mode, and sensitivity. Hopefully this will allow us
      to find problems that we wouldn't think to test.
      
      This is a similar sort of idea as fuzz testing, but at a higher level of
      abstraction where the input is intended to always be a valid expression
      and we're focused on the evaluator, rather than generating random bytes
      and trying to crash the HCL parser. This is a form of property-based
      testing, albeit applying the same set of properties to all possible
      expressions rather than testing unique properties of each expression type.
      bfbe6a55
    • James Bardin's avatar
      Merge pull request #28072 from hashicorp/jbardin/provider-meta-interpolation · 0750a16c
      James Bardin authored
      validate provider_meta contains no interpolations
      Unverified
      0750a16c
    • Martin Atkins's avatar
      dc7f2b73
    • James Bardin's avatar
      validate provider_meta contains no interpolations · 759b7643
      James Bardin authored
      The provider_meta specification does not allow interpolation, but we
      were not preventing it in the configuration.
      759b7643
    • Kristin Laemmert's avatar
      add support for attributes with nested types in providers schema (#28055) · b26ae9cf
      Kristin Laemmert authored
      This PR extends jsonprovider to support attributes with NestedTypes and extends test coverage in jsonprovider and the providers schemas tests. I've also cleaned up some comments and extracted the logic to parse the nesting mode so it can be used in both marshalling blocks and attributes.
      Unverified
      b26ae9cf
  2. 11 Mar, 2021 3 commits
  3. 10 Mar, 2021 2 commits
  4. 09 Mar, 2021 4 commits
  5. 08 Mar, 2021 2 commits
  6. 05 Mar, 2021 3 commits
  7. 04 Mar, 2021 3 commits
  8. 01 Mar, 2021 1 commit
  9. 26 Feb, 2021 3 commits
    • Alisdair McDiarmid's avatar
      views: Fix missing source in diagnostic output · 86495f93
      Alisdair McDiarmid authored
      The previous implementation of views was copying and embedding the base
      View struct in each individual view. While this allowed for easy access
      to the interface of that struct (both in the view and externally), it more
      importantly completely broke the ability of the diagnostic printer to
      output source code snippets.
      
      This is because the `configSources` field on the base view is lazily set
      after the config loader is initialized. In the commands ported to use
      views, this happens after the base View struct is copied, so we are
      updating the wrong copy of the struct.
      
      This commit fixes this with a simple mechanical refactor: keep a pointer
      to the base View struct instead, and update all of the individual views
      to explicitly refer to that struct to access its fields and methods.
      
      This is not a particularly satisfying solution, but I can't find
      anything clearly better. It might be worth exploring the alternative
      approach in the view for the new test command, which explicitly pulls
      its dependencies out of the base view, rather than retaining a full
      reference. Maybe there's a third way which is better still.
      86495f93
    • Martin Atkins's avatar
      configs: Accept and minimally validate a "language" argument · b5adc330
      Martin Atkins authored
      We expect that in order to continue to evolve the language without
      breaking existing modules we will at some point need to have a way to mark
      when a particular module is expecting a newer interpretation of the
      language.
      
      Although it's too early to do any deep preparation for that, this commit
      aims to proactively reserve an argument named "language" inside
      "terraform" blocks, which currently only accepts the keyword TF2021 that
      is intended to represent "the edition of the Terraform language as defined
      in 2021".
      
      That argument also defaults to TF2021 if not set, so in practice there's
      no real reason to set this today, but this minimal validation today is
      intended to give better feedback to users of older Terraform versions in
      the event that we introduce a new language edition later and they try to
      use an module incompatible with their Terraform version.
      b5adc330
    • Martin Atkins's avatar
      configs: A better error message for custom variable validation · 54cc4dad
      Martin Atkins authored
      Our previous message conflated the requirement for a full sentence with
      the suggestion to write in a style similar to Terraform's built-in error
      messages, which created a sense that the system would actively reject an
      error message written in another language.
      
      There's no intent here to block writing error messages in other languages,
      but there is a practical consideration that Terraform's UI output is
      currently not localized and so consistency with Terraform's other output,
      if that's important to a module author, will typically mean writing the
      error message in English.
      54cc4dad
  10. 25 Feb, 2021 6 commits
  11. 24 Feb, 2021 8 commits