From c0c0455df60896ba225d3c2f9ae929b38eb8a41f 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 | 5 ++--- pkg/cmd/pulumi/about.go | 32 +++++++++++++++----------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/pkg/backend/filestate/backend.go b/pkg/backend/filestate/backend.go index f020f8288509..37e5283c0b89 100644 --- a/pkg/backend/filestate/backend.go +++ b/pkg/backend/filestate/backend.go @@ -99,9 +99,8 @@ func (r localBackendReference) Name() tokens.Name { return r.name } -func (c localBackendReference) FullyQualifiedName() tokens.Name { - // TODO[pulumi/pulumi#11390]: Unable to provide this value until we solve this issue. - return tokens.Name("") +func (r localBackendReference) FullyQualifiedName() tokens.Name { + return r.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 {