6

I have a Heroku app that has review apps enabled. The review apps are configured based on the app.json file in the root directory of my application. I'm able to add addons but I don't seem to be able to enable the runtime-dyno-metadata labs feature. Below is just one of the many ways I've tried to get this working...

{
  "name": "Foo",
  "scripts": {
    "postdeploy": "bundle exec rake db:migrate db:seed"
  },
  "formation": {
    "worker": {
      "quantity": 1
    },
    "web": {
      "quantity": 1
    }
  },
  "addons": [
    "heroku-postgresql",
    "heroku-redis",
  ],
  "labs": [
    "runtime-dyno-metadata"
  ],
  "buildpacks": [
    {
      "url": "https://github.com/heroku/heroku-buildpack-nodejs.git"
    },
    {
      "url": "https://github.com/heroku/heroku-buildpack-ruby.git"
    }
  ]
}
blim8183
  • 768
  • 1
  • 8
  • 23

2 Answers2

5

Adding lab features in app.json isn't supported.

Damien MATHIEU
  • 31,924
  • 13
  • 86
  • 94
3

You can add labs to a review app using the Heroku API. With ruby, you could do something like this:

require 'platform-api'

heroku = PlatformAPI.connect_oauth(ENV['HEROKU_API_KEY'])

# Add any other features you care about
LABS_FEATURES = %w[runtime-dyno-metadata].freeze

LABS_FEATURES.each do |feature|
  heroku.app_feature.update(ENV.fetch('HEROKU_APP_NAME'), feature, enabled: true)
end

Note that at least some labs require a re-deploy before the lab feature is actually active, so you have to think about where you invoke this (e.g. a rake task invoked in release-phase or during the postdeploy command in app.json)

rubendinho
  • 86
  • 3