Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the CLI output component-aware #417

Closed
joeduffy opened this issue Oct 16, 2017 · 1 comment
Closed

Make the CLI output component-aware #417

joeduffy opened this issue Oct 16, 2017 · 1 comment
Assignees
Labels
area/cli UX of using the CLI (args, output, logs) impact/usability Something that impacts users' ability to use the product easily and intuitively kind/enhancement Improvements or new features
Milestone

Comments

@joeduffy
Copy link
Member

Now that we have ComponentResources, we have an opportunity to significantly clean up the CLI UX. This will help with attribution --

Q: "Why did this random AWS IAM permission get allocated?"
A: "It's part of that serverless pulumi.Topic subscription over there!"

-- in addition to things like parenting children in the display and even hiding some by default:

$ pulumi up
+ cloud:timer:Timer
    [urn:pulumi:demo::timers::cloud:timer:Timer::hourly]
    scheduleExpression: "cron(45 * * * ? *)"
    // in the SaaS/PaaS product, these children are hidden;
    // otherwise, they show up as parented in an obvious way:
    => urn:pulumi:demo::timers::cloud:function:Function::test-hourly
        // by default, just show progress as this resource is created:
        ..........🚣 
        // if --detailed is passed, resource details actually show up underneath this one:
        options: {
            policies: [
                [0]: "arn:aws:iam::aws:policy/AWSLambdaFullAccess"
            ]
        }
        => urn:pulumi:demo::timers::aws:iam/role:Role::pulumi-app-log-collector-iamrole
        => urn:pulumi:demo::timers::aws:iam/rolePolicyAttachment:RolePolicyAttachment::pulumi-app-log-collector-iampolicy-0
        => urn:pulumi:demo::timers::aws:lambda/function:Function::pulumi-app-log-collector
    => urn:pulumi:demo::timers::aws:cloudwatch/eventRule:EventRule::test-hourly
    => urn:pulumi:demo::timers::aws:cloudwatch/eventTarget:EventTarget::test-hourly
    => urn:pulumi:demo::timers::aws:lambda/permission:Permission::test-hourly
@joeduffy joeduffy added area/cli UX of using the CLI (args, output, logs) impact/usability Something that impacts users' ability to use the product easily and intuitively kind/enhancement Improvements or new features labels Oct 16, 2017
@joeduffy joeduffy added this to the 0.9 milestone Oct 16, 2017
@ellismg ellismg assigned joeduffy and unassigned ellismg Nov 14, 2017
joeduffy added a commit that referenced this issue Nov 17, 2017
This change switches from child lists to parent pointers, in the
way resource ancestries are represented.  This cleans up a fair bit
of the old parenting logic, including all notion of ambient parent
scopes (and will notably address #435).

This lets us show a more parent/child display in the output when
doing planning and updating.  For instance, here is an update of
a lambda's text, which is logically part of a cloud timer:

    * cloud:timer:Timer: (same)
          [urn=urn:pulumi:malta::lm-cloud::cloud:timer:Timer::lm-cts-malta-job-CleanSnapshots]
        * cloud:function:Function: (same)
              [urn=urn:pulumi:malta::lm-cloud::cloud:function:Function::lm-cts-malta-job-CleanSnapshots]
            * aws:serverless:Function: (same)
                  [urn=urn:pulumi:malta::lm-cloud::aws:serverless:Function::lm-cts-malta-job-CleanSnapshots]
                ~ aws:lambda/function:Function: (modify)
                      [id=lm-cts-malta-job-CleanSnapshots-fee4f3bf41280741]
                      [urn=urn:pulumi:malta::lm-cloud::aws:lambda/function:Function::lm-cts-malta-job-CleanSnapshots]
                    - code            : archive(assets:2092f44) {
                        // etc etc etc

Note that we still get walls of text, but this will be actually
quite nice when combined with #454.

I've also suppressed printing properties that didn't change during
updates when --detailed was not passed, and also suppressed empty
strings and zero-length arrays (since TF uses these as defaults in
many places and it just makes creation and deletion quite verbose).

Note that this is a far cry from everything we can possibly do
here as part of #340 (and even #417).
But it's a good start towards taming some of our output spew.
joeduffy added a commit that referenced this issue Nov 17, 2017
This change switches from child lists to parent pointers, in the
way resource ancestries are represented.  This cleans up a fair bit
of the old parenting logic, including all notion of ambient parent
scopes (and will notably address #435).

This lets us show a more parent/child display in the output when
doing planning and updating.  For instance, here is an update of
a lambda's text, which is logically part of a cloud timer:

    * cloud:timer:Timer: (same)
          [urn=urn:pulumi:malta::lm-cloud::cloud:timer:Timer::lm-cts-malta-job-CleanSnapshots]
        * cloud:function:Function: (same)
              [urn=urn:pulumi:malta::lm-cloud::cloud:function:Function::lm-cts-malta-job-CleanSnapshots]
            * aws:serverless:Function: (same)
                  [urn=urn:pulumi:malta::lm-cloud::aws:serverless:Function::lm-cts-malta-job-CleanSnapshots]
                ~ aws:lambda/function:Function: (modify)
                      [id=lm-cts-malta-job-CleanSnapshots-fee4f3bf41280741]
                      [urn=urn:pulumi:malta::lm-cloud::aws:lambda/function:Function::lm-cts-malta-job-CleanSnapshots]
                    - code            : archive(assets:2092f44) {
                        // etc etc etc

Note that we still get walls of text, but this will be actually
quite nice when combined with #454.

I've also suppressed printing properties that didn't change during
updates when --detailed was not passed, and also suppressed empty
strings and zero-length arrays (since TF uses these as defaults in
many places and it just makes creation and deletion quite verbose).

Note that this is a far cry from everything we can possibly do
here as part of #340 (and even #417).
But it's a good start towards taming some of our output spew.
joeduffy added a commit that referenced this issue Nov 20, 2017
This change switches from child lists to parent pointers, in the
way resource ancestries are represented.  This cleans up a fair bit
of the old parenting logic, including all notion of ambient parent
scopes (and will notably address #435).

This lets us show a more parent/child display in the output when
doing planning and updating.  For instance, here is an update of
a lambda's text, which is logically part of a cloud timer:

    * cloud:timer:Timer: (same)
          [urn=urn:pulumi:malta::lm-cloud::cloud:timer:Timer::lm-cts-malta-job-CleanSnapshots]
        * cloud:function:Function: (same)
              [urn=urn:pulumi:malta::lm-cloud::cloud:function:Function::lm-cts-malta-job-CleanSnapshots]
            * aws:serverless:Function: (same)
                  [urn=urn:pulumi:malta::lm-cloud::aws:serverless:Function::lm-cts-malta-job-CleanSnapshots]
                ~ aws:lambda/function:Function: (modify)
                      [id=lm-cts-malta-job-CleanSnapshots-fee4f3bf41280741]
                      [urn=urn:pulumi:malta::lm-cloud::aws:lambda/function:Function::lm-cts-malta-job-CleanSnapshots]
                    - code            : archive(assets:2092f44) {
                        // etc etc etc

Note that we still get walls of text, but this will be actually
quite nice when combined with #454.

I've also suppressed printing properties that didn't change during
updates when --detailed was not passed, and also suppressed empty
strings and zero-length arrays (since TF uses these as defaults in
many places and it just makes creation and deletion quite verbose).

Note that this is a far cry from everything we can possibly do
here as part of #340 (and even #417).
But it's a good start towards taming some of our output spew.
joeduffy added a commit that referenced this issue Nov 26, 2017
This change switches from child lists to parent pointers, in the
way resource ancestries are represented.  This cleans up a fair bit
of the old parenting logic, including all notion of ambient parent
scopes (and will notably address #435).

This lets us show a more parent/child display in the output when
doing planning and updating.  For instance, here is an update of
a lambda's text, which is logically part of a cloud timer:

    * cloud:timer:Timer: (same)
          [urn=urn:pulumi:malta::lm-cloud::cloud:timer:Timer::lm-cts-malta-job-CleanSnapshots]
        * cloud:function:Function: (same)
              [urn=urn:pulumi:malta::lm-cloud::cloud:function:Function::lm-cts-malta-job-CleanSnapshots]
            * aws:serverless:Function: (same)
                  [urn=urn:pulumi:malta::lm-cloud::aws:serverless:Function::lm-cts-malta-job-CleanSnapshots]
                ~ aws:lambda/function:Function: (modify)
                      [id=lm-cts-malta-job-CleanSnapshots-fee4f3bf41280741]
                      [urn=urn:pulumi:malta::lm-cloud::aws:lambda/function:Function::lm-cts-malta-job-CleanSnapshots]
                    - code            : archive(assets:2092f44) {
                        // etc etc etc

Note that we still get walls of text, but this will be actually
quite nice when combined with #454.

I've also suppressed printing properties that didn't change during
updates when --detailed was not passed, and also suppressed empty
strings and zero-length arrays (since TF uses these as defaults in
many places and it just makes creation and deletion quite verbose).

Note that this is a far cry from everything we can possibly do
here as part of #340 (and even #417).
But it's a good start towards taming some of our output spew.
@joeduffy
Copy link
Member Author

There is more we can do here, but the overall work here is fixed by 6788a49.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli UX of using the CLI (args, output, logs) impact/usability Something that impacts users' ability to use the product easily and intuitively kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

3 participants