Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better failure message for CI apps using default stack #809

Merged
merged 4 commits into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Heroku-18"


## 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Heroku-18"

of Ruby on the Heroku 18 stack can found at:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Heroku-18"


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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Heroku-18"

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

ERROR

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of this add a generic mcount "fail.bad_version_fetch.#{stack}.#{ruby_version.version_for_download}" after this block. That will give us data for future stacks without having to go back and change this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way we're measuring failures doesn't like reporting the same failure twice under the same key i.e. fail. Otherwise you can end up with failure rates that are higher than 100% we're doing that for version numbers.

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