Commit graph

29 commits

Author SHA1 Message Date
Sarah French
f88d09544e
PSS: Add tests showing provider commands being used with PSS (#37959)
* test: Add E2E test for using pluggable state storage with the `providers` command

Note: I've excluded the `terraform providers locks` and `terraform providers mirror` commands as they don't interact with backends.

* test: Add integration test for using pluggable state storage with the `providers` command

* refactor: Change ioutil.ReadDir to os.ReadDir

* test: Add integration test for using pluggable state storage with the `providers schema` command

* feat: Allow state store schema's to be included when schemas are marshalled into JSON output

* test: Assert that state stores are present in provider schemas returned from `providers schema`.

* test: Update existing tests to accommodate state stores being in provider schema output

* test: Update E2E test for `providers` commands to be better scoped to testing use of a state store to access and use state when generating output.

This complements TestProvidersSchema that tests that state stores in a provider are reflected in the JSON representations of the schemas that the command returns.

* chore: Replace `io/ioutil` with `io` in `providers schema` tests
2025-12-17 19:44:36 +00:00
Samsondeen
719aefdb89
tf query: ready list blocks for beta (#37619) 2025-09-17 12:29:04 +02:00
Kristin Laemmert
df113486a1
actions: remove references to action types, linked resources (#37616)
* action renaming
* actions: remove references to action types
* actions: remove references to linked_resources or action types from the plan proto
2025-09-16 08:46:22 -04:00
Daniel Schmidt
871451122f actions: move schema to single action type and remove linked resources
we want to leave the door open to evolve the design in the future based on feedback
2025-09-15 17:09:22 +02:00
Daniel Schmidt
176263d936 actions: remove future action types
removing them for now, this gives us more flexibility in the future since the schema is not yet locked in
2025-08-29 16:25:41 +02:00
Daniel Schmidt
8b65426ecf move action schemas out of experimental flag 2025-08-28 12:04:51 +02:00
Daniel Banck
2463f864dd
Exclude nested config block from list resource schemas (#37495)
* Exclude nested config block from list resource schemas

* Guard action schemas by experimental flag

* Fix tests
2025-08-26 13:17:27 -04:00
Daniel Schmidt
dd86671056 marshal action schemas into json provider representation 2025-07-31 16:07:38 +02:00
Daniel Banck
ab04e5cfec
Include list resource schemas in provider json schemas (TF-25497) (#37163)
* Include list schemas in provider json schemas

* Only include list schemas in experimental builds
2025-06-30 10:59:19 +02:00
Daniel Banck
cd433fa6d9
Marshall resource identity schemas in jsonprovider (#36675) 2025-03-12 09:53:03 +01:00
Daniel Banck
10c9b64007
Rename schema.Block to Body (#36629) 2025-03-04 16:33:43 +01:00
Daniel Schmidt
6f58dbe75c
write-only attributes: emit structural data on schema rendering 2024-11-12 16:42:05 +01:00
Radek Simko
5e1d2303fb
jsonprovider: Expose ephemeral resource schemas (#35800)
* jsonprovider: Expose ephemeral resource schemas

* add ephemeral resource to the test
2024-10-02 15:41:12 +01:00
Brian Flad
3b4964270f
internal/command/jsonprovider: Remove root jsonfunction object from function output (#34536)
Previously, the `providers schema -json` output would include the root object from `metadata functions -json`. This object had its own `format_version` property, which would be confusing with the root `format_version` property already present.

This change still uses the `jsonfunction` package for consistency between cty and provider function JSON handling, but removes that extra object, instead making `functions` directly a mapping of names to signatures/definitions. This also adds a code comment to hint maintainers that jsonprovider format versioning is tied to jsonfunction format versioning.

Example output prior to change:

```jsonc
{
  "format_version": "1.0",
  "provider_schemas": {
    "registry.terraform.io/bflad/framework": {
      // ...
      "functions": {
        "format_version": "1.0",
        "function_signatures": {
          "example": {
            "description": "Echoes given argument as result",
            "summary": "Example function",
            "return_type": "string",
            "parameters": [
              {
                "name": "input",
                "description": "String to echo",
                "type": "string"
              }
            ]
          }
        }
      }
    }
  }
}
```

Example output after change:

```jsonc
{
  "format_version": "1.0",
  "provider_schemas": {
    "registry.terraform.io/bflad/framework": {
      // ...
      "functions": {
        "example": {
          "description": "Echoes given argument as result",
          "summary": "Example function",
          "return_type": "string",
          "parameters": [
            {
              "name": "input",
              "description": "String to echo",
              "type": "string"
            }
          ]
        }
      }
    }
  }
}
```
2024-01-18 15:48:07 -05:00
James Bardin
6553e55dfa marshal provider functions into the json schemas
Add provider functions to the json schema output for providers. We
leverage the jsonfunction package here to ensure that the serialization
is kept identical, so that the consumers of the json function
definitions can work equally with both.
2023-12-22 09:56:15 -05:00
hashicorp-copywrite[bot]
53c34ff49c
Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
James Bardin
cf5ebaf685 s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
James Bardin
d487ce20e1 update jsonprovider to use new schema type 2023-07-06 10:37:35 -04:00
hashicorp-copywrite[bot]
325d18262e [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
Liam Cervante
95782f2491
Structured plan renderer: Implement the main functionality for the renderer (#32496)
* raw unmodified broken tests

* tests execute, no panics

* fix whitespace differences

* fix all the tests

* fix tests

* actually fix tests

* add missing plan metadata into the renderer

* address comments

* complete merge

* remove TODO raising questions about outputs, they are fixed

* missing bold on plan
2023-01-12 17:59:07 +01:00
Liam Cervante
b917154a97
Make required JSON structured output structures public for processing (#32367)
* prep for processing the structured run output

* undo unwanted change to a json key
2023-01-09 10:48:23 +01:00
James Bardin
9b62dd6901
Merge pull request #29648 from hashicorp/jbardin/tfproto6.1
tfproto version 6.1
2021-10-28 16:00:02 -04:00
Alisdair McDiarmid
b9f3dab035 json-output: Release format version 1.0 2021-10-06 11:13:06 -04:00
James Bardin
9847eaa9cf remove usage of MinItems/MaxItems
MinItems and MaxItems are not used on nested types in the protocol, so
remove their usage in Terraform to prevent future confusion.
2021-09-24 12:26:00 -04:00
Alisdair McDiarmid
cd29c3e5fd
Revert "json-output: Release format version 1.0" 2021-09-09 11:25:35 -04:00
Alisdair McDiarmid
b60f201eed json-output: Release format version 1.0 2021-09-01 15:15:18 -04:00
Martin Atkins
36d0a50427 Move terraform/ to internal/terraform/
This is part of a general effort to move all of Terraform's non-library
package surface under internal in order to reinforce that these are for
internal use within Terraform only.

If you were previously importing packages under this prefix into an
external codebase, you could pin to an earlier release tag as an interim
solution until you've make a plan to achieve the same functionality some
other way.
2021-05-17 14:09:07 -07:00
Martin Atkins
31349a9c3a Move configs/ to internal/configs/
This is part of a general effort to move all of Terraform's non-library
package surface under internal in order to reinforce that these are for
internal use within Terraform only.

If you were previously importing packages under this prefix into an
external codebase, you could pin to an earlier release tag as an interim
solution until you've make a plan to achieve the same functionality some
other way.
2021-05-17 14:09:07 -07:00
Martin Atkins
ffe056bacb Move command/ to internal/command/
This is part of a general effort to move all of Terraform's non-library
package surface under internal in order to reinforce that these are for
internal use within Terraform only.

If you were previously importing packages under this prefix into an
external codebase, you could pin to an earlier release tag as an interim
solution until you've make a plan to achieve the same functionality some
other way.
2021-05-17 14:09:07 -07:00