heroku / heroku/cli

heroku ps:wait supporting failing startup of application

Open
#1,732 1 comment 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
889
Forks
236
Avg merge
2d 10h
Merged PRs (30d)
33

Description

Do you want to request a *feature* or report a *bug*?
-----------------------------------------------------
Feature

What is the current behavior?
-----------------------------
[https://github.com/heroku/cli/blob/master/packages/ps/src/commands/ps/wait.ts](https://github.com/heroku/cli/blob/master/packages/ps/src/commands/ps/wait.ts)

`heroku ps:wait` is made to wait for a deployment to be up and running. A literal quote from the code:

```
static description = 'wait for all dynos to be running latest version after a release'
```

I tested it with a successful deployment and it exited the process with `status 0` as soon as my dyno was in the state up. So far so good.

But now I wanted to test a failing startup of the application I was deploying. So introduced a bug so the app did not want to start. To my surprise it was in an infinite loop. The state of the of the dyno was changed from `starting` to `crashed`. And Heroku tried another time. So `crashed` became `starting` and it failed again so now `crashed` was the final state of this version of the application. And the `heroku ps:wait` process was still running.

What is the expected behavior?
------------------------------
I expect the `heroku ps:wait` command to exit the process with an error status if the app it is waiting for becomes in the state `crashed`. Also a timeout as parameter would be great (with a default of 60 seconds or some sorts).

This is very useful for automated deployment. After deploying an app it should be possible to find out with the Heroku CLI to know whether the startup of the app succeeded.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.