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

Add bundler 2.6.2 and update bundler 2.5.23 #1535

Merged
merged 4 commits into from
Jan 6, 2025
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

- Ruby apps using bundler 2.6+ will now receive bundler 2.6.2 (https://github.com/heroku/heroku-buildpack-ruby/pull/1535)
- Ruby apps using bundler 2.5.x will now receive bundler 2.5.23 (https://github.com/heroku/heroku-buildpack-ruby/pull/1535)

## [v287] - 2024-12-25

Expand Down
15 changes: 15 additions & 0 deletions changelogs/unreleased/bundler_2.5.23.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Bundler version 2.5.23 is now available for Ruby Applications

The [Ruby Buildpack](https://devcenter.heroku.com/articles/ruby-support#libraries) installs a version of bundler based on the major and minor version listed in the `Gemfile.lock` under the `BUNDLED WITH` key:

- `BUNDLED WITH` 2.5.x will receive bundler `2.5.23`

It is strongly recommended that you have both a `RUBY VERSION` and `BUNDLED WITH` version listed in your `Gemfile.lock`. If you do not have those values, you can generate them and commit them to git:

```
$ bundle update --ruby
$ git add Gemfile.lock
$ git commit -m "Update Gemfile.lock"
```

Applications without these values specified in the `Gemfile.lock` may break unexpectedly when the defaults change.
15 changes: 15 additions & 0 deletions changelogs/unreleased/bundler_2.6.x_support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Bundler version 2.6.2 is now available for Ruby Applications

The [Ruby Buildpack](https://devcenter.heroku.com/articles/ruby-support#libraries) installs a version of bundler based on the major and minor version listed in the `Gemfile.lock` under the `BUNDLED WITH` key:

- `BUNDLED WITH` 2.6.x and above will receive bundler `2.6.2`

It is strongly recommended that you have both a `RUBY VERSION` and `BUNDLED WITH` version listed in your `Gemfile.lock`. If you do not have those values, you can generate them and commit them to git:

```
$ bundle update --ruby
$ git add Gemfile.lock
$ git commit -m "Update Gemfile.lock"
```

Applications without these values specified in the `Gemfile.lock` may break unexpectedly when the defaults change.
7 changes: 4 additions & 3 deletions lib/language_pack/helpers/bundler_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ class LanguagePack::Helpers::BundlerWrapper
# Heroku-20's oldest Ruby verison is 2.5.x which doesn't work with bundler 2.4
BLESSED_BUNDLER_VERSIONS["2.3"] = "2.3.25"
BLESSED_BUNDLER_VERSIONS["2.4"] = "2.4.22"
BLESSED_BUNDLER_VERSIONS["2.5"] = "2.5.6"
BLESSED_BUNDLER_VERSIONS["2.5"] = "2.5.23"
BLESSED_BUNDLER_VERSIONS["2.6"] = "2.6.2"
BLESSED_BUNDLER_VERSIONS.default_proc = Proc.new do |hash, key|
if Gem::Version.new(key).segments.first == 1
hash["1"]
elsif Gem::Version::new(key).segments.first == 2
if Gem::Version.new(key) > Gem::Version.new("2.5")
hash["2.5"]
if Gem::Version.new(key) > Gem::Version.new("2.6")
hash["2.6"]
elsif Gem::Version.new(key) < Gem::Version.new("2.3")
hash["2.3"]
else
Expand Down
8 changes: 6 additions & 2 deletions spec/helpers/bundler_wrapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@
expect(version).to eq(wrapper_klass::BLESSED_BUNDLER_VERSIONS["2.5"])

version = wrapper_klass.detect_bundler_version(contents: "BUNDLED WITH\n 2.6.7")
expect(wrapper_klass::BLESSED_BUNDLER_VERSIONS.key?("2.5")).to be_truthy
expect(version).to eq(wrapper_klass::BLESSED_BUNDLER_VERSIONS["2.5"])
expect(wrapper_klass::BLESSED_BUNDLER_VERSIONS.key?("2.6")).to be_truthy
expect(version).to eq(wrapper_klass::BLESSED_BUNDLER_VERSIONS["2.6"])

version = wrapper_klass.detect_bundler_version(contents: "BUNDLED WITH\n 2.999.7")
expect(wrapper_klass::BLESSED_BUNDLER_VERSIONS.key?("2.6")).to be_truthy
expect(version).to eq(wrapper_klass::BLESSED_BUNDLER_VERSIONS["2.6"])

expect {
wrapper_klass.detect_bundler_version(contents: "BUNDLED WITH\n 3.6.7")
Expand Down
Loading