diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75fae51..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"] + 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 6f5a182..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 @@ -47,5 +56,28 @@ DEPENDENCIES rubocop rubocop-shopify +CHECKSUMS + ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 + bootboot (0.2.2) + bundler (4.1.0) sha256=d7b7a797b988e544a0677a9c6ed78146f2f63d05ae1af8bc7d9426cf88b46377 + 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.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 (3.3.0) sha256=4b7aa66a4b11db50f6f7e98411215cd0dd10eaecb665d36eec5bcacb3fa0b613 + unicode-emoji (4.3.0) sha256=11c02fa73290378c066bb0562cd4c87d8e1b706fbbe0059ca12746a4244de8ce + 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 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