Skip to content

Commit

Permalink
Changes to stack_graph.go file and envrc file
Browse files Browse the repository at this point in the history
  • Loading branch information
krupaJari authored and AaronFriel committed Dec 13, 2022
1 parent 94ef784 commit 829cae4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
@@ -0,0 +1,4 @@
changes:
- type: feat
scope: cli
description: Adds a flag that allows user to set the node label as the resource name instead of full URN in the stack graph
8 changes: 8 additions & 0 deletions pkg/cmd/pulumi/stack_graph.go
Expand Up @@ -40,6 +40,9 @@ var dependencyEdgeColor string
// The color of parent edges in the graph. Defaults to #AA6639, an orange.
var parentEdgeColor string

// Whether or not to return resource name as the node label for each node of the graph.
var shortNodeName bool

func newStackGraphCmd() *cobra.Command {
var stackName string

Expand Down Expand Up @@ -98,6 +101,8 @@ func newStackGraphCmd() *cobra.Command {
"Sets the color of dependency edges in the graph")
cmd.PersistentFlags().StringVar(&parentEdgeColor, "parent-edge-color", "#AA6639",
"Sets the color of parent edges in the graph")
cmd.PersistentFlags().BoolVar(&shortNodeName, "short-node-name", false,
"Sets the resource name as the node label for each node of the graph")
return cmd
}

Expand Down Expand Up @@ -178,6 +183,9 @@ func (vertex *dependencyVertex) Data() interface{} {
}

func (vertex *dependencyVertex) Label() string {
if shortNodeName {
return string(vertex.resource.URN.Name())
}
return string(vertex.resource.URN)
}

Expand Down

0 comments on commit 829cae4

Please sign in to comment.