From 1dbd84dbab0d2bbb79a696900af1559e060958d9 Mon Sep 17 00:00:00 2001 From: Ian Wahbe Date: Thu, 17 Nov 2022 17:23:46 -0800 Subject: [PATCH] Add FQN for filestate and simply output --- pkg/backend/filestate/backend.go | 3 +-- pkg/cmd/pulumi/about.go | 32 +++++++++++++++----------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/pkg/backend/filestate/backend.go b/pkg/backend/filestate/backend.go index f020f8288509..66fb79861cb8 100644 --- a/pkg/backend/filestate/backend.go +++ b/pkg/backend/filestate/backend.go @@ -100,8 +100,7 @@ func (r localBackendReference) Name() tokens.Name { } func (c localBackendReference) FullyQualifiedName() tokens.Name { - // TODO[pulumi/pulumi#11390]: Unable to provide this value until we solve this issue. - return tokens.Name("") + return c.name } func IsFileStateBackendURL(urlstr string) bool { diff --git a/pkg/cmd/pulumi/about.go b/pkg/cmd/pulumi/about.go index 2f2d4c222dc9..754be9509273 100644 --- a/pkg/cmd/pulumi/about.go +++ b/pkg/cmd/pulumi/about.go @@ -86,17 +86,16 @@ type summaryAbout struct { // We use pointers here to allow the field to be nullable. When // constructing, we either fill in a field or add an error. We still // indicate that the field should be present when we serialize the struct. - Plugins []pluginAbout `json:"plugins"` - Host *hostAbout `json:"host"` - Backend *backendAbout `json:"backend"` - CurrentStack *currentStackAbout `json:"currentStack"` - CLI *cliAbout `json:"cliAbout"` - Runtime *projectRuntimeAbout `json:"runtime"` - Dependencies []programDependencyAbout `json:"dependencies"` - ErrorMessages []string `json:"errors"` - StackReference string `json:"stackReference"` - Errors []error `json:"-"` - LogMessage string `json:"-"` + Plugins []pluginAbout `json:"plugins"` + Host *hostAbout `json:"host"` + Backend *backendAbout `json:"backend"` + CurrentStack *currentStackAbout `json:"currentStack"` + CLI *cliAbout `json:"cliAbout"` + Runtime *projectRuntimeAbout `json:"runtime"` + Dependencies []programDependencyAbout `json:"dependencies"` + ErrorMessages []string `json:"errors"` + Errors []error `json:"-"` + LogMessage string `json:"-"` } func getSummaryAbout(ctx context.Context, transitiveDependencies bool, selectedStack string) summaryAbout { @@ -427,12 +426,11 @@ func (current currentStackAbout) String() string { Rows: rows, }.String() + "\n" } - return fmt.Sprintf(`Current Stack: %s - -Fully qualified stack name: %s - -%s -%s`, current.Name, current.FullyQualifiedName, resources, pending) + stackName := current.Name + if stackName != current.FullyQualifiedName { + stackName += fmt.Sprintf(" (fully qualified to %q)", current.FullyQualifiedName) + } + return fmt.Sprintf("Current Stack: %s\n\n%s\n%s", stackName, resources, pending) } func simpleTableRows(arr [][]string) []cmdutil.TableRow {