Skip to content

Commit 4c1af83

Browse files
committed
STAC-22609: Improving logging
1 parent f162e56 commit 4c1af83

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

cmd/stackpack/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func (w *OperationWaiter) WaitForCompletion(options WaitOptions) error {
105105

106106
// Return immediately if any configuration has failed
107107
if len(errorMessages) > 0 {
108-
return fmt.Errorf("stackpack '%s' installation failed:\n%s", options.StackPackName, strings.Join(errorMessages, "\n"))
108+
return fmt.Errorf("stackpack '%s' failed:\n%s", options.StackPackName, strings.Join(errorMessages, "\n"))
109109
}
110110

111111
// Success: all configurations are installed and none are provisioning

cmd/stackpack/stackpack_package.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func RunStackpackPackageCommand(args *PackageArgs) func(cli *di.Deps, cmd *cobra
195195
"source_dir": args.StackpackDir,
196196
})
197197
} else {
198-
cli.Printer.Successf("Stackpack packaged successfully!")
198+
cli.Printer.Successf("Stackpack packaged successfully!")
199199
cli.Printer.PrintLn("")
200200
cli.Printer.PrintLn(fmt.Sprintf("Stackpack: %s (v%s)", stackpackInfo.Name, stackpackInfo.Version))
201201
cli.Printer.PrintLn(fmt.Sprintf("Zip file: %s", args.ArchiveFile))

cmd/stackpack/stackpack_package_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func TestStackpackPackageCommand_DefaultBehavior(t *testing.T) {
7979
// Verify text output
8080
require.NotEmpty(t, *cli.MockPrinter.SuccessCalls)
8181
successCall := (*cli.MockPrinter.SuccessCalls)[0]
82-
assert.Contains(t, successCall, "Stackpack packaged successfully!")
82+
assert.Contains(t, successCall, "Stackpack packaged successfully!")
8383

8484
require.NotEmpty(t, *cli.MockPrinter.PrintLnCalls)
8585
printLnCalls := *cli.MockPrinter.PrintLnCalls
@@ -143,7 +143,7 @@ func TestStackpackPackageCommand_ForceFlag(t *testing.T) {
143143
// Verify success message
144144
require.NotEmpty(t, *cli2.MockPrinter.SuccessCalls)
145145
successCall := (*cli2.MockPrinter.SuccessCalls)[0]
146-
assert.Contains(t, successCall, "Stackpack packaged successfully!")
146+
assert.Contains(t, successCall, "Stackpack packaged successfully!")
147147
}
148148

149149
func TestStackpackPackageCommand_JSONOutput(t *testing.T) {
@@ -568,7 +568,7 @@ func TestStackpackPackageCommand_TextOutput(t *testing.T) {
568568
// Verify success message
569569
require.NotEmpty(t, *cli.MockPrinter.SuccessCalls)
570570
successCall := (*cli.MockPrinter.SuccessCalls)[0]
571-
assert.Contains(t, successCall, "Stackpack packaged successfully!")
571+
assert.Contains(t, successCall, "Stackpack packaged successfully!")
572572

573573
// Verify stackpack info is printed
574574
printLnCalls := *cli.MockPrinter.PrintLnCalls

cmd/stackpack/stackpack_scaffold.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func RunStackpackScaffoldCommand(args *ScaffoldArgs) func(cli *di.Deps, cmd *cob
155155
})
156156
} else {
157157
// Display success message and next steps
158-
cli.Printer.Successf("Scaffold complete!")
158+
cli.Printer.Successf("Scaffold complete!")
159159
cli.Printer.PrintLn("")
160160
displayNextSteps(cli, args)
161161
}

cmd/stackpack/stackpack_test_cmd.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func RunStackpackTestCommand(args *TestArgs) di.CmdWithApiFn {
160160
if err := copyDirectory(args.StackpackDir, tempStackpackDir); err != nil {
161161
return common.NewRuntimeError(fmt.Errorf("failed to copy stackpack to temporary directory: %w", err))
162162
}
163-
cli.Printer.Success("Temporary copy created")
163+
cli.Printer.Success("Temporary copy created")
164164

165165
// Step 3: Update version in temporary copy
166166
cli.Printer.PrintLn("")
@@ -171,7 +171,7 @@ func RunStackpackTestCommand(args *TestArgs) di.CmdWithApiFn {
171171
if err != nil {
172172
return common.NewRuntimeError(fmt.Errorf("failed to bump version: %w", err))
173173
}
174-
cli.Printer.Success(fmt.Sprintf("Version bumped to: %s", newVersion))
174+
cli.Printer.Success(fmt.Sprintf("Version bumped to: %s", newVersion))
175175

176176
// Step 4: Package stackpack from temporary directory
177177
cli.Printer.PrintLn("")
@@ -188,7 +188,7 @@ func RunStackpackTestCommand(args *TestArgs) di.CmdWithApiFn {
188188
if err := runPackageStep(cli, packageArgs); err != nil {
189189
return err
190190
}
191-
cli.Printer.Success("Stackpack packaged successfully")
191+
cli.Printer.Success("Stackpack packaged successfully")
192192

193193
// Step 5: Confirm upload (if needed) and execute upload/install workflow
194194
if !args.Yes {
@@ -208,7 +208,7 @@ func RunStackpackTestCommand(args *TestArgs) di.CmdWithApiFn {
208208
if err := runUploadStep(cli, api, serverInfo, uploadArgs); err != nil {
209209
return err
210210
}
211-
cli.Printer.Success("Stackpack uploaded successfully")
211+
cli.Printer.Success("Stackpack uploaded successfully")
212212

213213
// Install or upgrade stackpack based on installation status
214214
if installedVersion != "" {
@@ -222,7 +222,7 @@ func RunStackpackTestCommand(args *TestArgs) di.CmdWithApiFn {
222222
if err := runUpgradeStep(cli, api, serverInfo, upgradeArgs); err != nil {
223223
return err
224224
}
225-
cli.Printer.Success("Stackpack upgraded successfully")
225+
cli.Printer.Success("Stackpack upgraded successfully")
226226
} else {
227227
installArgs := &InstallArgs{
228228
Name: originalInfo.Name,
@@ -235,7 +235,7 @@ func RunStackpackTestCommand(args *TestArgs) di.CmdWithApiFn {
235235
if err := runInstallStep(cli, api, serverInfo, installArgs); err != nil {
236236
return err
237237
}
238-
cli.Printer.Success("Stackpack installed successfully")
238+
cli.Printer.Success("Stackpack installed successfully")
239239
}
240240

241241
cli.Printer.PrintLn("")

0 commit comments

Comments
 (0)