Skip to content

Commit

Permalink
Merge pull request #809 from heroku/schneems/heroku-18-bandaid
Browse files Browse the repository at this point in the history
Better failure message for CI apps using default stack
  • Loading branch information
schneems authored Sep 14, 2018
2 parents 858c761 + 786f440 commit aa66b72
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Master

## v192 (9/14/2018)

* Add error messages when using unsupported Ruby versions on the Heroku-18 stack (https://github.com/heroku/heroku-buildpack-ruby/pull/809)

## v191 (8/23/2018)

* Warn when `config.action_dispatch.x_sendfile_header` is set but apache and nginx are not being used (https://github.com/heroku/heroku-buildpack-ruby/pull/795)
Expand Down
1 change: 0 additions & 1 deletion hatchet.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"sharpstone/rails4-manifest",
"sharpstone/rails3-to-4-no-bin",
"sharpstone/rails4_windows_mri193",
"sharpstone/rails4-env-assets-compile",
"sharpstone/rails4-fail-assets-compile"
],
"rails41": [
Expand Down
2 changes: 0 additions & 2 deletions hatchet.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
- 8cc041cffb9f5635017aa118d16688491f794e91
- - "./repos/rails4/rails3-to-4-no-bin"
- 3fd6e84f5d8eaaadb6d95aeb1f367f62da28cc62
- - "./repos/rails4/rails4-env-assets-compile"
- ba8c352856685c3e46ae227ffbc175d6aa8e868b
- - "./repos/rails4/rails4-fail-assets-compile"
- 7f65fbb04ca49be526906a1b0d9155cd24941b8e
- - "./repos/rails4/rails4-manifest"
Expand Down
35 changes: 35 additions & 0 deletions lib/language_pack/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,41 @@ def install_ruby

true
rescue LanguagePack::Fetcher::FetchError => error
if stack == "heroku-18" && ruby_version.version_for_download.match?(/ruby-2\.(2|3)/)
message = <<ERROR
An error occurred while installing #{ruby_version.version_for_download}
This version of Ruby is not available on Heroku-18. The minimum supported version
of Ruby on the Heroku-18 stack can found at:
https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
ERROR

ci_message = <<ERROR
If you did not intend to build your app for CI on the Heroku-18 stack
please set your stack version manually in the `app.json`:
```
"stack": "heroku-16"
```
More information about this change in behavior can be found at:
https://kb.heroku.com/3Y1HEXGJ/why-doesn-t-ruby-2-3-7-work-in-my-ci-tests

This comment has been minimized.

Copy link
@eliotsykes

This comment has been minimized.

Copy link
@schneems

schneems Sep 14, 2018

Author Contributor

Thanks! Fixed in #811

ERROR

if env("CI")
mcount "fail.bad_version_fetch.heroku-18.ci"
message << ci_message
else
mcount "fail.bad_version_fetch.heroku-18"
end

error message
end

mcount "fail.bad_version_fetch"
mcount "fail.bad_version_fetch.#{ruby_version.version_for_download}"
message = <<ERROR
Expand Down
2 changes: 1 addition & 1 deletion lib/language_pack/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module LanguagePack
class LanguagePack::Base
BUILDPACK_VERSION = "v191"
BUILDPACK_VERSION = "v192"
end
end
9 changes: 0 additions & 9 deletions spec/hatchet/rails4_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,4 @@
expect(app).not_to be_deployed
end
end

it "should not override user settings rails 4.2" do
app = Hatchet::Runner.new("rails4-env-assets-compile")
app.setup!
app.set_config("RAILS_ENV" => "staging")
app.deploy do |a, heroku|
expect(a.output).to include("w00t")
end
end
end

0 comments on commit aa66b72

Please sign in to comment.