{"action":"created","issue":{"url":"https://api.github.com/repos/thoughtbot/suspenders/issues/639","labels_url":"https://api.github.com/repos/thoughtbot/suspenders/issues/639/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/suspenders/issues/639/comments","events_url":"https://api.github.com/repos/thoughtbot/suspenders/issues/639/events","html_url":"https://github.com/thoughtbot/suspenders/pull/639","id":113098760,"number":639,"title":"Introduce Heroku Pipelines support","user":{"login":"zamith","id":166304,"avatar_url":"https://avatars.githubusercontent.com/u/166304?v=3","gravatar_id":"","url":"https://api.github.com/users/zamith","html_url":"https://github.com/zamith","followers_url":"https://api.github.com/users/zamith/followers","following_url":"https://api.github.com/users/zamith/following{/other_user}","gists_url":"https://api.github.com/users/zamith/gists{/gist_id}","starred_url":"https://api.github.com/users/zamith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zamith/subscriptions","organizations_url":"https://api.github.com/users/zamith/orgs","repos_url":"https://api.github.com/users/zamith/repos","events_url":"https://api.github.com/users/zamith/events{/privacy}","received_events_url":"https://api.github.com/users/zamith/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-10-23T20:55:23Z","updated_at":"2015-10-30T15:02:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/thoughtbot/suspenders/pulls/639","html_url":"https://github.com/thoughtbot/suspenders/pull/639","diff_url":"https://github.com/thoughtbot/suspenders/pull/639.diff","patch_url":"https://github.com/thoughtbot/suspenders/pull/639.patch"},"body":"Why:\r\n\r\n* We have observed that running acceptance through Heroku Pipelines is a\r\n  better flow for code reviews, by allowing to show work in progress\r\n  earlier, and fixing issue before merging into master\r\n\r\nThis change addresses the need by:\r\n\r\n* Creating a pipeline for the new app, and adding the staging and\r\n  production environments to it\r\n* Adding a required `app.json` configuration file\r\n* Setting `Rack::CanonicalHost` only in staging and production, and not\r\n  review apps (otherwise review apps redirect to staging)\r\n\r\nTo do:\r\n\r\n- [x] Should we continue to auto-deploy on CI? cc @calebthompson\r\n- [ ] Check if heroku pipelines plugin is installed\r\n```bash\r\nif heroku pipelines &> /dev/null; then\r\n  do_it\r\nelse\r\n  printf 'You need heroku pipelines plugin. Run: heroku plugins:install heroku-pipelines'\r\nfi\r\n```\r\n- [ ] Work around the fact that there are no after hooks after a review\r\n      app is created, and we need to set up the database at first manually.\r\n- [ ] Add instructions for hooking up the pipeline to GitHub in README, if necessary\r\n- [ ] Fix `APPLICATION_HOST`: https://github.com/thoughtbot/suspenders/pull/639#issuecomment-152546822. If we do, we don't need a conditional around `Rack::CanonicalHost`.\r\n- [ ] Emails are being sent with the staging URL, and so links don't work for review apps (related to previous point)"},"comment":{"url":"https://api.github.com/repos/thoughtbot/suspenders/issues/comments/152549279","html_url":"https://github.com/thoughtbot/suspenders/pull/639#issuecomment-152549279","issue_url":"https://api.github.com/repos/thoughtbot/suspenders/issues/639","id":152549279,"user":{"login":"calebthompson","id":711717,"avatar_url":"https://avatars.githubusercontent.com/u/711717?v=3","gravatar_id":"","url":"https://api.github.com/users/calebthompson","html_url":"https://github.com/calebthompson","followers_url":"https://api.github.com/users/calebthompson/followers","following_url":"https://api.github.com/users/calebthompson/following{/other_user}","gists_url":"https://api.github.com/users/calebthompson/gists{/gist_id}","starred_url":"https://api.github.com/users/calebthompson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calebthompson/subscriptions","organizations_url":"https://api.github.com/users/calebthompson/orgs","repos_url":"https://api.github.com/users/calebthompson/repos","events_url":"https://api.github.com/users/calebthompson/events{/privacy}","received_events_url":"https://api.github.com/users/calebthompson/received_events","type":"User","site_admin":false},"created_at":"2015-10-30T15:02:58Z","updated_at":"2015-10-30T15:02:58Z","body":"I think you've traded one problem variable for another.\r\n\r\nI noticed you've specified that all of the variables are required, but not set defaults. Most of these should either be defaulted or generated, I think. https://devcenter.heroku.com/articles/app-json-schema#env\r\n\r\nSince you're inheriting the variables from the downstream app, APPLICATION_HOST will be set to, for example, staging.upcase.com. This means that when you visit upcase-pr-42.herokuapp.com, the canonical host middleware will redirect you to staging.upcase.com.\r\n\r\nWhen rack canonical host is disabled, you'll still be using APPLICATION_HOST (staging.upcase.com) as the URL to base mailer links on, so your i.e., \"Confirm email address\" link will take you to the wrong application and you won't be able to confirm the email.\r\n\r\nThere may be other places it's used as well."}}