From f95feb490221ac6dd2554a81c01d91db69411097 Mon Sep 17 00:00:00 2001 From: nekketsuuu Date: Tue, 24 Nov 2026 17:44:44 +0900 Subject: [PATCH 1/2] fix: Definition#lock no longer accepts target file argument Passing an argument to `Definition#lock` was deprecated in https://github.com/ruby/rubygems/pull/7047. Update the implementation to match the new interface, making it compatible with Bundler 4. This also updates CI to run with Bundler 4. Ruby 4.0 is not added to CI in this patch because it will fail due to another incompatibility. --- .github/workflows/ci.yml | 2 +- Gemfile.lock | 22 +++++++++++++++++++++- lib/bootboot/gemfile_next_auto_sync.rb | 10 +++++++++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75fae51..db42721 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: name: Ruby ${{ matrix.ruby }} strategy: matrix: - ruby: ["3.2", "3.3"] + ruby: ["3.2", "3.3", "3.4"] steps: - name: Check out code uses: actions/checkout@v3 diff --git a/Gemfile.lock b/Gemfile.lock index 6f5a182..7b18945 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,5 +47,25 @@ DEPENDENCIES rubocop rubocop-shopify +CHECKSUMS + ast (2.4.2) sha256=1e280232e6a33754cde542bc5ef85520b74db2aac73ec14acef453784447cc12 + bootboot (0.2.2) + bundler (4.1.0) sha256=d7b7a797b988e544a0677a9c6ed78146f2f63d05ae1af8bc7d9426cf88b46377 + json (2.7.1) sha256=187ea312fb58420ff0c40f40af1862651d4295c8675267c6a1c353f1a0ac3265 + language_server-protocol (3.17.0.3) sha256=3d5c58c02f44a20d972957a9febe386d7e7468ab3900ce6bd2b563dd910c6b3f + minitest (5.26.2) sha256=f021118a6185b9ba9f5af71f2ba103ad770c75afde9f2ab8da512677c550cde3 + parallel (1.24.0) sha256=5bf38efb9b37865f8e93d7a762727f8c5fc5deb19949f4040c76481d5eee9397 + parser (3.3.0.5) sha256=7748313e505ca87045dc0465c776c802043f777581796eb79b1654c5d19d2687 + racc (1.7.3) sha256=b785ab8a30ec43bce073c51dbbe791fd27000f68d1c996c95da98bf685316905 + rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a + rake (13.0.6) sha256=5ce4bf5037b4196c24ac62834d8db1ce175470391026bd9e557d669beeb19097 + regexp_parser (2.9.0) sha256=81a00ba141cec0d4b4bf58cb80cd9193e5180836d3fa6ef623f7886d3ba8bdd9 + rexml (3.4.2) sha256=1384268554a37af5da5279431ca3f2f37d46f09ffdd6c95e17cc84c83ea7c417 + rubocop (1.62.1) sha256=aeb1ec501aef5833617b3b6a1512303806218c349c28ce5b3ea72e3782ad4a35 + rubocop-ast (1.31.2) sha256=7c206fb094553779923eca862aceece3913ce384f1bf85730208228e884578ec + rubocop-shopify (2.11.1) sha256=4949a733dd7f184bd08de740ead54a99fe738fabc0fc4356c7944e6fc01e34f8 + ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 + unicode-display_width (2.5.0) sha256=7e7681dcade1add70cb9fda20dd77f300b8587c81ebbd165d14fd93144ff0ab4 + BUNDLED WITH - 2.7.2 + 4.1.0 diff --git a/lib/bootboot/gemfile_next_auto_sync.rb b/lib/bootboot/gemfile_next_auto_sync.rb index 10dab77..0c4c4aa 100644 --- a/lib/bootboot/gemfile_next_auto_sync.rb +++ b/lib/bootboot/gemfile_next_auto_sync.rb @@ -54,12 +54,20 @@ def update!(current_definition) unlock = current_definition.instance_variable_get(:@unlock) definition = Bundler::Definition.build(GEMFILE, lock, unlock) definition.resolve_remotely! - definition.lock(lock) + write_lock(definition, lock) ensure ENV.delete(env) ENV.delete("BOOTBOOT_UPDATING_ALTERNATE_LOCKFILE") end + def write_lock(definition, lock) + if Gem::Version.new(Bundler::VERSION) >= Gem::Version.new("2.5.6") + definition.lock + else + definition.lock(lock) + end + end + def which_env if Bundler.default_lockfile.to_s =~ /_next\.lock/ Bootboot.env_previous From 28ce41ad7ed860150bcc57fa9e08373cfac05733 Mon Sep 17 00:00:00 2001 From: nekketsuuu Date: Tue, 24 Nov 2026 19:18:36 +0900 Subject: [PATCH 2/2] Update gems to support Ruby 4.0 in CI --- .github/workflows/ci.yml | 2 +- Gemfile.lock | 86 +++++++++++++++++++++++----------------- test/bootboot_test.rb | 28 ++++++------- 3 files changed, 64 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db42721..13d9a4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: name: Ruby ${{ matrix.ruby }} strategy: matrix: - ruby: ["3.2", "3.3", "3.4"] + ruby: ["3.2", "3.3", "3.4", "4.0"] steps: - name: Check out code uses: actions/checkout@v3 diff --git a/Gemfile.lock b/Gemfile.lock index 7b18945..b8a5b9a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,36 +6,45 @@ PATH GEM remote: https://rubygems.org/ specs: - ast (2.4.2) - json (2.7.1) - language_server-protocol (3.17.0.3) - minitest (5.26.2) - parallel (1.24.0) - parser (3.3.0.5) + ast (2.4.3) + drb (2.2.3) + json (3.2.0) + language_server-protocol (3.17.0.6) + lint_roller (1.1.0) + minitest (6.1.0) + drb (~> 2.0) + prism (>= 1.5, < 3) + parallel (1.28.0) + parser (3.3.14.0) ast (~> 2.4.1) racc - racc (1.7.3) + prism (2.1.0) + racc (1.8.1) rainbow (3.1.1) - rake (13.0.6) - regexp_parser (2.9.0) - rexml (3.4.2) - rubocop (1.62.1) - json (~> 2.3) - language_server-protocol (>= 3.17.0) - parallel (~> 1.10) + rake (13.4.2) + regexp_parser (2.13.4) + rubocop (1.92.3) + json (>= 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (>= 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.11.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) - rubocop-shopify (2.11.1) - rubocop (~> 1.42) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.53.0) + ast (~> 2.4) + parser (>= 3.3.7.2) + prism (>= 1.7) + racc + rubocop-shopify (2.18.0) + rubocop (~> 1.62) ruby-progressbar (1.13.0) - unicode-display_width (2.5.0) + unicode-display_width (3.3.0) + unicode-emoji (~> 4.3) + unicode-emoji (4.3.0) PLATFORMS ruby @@ -48,24 +57,27 @@ DEPENDENCIES rubocop-shopify CHECKSUMS - ast (2.4.2) sha256=1e280232e6a33754cde542bc5ef85520b74db2aac73ec14acef453784447cc12 + ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 bootboot (0.2.2) bundler (4.1.0) sha256=d7b7a797b988e544a0677a9c6ed78146f2f63d05ae1af8bc7d9426cf88b46377 - json (2.7.1) sha256=187ea312fb58420ff0c40f40af1862651d4295c8675267c6a1c353f1a0ac3265 - language_server-protocol (3.17.0.3) sha256=3d5c58c02f44a20d972957a9febe386d7e7468ab3900ce6bd2b563dd910c6b3f - minitest (5.26.2) sha256=f021118a6185b9ba9f5af71f2ba103ad770c75afde9f2ab8da512677c550cde3 - parallel (1.24.0) sha256=5bf38efb9b37865f8e93d7a762727f8c5fc5deb19949f4040c76481d5eee9397 - parser (3.3.0.5) sha256=7748313e505ca87045dc0465c776c802043f777581796eb79b1654c5d19d2687 - racc (1.7.3) sha256=b785ab8a30ec43bce073c51dbbe791fd27000f68d1c996c95da98bf685316905 + drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373 + json (3.2.0) sha256=4a4e222a9ee6ffb296ab3171b6b39d85fec83afc4e7b57eee17edf68c74aec87 + language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0 + lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87 + minitest (6.1.0) sha256=ff373595aa8888631e8a5463986a76b3845346ae6d7fa46e139c1633d418076e + parallel (1.28.0) sha256=33e6de1484baf2524792d178b0913fc8eb94c628d6cfe45599ad4458c638c970 + parser (3.3.14.0) sha256=62f8f76af7b919425ee2d811880e9dcb8011ab40bfd59970dfb583141697e58f + prism (2.1.0) sha256=1c0a7c6dea0e93183390fb123f007564dbe663198e2f86ad87204151147601f3 + racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a - rake (13.0.6) sha256=5ce4bf5037b4196c24ac62834d8db1ce175470391026bd9e557d669beeb19097 - regexp_parser (2.9.0) sha256=81a00ba141cec0d4b4bf58cb80cd9193e5180836d3fa6ef623f7886d3ba8bdd9 - rexml (3.4.2) sha256=1384268554a37af5da5279431ca3f2f37d46f09ffdd6c95e17cc84c83ea7c417 - rubocop (1.62.1) sha256=aeb1ec501aef5833617b3b6a1512303806218c349c28ce5b3ea72e3782ad4a35 - rubocop-ast (1.31.2) sha256=7c206fb094553779923eca862aceece3913ce384f1bf85730208228e884578ec - rubocop-shopify (2.11.1) sha256=4949a733dd7f184bd08de740ead54a99fe738fabc0fc4356c7944e6fc01e34f8 + rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701 + regexp_parser (2.13.4) sha256=1d0547814f57e6f00946957bd0ca201bc42f42cfb08eee89df60998aedcd8a3b + rubocop (1.92.3) sha256=fd77feac46e8e91c3a534f868a1702c59f5bf8173515fd00a3c6ce1198672ff6 + rubocop-ast (1.53.0) sha256=027984d28485d6502ae4c72f9341080f54f538599f5dbb54f81875a4ddcad574 + rubocop-shopify (2.18.0) sha256=dafa25e5617ce4600ff86b1de3d5b78e43ab3d58cc5729df38e492b8e10294eb ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 - unicode-display_width (2.5.0) sha256=7e7681dcade1add70cb9fda20dd77f300b8587c81ebbd165d14fd93144ff0ab4 + unicode-display_width (3.3.0) sha256=4b7aa66a4b11db50f6f7e98411215cd0dd10eaecb665d36eec5bcacb3fa0b613 + unicode-emoji (4.3.0) sha256=11c02fa73290378c066bb0562cd4c87d8e1b706fbbe0059ca12746a4244de8ce BUNDLED WITH 4.1.0 diff --git a/test/bootboot_test.rb b/test/bootboot_test.rb index 83f3e2d..3e0626f 100644 --- a/test/bootboot_test.rb +++ b/test/bootboot_test.rb @@ -66,7 +66,7 @@ def test_sync_the_gemfile_next_after_installation_of_new_gem_with_custom_bootboo Bundler.settings.set_local('bootboot_env_prefix', 'SHOPIFY') if ENV['SHOPIFY_NEXT'] - gem 'minitest', '5.26.0' + gem 'minitest', '5.26.1' end EOM @@ -79,7 +79,7 @@ def test_sync_the_gemfile_next_after_installation_of_new_gem_with_custom_bootboo env: { "SHOPIFY_NEXT" => "1" }, ) - assert_equal("5.26.0", output.strip) + assert_equal("5.26.1", output.strip) end end @@ -194,7 +194,7 @@ def test_bootboot_command_initialize_the_next_lock_and_update_the_gemfile File.write(file, <<-EOM, mode: "a") if ENV['DEPENDENCIES_NEXT'] - gem 'minitest', '5.25.0' + gem 'minitest', '5.26.2' end EOM @@ -205,7 +205,7 @@ def test_bootboot_command_initialize_the_next_lock_and_update_the_gemfile env: { "DEPENDENCIES_NEXT" => "1" }, ) - assert_equal("5.25.0", output.strip) + assert_equal("5.26.2", output.strip) end end @@ -279,9 +279,9 @@ def test_bundle_caching_both_sets_of_gems FileUtils.cp("#{file.path}.lock", gemfile_next(file)) File.write(file, <<-EOM, mode: "a") if ENV['DEPENDENCIES_NEXT'] - gem 'minitest', '5.15.0' + gem 'minitest', '5.26.2' else - gem 'minitest', '5.14.4' + gem 'minitest', '5.26.1' end EOM @@ -290,18 +290,18 @@ def test_bundle_caching_both_sets_of_gems run_bundle_command("pack", file.path) run_bundle_command("pack", file.path, env: { Bootboot.env_next => "1" }) - assert(File.exist?(dir + "/vendor/cache/minitest-5.14.4.gem")) - refute(File.exist?(dir + "/vendor/cache/minitest-5.15.0.gem")) - assert(File.exist?(dir + "/vendor/cache-next/minitest-5.15.0.gem")) - refute(File.exist?(dir + "/vendor/cache-next/minitest-5.14.4.gem")) - assert(run_bundle_command("info minitest", file.path).include?("minitest (5.14.4)")) - refute(run_bundle_command("info minitest", file.path).include?("minitest (5.15.0)")) + assert(File.exist?(dir + "/vendor/cache/minitest-5.26.1.gem")) + refute(File.exist?(dir + "/vendor/cache/minitest-5.26.2.gem")) + assert(File.exist?(dir + "/vendor/cache-next/minitest-5.26.2.gem")) + refute(File.exist?(dir + "/vendor/cache-next/minitest-5.26.1.gem")) + assert(run_bundle_command("info minitest", file.path).include?("minitest (5.26.1)")) + refute(run_bundle_command("info minitest", file.path).include?("minitest (5.26.2)")) assert(run_bundle_command( "info minitest", file.path, env: { Bootboot.env_next => "1" } - ).include?("minitest (5.15.0)")) + ).include?("minitest (5.26.2)")) refute(run_bundle_command( "info minitest", file.path, env: { Bootboot.env_next => "1" } - ).include?("minitest (5.14.4)")) + ).include?("minitest (5.26.1)")) end end