From b26961d466e7872d1a30e7de76f4908ac8ac1cbd Mon Sep 17 00:00:00 2001 From: Jesse Jordan Date: Tue, 1 Feb 2022 16:41:18 +0100 Subject: [PATCH] upd(repair): improve command output --- cmd/meroxa/root/environments/repair.go | 8 ++++---- cmd/meroxa/root/environments/repair_test.go | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/meroxa/root/environments/repair.go b/cmd/meroxa/root/environments/repair.go index d6050d412..58ec59a20 100644 --- a/cmd/meroxa/root/environments/repair.go +++ b/cmd/meroxa/root/environments/repair.go @@ -54,7 +54,7 @@ func (r *Repair) Usage() string { func (r *Repair) Docs() builder.Docs { return builder.Docs{ Short: "Repair environment", - Long: "Repair any environment that is in one of the following states: provisioning_error, deprovisioning_error, repairing_error.", + Long: `Repair any environment that is in one of the following states: provisioning_error, deprovisioning_error, repairing_error.`, } } @@ -74,13 +74,13 @@ func (r *Repair) ParseArgs(args []string) error { } func (r *Repair) Execute(ctx context.Context) error { - rr, err := r.client.PerformActionOnEnvironment(ctx, r.args.NameOrUUID, &meroxa.RepairEnvironmentInput{Action: "repair"}) /* OPENQ: How do I pass a struct here? */ + rr, err := r.client.PerformActionOnEnvironment(ctx, r.args.NameOrUUID, &meroxa.RepairEnvironmentInput{Action: "repair"}) if err != nil { return err } - r.logger.Infof(ctx, "The repairment of your environment %q is now in progress. Run `meroxa env describe %s` for status", r.args.NameOrUUID) - r.logger.Info(ctx, "Meroxa will try to resolve the error and your environment should be up and running soon.") + r.logger.Infof(ctx, `The repairment of your environment %q is now in progress and your environment will be up and running soon.`, r.args.NameOrUUID) // nolint:lll + r.logger.Infof(ctx, `Run "meroxa env describe %s" for status.`, r.args.NameOrUUID) r.logger.JSON(ctx, rr) return nil diff --git a/cmd/meroxa/root/environments/repair_test.go b/cmd/meroxa/root/environments/repair_test.go index 31457a546..878c0d4c8 100644 --- a/cmd/meroxa/root/environments/repair_test.go +++ b/cmd/meroxa/root/environments/repair_test.go @@ -85,7 +85,8 @@ func TestRepairEnvironmentExecution(t *testing.T) { gotLeveledOutput := logger.LeveledOutput() wantLeveledOutput := fmt.Sprintf( - "Repairing environment...\nThe repairment of your environment %q is now in progress. Run `meroxa env describe %s` for status", + `The repairment of your environment %q is now in progress and your environment will be up and running soon. +Run "meroxa env describe %s" for status.`, e.Name, e.Name)