rainforestapp / fourchette

DEPRECATED - Your new best friend for isolated testing environments on Heroku.
MIT License
194 stars 23 forks source link

It seems that the RACK_ENV and similar are not copied over #15

Closed jipiboily closed 10 years ago

jipiboily commented 10 years ago

We have some (all?) of our forks as production environment while they should be qa.

jipiboily commented 10 years ago

Thought about this last night (yeah, young baby makes that happen) and it might be a timing issue, i.e.: we create the Heroku app, then copy env vars, but maybe it is still provisioning stuff on Heroku's side and they overwrite it in the process?

edit: This needs confirmation, then we could get in touch with the fine folks @ Heroku and see if it's a feature or a bug for them, and act according to their vision.

jipiboily commented 10 years ago

Seems to be a thing, in the end...just have a dummy project with Sinatra and I was able to "reproduce" that. Creating a PR, the RACK_ENV was "qa" for a while, then I reloaded a little while ago, and it looks like it was overwritten...by something, which is unlikely to be due to Fourchette...

@markpundsack any idea of where I should report that?

markpundsack commented 10 years ago

What's the output of heroku releases say?

The buildpack may be doing it but I thought that only happened on first push and if it wasn't already set.

jipiboily commented 10 years ago

Wow, that was fast. Faster than me walking from Bloodhound to Brannan St...anyways, here is the build log:

-----> Ruby app detected
-----> Compiling Ruby/Rack
-----> Using Ruby version: ruby-2.1.2
-----> Installing dependencies using 1.6.3
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
       Fetching gem metadata from http://rubygems.org/..........
       Fetching additional metadata from http://rubygems.org/..
       Using bundler 1.6.3
       Installing tilt 1.4.1
       Installing rack 1.5.2
       Installing rack-protection 1.5.3
       Installing sinatra 1.4.5
       Your bundle is complete!
       Gems in the groups development and test were not installed.
       It was installed into ./vendor/bundle
       Bundle completed (4.61s)
       Cleaning up the bundler cache.
-----> Discovering process types
       Procfile declares types -> web
       Default types for Ruby  -> console, rake

-----> Compressing... done, 13.0MB
-----> Launching... done, v15
       http://fourchette-pr-2.herokuapp.com/ deployed to Heroku

Not much there as far as I am aware. That could totally be in the buildpack...

jipiboily commented 10 years ago

Here is where it's set in the Ruby buildpack: https://github.com/heroku/heroku-buildpack-ruby/blob/master/lib/language_pack/rack.rb#L22

Not sure yet how helpful that is for me or anyone else though...

markpundsack commented 10 years ago

Yeah, that sets the "default" config vars, but my understanding was that it wouldn't overwrite existing ones.

If you run heroku releases -a fourchette-pr-2 you can see where config vars are changing. Fourchette sets them manually early on, and then right before the "deploy" release, there's another release that overrides LANG and RACK_ENV. That seems to be coming from the buildpack. I'm asking the team now if that's intended behavior.

markpundsack commented 10 years ago

Worst case you could do a post-deploy override again, but that seems like it should be unnecessary.

jipiboily commented 10 years ago

It feels like it should not happen, but I think a work around is the best/easiest/fastest way for me to get that fixed.

It would be great if you could tell me if it's on purpose, once you know. In the meantime I'll just setup a workaround soon-ish.

Thanks!

markpundsack commented 10 years ago

It doesn't seem like it's on purpose. I think you should log an issue on the ruby buildpack with steps to reproduce and output from heroku releases showing the override.

But yeah, adding a post-fork hook to set the config var one more time might be your workaround.

On Jun 17, 2014, at 6:54 PM, Jean-Philippe Boily notifications@github.com wrote:

It feels like it should not happen, but I think a work around is the best/easiest/fastest way for me to get that fixed.

It would be great if you could tell me if it's on purpose, once you know. In the meantime I'll just setup a workaround soon-ish.

Thanks!

— Reply to this email directly or view it on GitHub.

jipiboily commented 10 years ago

After a stab at it, I realized it's really after the build, so I'll have to take a closer look at that later, as right now Fourchette is not waiting for the build to end...

jipiboily commented 10 years ago

I was able to get it reproduced and there is now an opened issue on Heroku's buildpack: https://github.com/heroku/heroku-buildpack-ruby/issues/277. Let's wait and see a bit. We have a workaround for us in place...super hacky though!

jipiboily commented 10 years ago

Fixed on Heroku's side -> https://github.com/heroku/heroku-buildpack-ruby/pull/279.