{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/3359","labels_url":"https://api.github.com/repos/openshift/origin/issues/3359/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/3359/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/3359/events","html_url":"https://github.com/openshift/origin/issues/3359","id":89846587,"number":3359,"title":"`oc build-logs` should print a list of recent builds if you don't pass an argument","user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openshift/origin/labels/area/usability","name":"area/usability","color":"006b75"},{"url":"https://api.github.com/repos/openshift/origin/labels/component/build","name":"component/build","color":"0052cc"},{"url":"https://api.github.com/repos/openshift/origin/labels/component/cli","name":"component/cli","color":"0052cc"},{"url":"https://api.github.com/repos/openshift/origin/labels/kind/enhancement","name":"kind/enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/openshift/origin/labels/priority/P2","name":"priority/P2","color":"fbca04"}],"state":"closed","locked":false,"assignee":{"login":"rhcarvalho","id":88819,"avatar_url":"https://avatars.githubusercontent.com/u/88819?v=3","gravatar_id":"","url":"https://api.github.com/users/rhcarvalho","html_url":"https://github.com/rhcarvalho","followers_url":"https://api.github.com/users/rhcarvalho/followers","following_url":"https://api.github.com/users/rhcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rhcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcarvalho/subscriptions","organizations_url":"https://api.github.com/users/rhcarvalho/orgs","repos_url":"https://api.github.com/users/rhcarvalho/repos","events_url":"https://api.github.com/users/rhcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rhcarvalho/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2015-06-21T01:42:36Z","updated_at":"2015-08-05T15:00:00Z","closed_at":"2015-07-31T18:49:29Z","body":"A user who sees `oc build-logs` in the help may get there before understanding how to list builds - if the user omits the build log we should print a list in the error of existing builds (a reasonable number) if we can.\r\n\r\nToday:\r\n\r\n```\r\n$ oc build-logs\r\nerror: A build name is required\r\nsee 'oc build-logs -h' for help.\r\n```\r\n\r\nBetter:\r\n\r\n```\r\n$ oc build-logs\r\nerror: A build name is required. Recent builds:\r\n* other-build-2  Running  1 min ago\r\n* ruby-build-1   Failed   5 min ago\r\n```\r\n\r\nIf the call to get the build names fails we should simply print the current error (not an error about being unable to find builds).  We shouldn't wait for longer than a few hundred milliseconds either before returning.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/128026774","html_url":"https://github.com/openshift/origin/issues/3359#issuecomment-128026774","issue_url":"https://api.github.com/repos/openshift/origin/issues/3359","id":128026774,"user":{"login":"bparees","id":4974046,"avatar_url":"https://avatars.githubusercontent.com/u/4974046?v=3","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T15:00:00Z","updated_at":"2015-08-05T15:00:00Z","body":"> oc build-logs --loglevel=1 to disable a timeout feels esoteric to me\r\n\r\nthat was by design.  I didn't/don't anticipate it being something most people would want to do.  if it's taking more than 800ms to get back results, are you going to set a flag so you can wait even longer?  the only reason to set that flag in my mind is if you're going to debug why it's taking so long.\r\n\r\n> What we've done in that case then is we made oc build-logs fail with the message \"error: A build name > is required\" in ~830ms instead of ~150ms, what we had before.\r\n\r\ni'd love to know why it's 800ms in their environment.  that means pretty much any other command should be taking a long time too.  do they just have a huge number of builds?  is there something else going on here?  are we making multiple calls?\r\n\r\n>  Alternatively, why not simply, and with no variable delay just show how to list builds?\r\n\r\nsure, we could ultimately fall back to this solution, but let's dig into this a little more before we give up.  \r\n\r\n> After some experimentation locally, I'm tempted to propose not fetching the list of builds, but just showing how to do it.\r\n\r\nwhat did you see in your local experimentation that lead you to this conclusion?  is it always very slow?\r\n\r\n> Either that or change oc build-logs semantics (and document it) so that calling it with no arguments is equivalent to oc get builds (documented feature instead of an error condition). I'm not a fan of this option myself.\r\n\r\nyeah i don't like that either.  and i'm not clear how it would be any better...  it's still going to take a long time to return.\r\n\r\n\r\n"}}