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

Warn when using SENSIBLE_DEFAULTS #1420

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [Unreleased]

- Officially deprecate SENSIBLE_DEFAULTS environment variable (https://github.com/heroku/heroku-buildpack-ruby/pull/1420)

## [v265] - 2024-01-22

Expand Down
14 changes: 14 additions & 0 deletions lib/language_pack/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,20 @@ def ruby_version
end

def set_default_web_concurrency
warn(<<~WARNING)
Your application is using an undocumented feature SENSIBLE_DEFAULTS

This feature is not supported and may be removed at any time. Please remove the SENSIBLE_DEFAULTS environment variable from your app.

$ heroku config:unset SENSIBLE_DEFAULTS

To configure your application's web concurrency, use the WEB_CONCURRENCY environment variable following this documentation:

- https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#recommended-default-puma-process-and-thread-configuration
- https://devcenter.heroku.com/articles/h12-request-timeout-in-ruby-mri#puma-pool-usage
- https://help.heroku.com/88G3XLA6/what-is-an-acceptable-amount-of-dyno-load
WARNING

<<-EOF
case $(ulimit -u) in
256)
Expand Down
7 changes: 0 additions & 7 deletions spec/hatchet/ruby_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,4 @@
expect(app.run("echo $WEB_CONCURRENCY", :heroku => {:env => "WEB_CONCURRENCY=0"}).strip).to eq("0")
end
end

it "has defaults set with SENSIBLE_DEFAULTS on" do
config = { "SENSIBLE_DEFAULTS" => "1"}
Hatchet::Runner.new('default_ruby', stack: DEFAULT_STACK, config: config).deploy do |app|
expect(app.run("env")).to match("WEB_CONCURRENCY=")
end
end
end