diff --git a/pkg/backend/backend.go b/pkg/backend/backend.go index de5c154fb4e6..ce2c82957e66 100644 --- a/pkg/backend/backend.go +++ b/pkg/backend/backend.go @@ -75,6 +75,9 @@ type StackReference interface { // name may not uniquely identify the stack (e.g. the cloud backend embeds owner information in the StackReference // but that information is not part of the StackName() we pass to the engine. Name() tokens.Name + + // Fully qualified name is the name + FullyQualifiedName() tokens.Name } // PolicyPackReference is an opaque type that refers to a PolicyPack managed by a backend. The CLI diff --git a/pkg/backend/filestate/backend.go b/pkg/backend/filestate/backend.go index 22d0f01652f1..f020f8288509 100644 --- a/pkg/backend/filestate/backend.go +++ b/pkg/backend/filestate/backend.go @@ -99,6 +99,11 @@ 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 IsFileStateBackendURL(urlstr string) bool { u, err := url.Parse(urlstr) if err != nil { diff --git a/pkg/backend/httpstate/stack.go b/pkg/backend/httpstate/stack.go index f9b97318dc20..0743f00caa16 100644 --- a/pkg/backend/httpstate/stack.go +++ b/pkg/backend/httpstate/stack.go @@ -74,6 +74,10 @@ func (c cloudBackendReference) Name() tokens.Name { return c.name } +func (c cloudBackendReference) FullyQualifiedName() tokens.Name { + return tokens.Name(fmt.Sprintf("%v/%v/%v", c.owner, c.project, c.name.String())) +} + // cloudStack is a cloud stack descriptor. type cloudStack struct { // ref is the stack's unique name. diff --git a/pkg/cmd/pulumi/about.go b/pkg/cmd/pulumi/about.go index deb94b173588..c999a90057f0 100644 --- a/pkg/cmd/pulumi/about.go +++ b/pkg/cmd/pulumi/about.go @@ -86,16 +86,17 @@ 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"` - 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"` + StackReference string `json:"stackReference"` + Errors []error `json:"-"` + LogMessage string `json:"-"` } func getSummaryAbout(ctx context.Context, transitiveDependencies bool, selectedStack string) summaryAbout { @@ -188,6 +189,7 @@ func getSummaryAbout(ctx context.Context, transitiveDependencies bool, selectedS tmp := getBackendAbout(backend) result.Backend = &tmp } + return result } @@ -330,9 +332,10 @@ func (b backendAbout) String() string { } type currentStackAbout struct { - Name string `json:"name"` - Resources []aboutState `json:"resources"` - PendingOps []aboutState `json:"pendingOps"` + Name string `json:"name"` + FullyQualifiedName string `json:"fullyQualifiedName"` + Resources []aboutState `json:"resources"` + PendingOps []aboutState `json:"pendingOps"` } type aboutState struct { @@ -386,9 +389,10 @@ func getCurrentStackAbout(ctx context.Context, b backend.Backend, selectedStack } } return currentStackAbout{ - Name: name, - Resources: aboutResources, - PendingOps: aboutPending, + Name: name, + FullyQualifiedName: stack.Ref().FullyQualifiedName().String(), + Resources: aboutResources, + PendingOps: aboutPending, }, nil } @@ -423,7 +427,12 @@ func (current currentStackAbout) String() string { Rows: rows, }.String() + "\n" } - return fmt.Sprintf("Current Stack: %s\n\n%s\n%s", current.Name, resources, pending) + return fmt.Sprintf(`Current Stack: %s + +Fully qualified stack name: %s + +%s +%s`, current.Name, current.FullyQualifiedName, resources, pending) } func simpleTableRows(arr [][]string) []cmdutil.TableRow {