cloudfoundry / cli

The official command line client for Cloud Foundry
https://docs.cloudfoundry.org/cf-cli
Apache License 2.0
1.75k stars 927 forks source link

`cf app` & `cf push` output should indicate origin of command being used by the app #1446

Open dmikusa opened 6 years ago

dmikusa commented 6 years ago

Command

cf push my-app or cf app

What occurred

When you cf push or run cf app, there is no way to tell if the command that's being used was from the buildpack or something that has been set by a user.

Consider the following scenario:

  1. I'm developing my app and I use a custom command. This output is good. I see that my command has changed, which is expected because I changed it.
$ cf push -c '$HOME/.bp/bin/start && echo "Cool :)"'
Pushing from manifest to org dmikusa / space development as dmikusa@gopivotal.com...
Using manifest file /Users/dmikusa/Code/PHP/php-info/manifest.yml
Getting app info...
Updating app with these attributes...
  name:                php-info
  path:                /Users/dmikusa/Code/PHP/php-info
  buildpack:           php_buildpack
- command:             $HOME/.bp/bin/start
+ command:             $HOME/.bp/bin/start && echo "Cool :)"
  disk quota:          1G
  health check type:   port
  instances:           1
  memory:              64M
  stack:               cflinuxfs2
  routes:
    php-info.cfapps.io

2.) I or someone else on my team pushes. They do not set a custom command.

$ cf push
Pushing from manifest to org dmikusa / space development as dmikusa@gopivotal.com...
Using manifest file /Users/dmikusa/Code/PHP/php-info/manifest.yml
Getting app info...
Updating app with these attributes...
  name:                php-info
  path:                /Users/dmikusa/Code/PHP/php-info
  buildpack:           php_buildpack
  command:             $HOME/.bp/bin/start && echo "Cool :)"
  disk quota:          1G
  health check type:   port
  instances:           1
  memory:              64M
  stack:               cflinuxfs2
  routes:
    php-info.cfapps.io

Maybe I remember I previously set a custom command, maybe I don't. I forget a lot of things, so there's a good chance I'll forget this. My colleague is definitely not going to be aware. In this example, it's somewhat obvious that the command is not from the buildpack, but in practice it would be way more subtle. Maybe there's just an arg added or something that's slightly different. Maybe I even copy and pasted the same command for some reason & it works OK for a while, but later when the buildpack changes it's start command my command does not get updated and my app could mysteriously break.

What you expected to occur

It would be nice if there was some indication as to who configured the command: maybe instead of listing just command: ... it could say buildpack command: or detected command: vs custom command: in the output of cf app <name> and cf push.

CLI Version

cf version 6.37.0+a40009753.2018-08-08

CC API Endpoint Version

2.120.0

CF Trace

N/A

Platform & Shell Details

N/A

Any other relevant information

N/A

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/160001779

The labels on this github issue will be updated when the story is started.