Skip to content

Commit

Permalink
json-output: Release format version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alisdair committed Oct 6, 2021
1 parent bea7e3e commit b9f3dab
Show file tree
Hide file tree
Showing 42 changed files with 103 additions and 63 deletions.
2 changes: 1 addition & 1 deletion internal/command/jsonplan/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
// FormatVersion represents the version of the json format and will be
// incremented for any change to this format that requires changes to a
// consuming parser.
const FormatVersion = "0.2"
const FormatVersion = "1.0"

// Plan is the top-level representation of the json format of a plan. It includes
// the complete config and current state.
Expand Down
2 changes: 1 addition & 1 deletion internal/command/jsonprovider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// FormatVersion represents the version of the json format and will be
// incremented for any change to this format that requires changes to a
// consuming parser.
const FormatVersion = "0.2"
const FormatVersion = "1.0"

// providers is the top-level object returned when exporting provider schemas
type providers struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/command/jsonstate/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
// FormatVersion represents the version of the json format and will be
// incremented for any change to this format that requires changes to a
// consuming parser.
const FormatVersion = "0.2"
const FormatVersion = "1.0"

// state is the top-level representation of the json format of a terraform
// state.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"provider_schemas": {
"registry.terraform.io/hashicorp/test": {
"provider": {
Expand Down
4 changes: 2 additions & 2 deletions internal/command/testdata/providers-schema/empty/output.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"format_version": "0.2"
}
"format_version": "1.0"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"provider_schemas": {
"registry.terraform.io/hashicorp/test": {
"provider": {
Expand Down
4 changes: 2 additions & 2 deletions internal/command/testdata/show-json-sensitive/output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"variables": {
"test_var": {
"value": "bar"
Expand Down Expand Up @@ -66,7 +66,7 @@
}
},
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"values": {
"outputs": {
"test": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"terraform_version": "0.12.0",
"values": {
"root_module": {
Expand Down
4 changes: 2 additions & 2 deletions internal/command/testdata/show-json-state/empty/output.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"format_version": "0.2"
}
"format_version": "1.0"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"terraform_version": "0.12.0",
"values": {
"outputs": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"terraform_version": "0.14.0",
"values": {
"root_module": {
Expand Down
4 changes: 2 additions & 2 deletions internal/command/testdata/show-json/basic-create/output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"variables": {
"test_var": {
"value": "bar"
Expand Down Expand Up @@ -57,7 +57,7 @@
}
},
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"values": {
"outputs": {
"test": {
Expand Down
4 changes: 2 additions & 2 deletions internal/command/testdata/show-json/basic-delete/output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"variables": {
"test_var": {
"value": "bar"
Expand Down Expand Up @@ -89,7 +89,7 @@
}
},
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"values": {
"outputs": {
"test": {
Expand Down
4 changes: 2 additions & 2 deletions internal/command/testdata/show-json/basic-update/output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"variables": {
"test_var": {
"value": "bar"
Expand Down Expand Up @@ -68,7 +68,7 @@
}
},
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"values": {
"outputs": {
"test": {
Expand Down
4 changes: 2 additions & 2 deletions internal/command/testdata/show-json/drift/output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"planned_values": {
"root_module": {
"resources": [
Expand Down Expand Up @@ -106,7 +106,7 @@
}
],
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"values": {
"root_module": {
"resources": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"terraform_version": "0.13.1-dev",
"planned_values": {
"root_module": {
Expand Down
4 changes: 2 additions & 2 deletions internal/command/testdata/show-json/modules/output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"planned_values": {
"outputs": {
"test": {
Expand Down Expand Up @@ -74,7 +74,7 @@
}
},
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"values": {
"outputs": {
"test": {
Expand Down
4 changes: 2 additions & 2 deletions internal/command/testdata/show-json/moved-drift/output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"planned_values": {
"root_module": {
"resources": [
Expand Down Expand Up @@ -108,7 +108,7 @@
}
],
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"values": {
"root_module": {
"resources": [
Expand Down
4 changes: 2 additions & 2 deletions internal/command/testdata/show-json/moved/output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"planned_values": {
"root_module": {
"resources": [
Expand Down Expand Up @@ -46,7 +46,7 @@
}
],
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"values": {
"root_module": {
"resources": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"terraform_version": "0.13.0",
"variables": {
"test_var": {
Expand Down Expand Up @@ -107,7 +107,7 @@
}
},
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"terraform_version": "0.13.0",
"values": {
"outputs": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"planned_values": {
"root_module": {
"child_modules": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"variables": {
"test_var": {
"value": "bar"
Expand Down Expand Up @@ -57,7 +57,7 @@
}
},
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"values": {
"outputs": {
"test": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"variables": {
"test_var": {
"value": "bar"
Expand Down Expand Up @@ -57,7 +57,7 @@
}
},
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"values": {
"outputs": {
"test": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"planned_values": {
"root_module": {
"resources": [
Expand Down Expand Up @@ -48,7 +48,7 @@
}
],
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"values": {
"root_module": {
"resources": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.2",
"format_version": "1.0",
"variables": {
"test_var": {
"value": "boop"
Expand Down Expand Up @@ -69,7 +69,7 @@
}
},
"prior_state": {
"format_version": "0.2",
"format_version": "1.0",
"values": {
"outputs": {
"test": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.1",
"format_version": "1.0",
"valid": false,
"error_count": 4,
"warning_count": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.1",
"format_version": "1.0",
"valid": false,
"error_count": 2,
"warning_count": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.1",
"format_version": "1.0",
"valid": true,
"error_count": 0,
"warning_count": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.1",
"format_version": "1.0",
"valid": false,
"error_count": 1,
"warning_count": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.1",
"format_version": "1.0",
"valid": false,
"error_count": 1,
"warning_count": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.1",
"format_version": "1.0",
"valid": false,
"error_count": 1,
"warning_count": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.1",
"format_version": "1.0",
"valid": false,
"error_count": 1,
"warning_count": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.1",
"format_version": "1.0",
"valid": false,
"error_count": 1,
"warning_count": 0,
Expand Down
2 changes: 1 addition & 1 deletion internal/command/testdata/validate-invalid/output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.1",
"format_version": "1.0",
"valid": false,
"error_count": 1,
"warning_count": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.1",
"format_version": "1.0",
"valid": false,
"error_count": 2,
"warning_count": 0,
Expand Down
2 changes: 1 addition & 1 deletion internal/command/testdata/validate-valid/output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "0.1",
"format_version": "1.0",
"valid": true,
"error_count": 0,
"warning_count": 0,
Expand Down
2 changes: 1 addition & 1 deletion internal/command/views/json_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// This version describes the schema of JSON UI messages. This version must be
// updated after making any changes to this view, the jsonHook, or any of the
// command/views/json package.
const JSON_UI_VERSION = "0.1.0"
const JSON_UI_VERSION = "1.0"

func NewJSONView(view *View) *JSONView {
log := hclog.New(&hclog.LoggerOptions{
Expand Down
2 changes: 1 addition & 1 deletion internal/command/views/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (v *ValidateJSON) Results(diags tfdiags.Diagnostics) int {
// FormatVersion represents the version of the json format and will be
// incremented for any change to this format that requires changes to a
// consuming parser.
const FormatVersion = "0.1"
const FormatVersion = "1.0"

type Output struct {
FormatVersion string `json:"format_version"`
Expand Down
Loading

0 comments on commit b9f3dab

Please sign in to comment.