Skip to content

Commit af59eb6

Browse files
committed
making json data more useful for client consumption
1 parent d660496 commit af59eb6

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

internal/command/views/init.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,39 +196,39 @@ var MessageRegistry map[InitMessageCode]InitMessage = map[InitMessageCode]InitMe
196196
},
197197
"provider_already_installed_message": {
198198
HumanValue: "- Using previously-installed %s v%s",
199-
JSONValue: "- Using previously-installed %s v%s",
199+
JSONValue: "%s v%s: Using previously-installed provider version",
200200
},
201201
"built_in_provider_available_message": {
202202
HumanValue: "- %s is built in to Terraform",
203-
JSONValue: "- %s is built in to Terraform",
203+
JSONValue: "%s is built in to Terraform",
204204
},
205205
"reusing_previous_version_info": {
206206
HumanValue: "- Reusing previous version of %s from the dependency lock file",
207-
JSONValue: "- Reusing previous version of %s from the dependency lock file",
207+
JSONValue: "%s: Reusing previous version from the dependency lock file",
208208
},
209209
"finding_matching_version_message": {
210210
HumanValue: "- Finding %s versions matching %q...",
211-
JSONValue: "- Finding %s versions matching %q...",
211+
JSONValue: "Finding matching versions for provider: %s, version_constraint: %q",
212212
},
213213
"finding_latest_version_message": {
214214
HumanValue: "- Finding latest version of %s...",
215-
JSONValue: "- Finding latest version of %s...",
215+
JSONValue: "%s: Finding latest version...",
216216
},
217217
"using_provider_from_cache_dir_info": {
218218
HumanValue: "- Using %s v%s from the shared cache directory",
219-
JSONValue: "- Using %s v%s from the shared cache directory",
219+
JSONValue: "%s v%s: Using from the shared cache directory",
220220
},
221221
"installing_provider_message": {
222222
HumanValue: "- Installing %s v%s...",
223-
JSONValue: "- Installing %s v%s...",
223+
JSONValue: "Installing provider version: %s v%s...",
224224
},
225225
"key_id": {
226226
HumanValue: ", key ID [reset][bold]%s[reset]",
227-
JSONValue: ", key ID %s",
227+
JSONValue: "key_id: %s",
228228
},
229229
"installed_provider_version_info": {
230230
HumanValue: "- Installed %s v%s (%s%s)",
231-
JSONValue: "- Installed %s v%s (%s%s)",
231+
JSONValue: "Installed provider version: %s v%s (%s%s)",
232232
},
233233
"partner_and_community_providers_message": {
234234
HumanValue: partnerAndCommunityProvidersInfo,

internal/command/views/init_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func TestNewInit_jsonViewOutput(t *testing.T) {
177177
},
178178
{
179179
"@level": "info",
180-
"@message": fmt.Sprintf("- Finding latest version of %s...", packageName),
180+
"@message": fmt.Sprintf("%s: Finding latest version...", packageName),
181181
"@module": "terraform.ui",
182182
"message_code": "finding_latest_version_message",
183183
"type": "init_output",
@@ -211,7 +211,7 @@ func TestNewInit_jsonViewOutput(t *testing.T) {
211211
},
212212
{
213213
"@level": "info",
214-
"@message": fmt.Sprintf("- Using previously-installed %s v%s", packageName, packageVersion),
214+
"@message": fmt.Sprintf("%s v%s: Using previously-installed provider version", packageName, packageVersion),
215215
"@module": "terraform.ui",
216216
"message_code": "provider_already_installed_message",
217217
"type": "init_output",

0 commit comments

Comments
 (0)