From 998ec3fd90aea191d78fdc9e0bc462e7e1fb4d61 Mon Sep 17 00:00:00 2001 From: Schneems Date: Mon, 6 Jan 2025 09:52:46 -0600 Subject: [PATCH 1/4] Add Download support for Bundler 2.6.x Bundler 2.6.2 is the latest release of Bundler 2.6.x. This commit adds download support for that version. --- CHANGELOG.md | 1 + changelogs/unreleased/bundler_2.6.x_support.md | 15 +++++++++++++++ lib/language_pack/helpers/bundler_wrapper.rb | 5 +++-- spec/helpers/bundler_wrapper_spec.rb | 4 ++-- 4 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 changelogs/unreleased/bundler_2.6.x_support.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 9678d7362..389c13a59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased] +- Ruby apps using bundler 2.6+ will now receive bundler 2.6.2 () ## [v287] - 2024-12-25 diff --git a/changelogs/unreleased/bundler_2.6.x_support.md b/changelogs/unreleased/bundler_2.6.x_support.md new file mode 100644 index 000000000..e9d131563 --- /dev/null +++ b/changelogs/unreleased/bundler_2.6.x_support.md @@ -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. diff --git a/lib/language_pack/helpers/bundler_wrapper.rb b/lib/language_pack/helpers/bundler_wrapper.rb index 93377083f..a9f6fde1e 100644 --- a/lib/language_pack/helpers/bundler_wrapper.rb +++ b/lib/language_pack/helpers/bundler_wrapper.rb @@ -41,12 +41,13 @@ class LanguagePack::Helpers::BundlerWrapper 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.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 diff --git a/spec/helpers/bundler_wrapper_spec.rb b/spec/helpers/bundler_wrapper_spec.rb index a1b25951c..e70dbc1c4 100644 --- a/spec/helpers/bundler_wrapper_spec.rb +++ b/spec/helpers/bundler_wrapper_spec.rb @@ -36,8 +36,8 @@ 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"]) expect { wrapper_klass.detect_bundler_version(contents: "BUNDLED WITH\n 3.6.7") From a422d7d3fbf7c1b4cf6e6d8ed60ae64c26e2794b Mon Sep 17 00:00:00 2001 From: Schneems Date: Mon, 6 Jan 2025 09:56:23 -0600 Subject: [PATCH 2/4] Add Bundler 2.5.23 support This commit adds support for downloading bundler 2.5.23 for applications with Bundler 2.5.x in their `Gemfile.lock`. --- CHANGELOG.md | 1 + changelogs/unreleased/bundler_2.5.23.md | 15 +++++++++++++++ lib/language_pack/helpers/bundler_wrapper.rb | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/bundler_2.5.23.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 389c13a59..c1caac777 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] - Ruby apps using bundler 2.6+ will now receive bundler 2.6.2 () +- Ruby apps using bundler 2.5.x will now receive bundler 2.5.23 () ## [v287] - 2024-12-25 diff --git a/changelogs/unreleased/bundler_2.5.23.md b/changelogs/unreleased/bundler_2.5.23.md new file mode 100644 index 000000000..9267483f4 --- /dev/null +++ b/changelogs/unreleased/bundler_2.5.23.md @@ -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. diff --git a/lib/language_pack/helpers/bundler_wrapper.rb b/lib/language_pack/helpers/bundler_wrapper.rb index a9f6fde1e..64d030cfe 100644 --- a/lib/language_pack/helpers/bundler_wrapper.rb +++ b/lib/language_pack/helpers/bundler_wrapper.rb @@ -40,7 +40,7 @@ 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 From 64fb859771fbab837fc8eca16d77c4ab93ffe8ae Mon Sep 17 00:00:00 2001 From: Schneems Date: Mon, 6 Jan 2025 09:57:54 -0600 Subject: [PATCH 3/4] Changelog links --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1caac777..30eb99c36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,8 @@ ## [Unreleased] -- Ruby apps using bundler 2.6+ will now receive bundler 2.6.2 () -- Ruby apps using bundler 2.5.x will now receive bundler 2.5.23 () +- 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 From 4e6b882dce724c6ef31bab0e52c689939ad821e7 Mon Sep 17 00:00:00 2001 From: Schneems Date: Mon, 6 Jan 2025 10:39:46 -0600 Subject: [PATCH 4/4] Test bundler version greater than behavior Add test to assert versions greater than 2.6 will receive 2.6 --- spec/helpers/bundler_wrapper_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/helpers/bundler_wrapper_spec.rb b/spec/helpers/bundler_wrapper_spec.rb index e70dbc1c4..3a7fdca33 100644 --- a/spec/helpers/bundler_wrapper_spec.rb +++ b/spec/helpers/bundler_wrapper_spec.rb @@ -39,6 +39,10 @@ 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") }.to raise_error(wrapper_klass::UnsupportedBundlerVersion)