Review Apps
Review apps
Heroku provides us the ability to use review apps. Basically, a review app is linked to a specific development which has its own branch.
Review Apps are mostly used to test a feature in an hosted environment, without having the need to put the code on staging.
How are they created?
When you create a new PR, a new review app will be automatically available for creation. This means that they are not automatically created though, so if you need one for your PR, you’ll need to manually create it in Heroku.

Notice that if a PR is opened for Staging, a review app will be available for it. You should not need to create one for Staging though, as Staging it already an app on its own.
How are they deployed?
The deployment of already created review apps is automatic. Every time you push to your branch, if a review app already exists, it will trigger a new build/deploy on Heroku.
How are they killed?
After 5 days without any new push (you can still re-create it if need be)
Manually when you don’t need it anymore (go to the Settings section, scroll down and you’ll see a “Delete Application” button). Be careful with this one, make sure you’re not deleting the production application.
Ok, but concretely…
Concretely, all the magic happens thanks to this file: app.json
This is the config file in our app that tells Heroku how to build new review apps, and when to build them. If you want to know more, I strongly recommend you to check the docs:
What about environment variables?
As you saw in the previous section, all env variables are located in the “Settings” section of each app. If you need to add a new env variable for your review app, this is where you should go.
Should you really though?
Let’s think of an example:
1️⃣ You’ve developed a new feature that uses the Google Maps API, thus needs a new env variable called GOOGLE_MAPS_API_KEY. You add it to your locale .env & in the settings of your Review App and it works perfectly on both apps. You could stop there…
2️⃣ Now, your PR is merged, everything is working great, sun is shining. You move on to a new feature, create a new branch and a new review app for it.
3️⃣ Only, to your surprise, you can see that the Google Maps feature is not working on this new review app!
4️⃣ This is because you added the .env variable to the previous review app, but every following ones won’t have it. This is very boring, as you don’t want to add the new variable every time you create a new review app.
To prevent having to repeat yourself every time, you have access to the “Pipeline Settings”.
It’s similar to any app settings section, and you can directly define env variables there.
Now, every review app you build will inherits from those variables, removing the need to repeat yourself.
ALSO, don’t forget to add this new env variable in staging & in prod!
Now, let’s have a deeper look at our staging application:
Last updated