From eb7e1e164e942f256872f1d05b58de5c33184478 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 4 Feb 2025 16:52:07 +0000 Subject: [PATCH 01/12] Bump minimum ruby to 3.1 --- cucumber-rails.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cucumber-rails.gemspec b/cucumber-rails.gemspec index 08163088..8842569c 100644 --- a/cucumber-rails.gemspec +++ b/cucumber-rails.gemspec @@ -13,8 +13,8 @@ Gem::Specification.new do |s| s.license = 'MIT' - s.required_ruby_version = '>= 2.6.0' - s.required_rubygems_version = '>= 3.2.3' + s.required_ruby_version = '>= 3.1.0' + s.required_rubygems_version = '>= 3.2.8' s.metadata = { 'bug_tracker_uri' => 'https://github.com/cucumber/cucumber-rails/issues', From fb2c6dca1e87dcd153629e1ffdf3b272465c6a46 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 4 Feb 2025 16:53:55 +0000 Subject: [PATCH 02/12] Remove all redundant test workflows now minimum ruby is 3.1 --- .github/workflows/test.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9a006563..c55e655c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,18 +23,9 @@ jobs: # - rails versions if their patch release is within 6 months of the Ruby EOL date # - No version of the current rails major # - # 2.6 -> EOL Mar '22 -> Only test Rails versions initially released before Sep '22 - # 2.7 -> EOL Mar '23 -> Only test Rails versions initially released before Sep '23 - # 3.0 -> EOL Mar '24 -> Only test Rails versions initially released before Sep '24 # 3.1 -> EOL Mar '25 -> Only test Rails versions initially released before Sep '25 + # 3.2 -> EOL Mar '26 -> Only test Rails versions initially released before Sep '26 include: - - { ruby: '2.6', gemfile: 'rails_5_2' } - - { ruby: '2.7', gemfile: 'rails_6_0' } - - { ruby: '2.7', gemfile: 'rails_6_1' } - # Capybara has an incompatibility here with rails 6. It's easier to just exclude this one run from the matrix until it's out of support - # As such ruby 3.0 is tested on rails 7.0 ONLY as an EXCEPTION to the above rules (Because we need at least one combination of ruby/rails) - # Ruby 3.0+ also won't work with Rails 5.2: https://github.com/rails/rails/issues/40938 - - { ruby: '3.0', gemfile: 'rails_7_0' } # Ruby 3.1+ has issues with Rails 6.1 https://github.com/rails/rails/issues/46883#issuecomment-1371325906 # It (Rails 6.1.x), has been marked as a won't fix and as such it's likely this will need to just be excluded until out of support window - { ruby: '3.3', gemfile: 'rails_7_2' } @@ -43,7 +34,6 @@ jobs: ruby: ['3.1', '3.2'] gemfile: ['rails_5_2', 'rails_6_0', 'rails_6_1', 'rails_7_0', 'rails_7_1', 'rails_7_2', 'rails_8_0'] exclude: - # Ruby 3.0+ doesn't work with Rails 5.2: https://github.com/rails/rails/issues/40938 # Ruby 3.1+ has a conflicting Psych version with Rails 6.x: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias - { ruby: '3.1', gemfile: 'rails_5_2' } - { ruby: '3.1', gemfile: 'rails_6_0' } @@ -59,8 +49,6 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - bundler: '2.4.19' - rubygems: latest bundler-cache: true - run: bundle exec rake spec - run: bundle exec rubocop From dad02f5f6c97b1e916583d2ed28fde1d0758d1be Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 4 Feb 2025 16:54:47 +0000 Subject: [PATCH 03/12] Add new 3.4 ruby support matrix and rules --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c55e655c..0fbd9b8e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,6 +30,8 @@ jobs: # It (Rails 6.1.x), has been marked as a won't fix and as such it's likely this will need to just be excluded until out of support window - { ruby: '3.3', gemfile: 'rails_7_2' } - { ruby: '3.3', gemfile: 'rails_8_0' } + - { ruby: '3.4', gemfile: 'rails_7_2' } + - { ruby: '3.4', gemfile: 'rails_8_0' } # Supported rubies will test all permissible supported rails versions ruby: ['3.1', '3.2'] gemfile: ['rails_5_2', 'rails_6_0', 'rails_6_1', 'rails_7_0', 'rails_7_1', 'rails_7_2', 'rails_8_0'] From a08a472f35cd4caced18700d4cc8b6ef1a3bb079 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 4 Feb 2025 16:57:01 +0000 Subject: [PATCH 04/12] Move ruby 3.3 into the regular support window and increase test coverage --- .github/workflows/test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0fbd9b8e..df6f9eee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,15 +28,13 @@ jobs: include: # Ruby 3.1+ has issues with Rails 6.1 https://github.com/rails/rails/issues/46883#issuecomment-1371325906 # It (Rails 6.1.x), has been marked as a won't fix and as such it's likely this will need to just be excluded until out of support window - - { ruby: '3.3', gemfile: 'rails_7_2' } - - { ruby: '3.3', gemfile: 'rails_8_0' } - { ruby: '3.4', gemfile: 'rails_7_2' } - { ruby: '3.4', gemfile: 'rails_8_0' } # Supported rubies will test all permissible supported rails versions - ruby: ['3.1', '3.2'] + ruby: ['3.1', '3.2', '3.3'] gemfile: ['rails_5_2', 'rails_6_0', 'rails_6_1', 'rails_7_0', 'rails_7_1', 'rails_7_2', 'rails_8_0'] exclude: - # Ruby 3.1+ has a conflicting Psych version with Rails 6.x: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias + # Ruby 3.1+ has a conflicting Psych version with Rails 5.2 & 6.x: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias - { ruby: '3.1', gemfile: 'rails_5_2' } - { ruby: '3.1', gemfile: 'rails_6_0' } - { ruby: '3.1', gemfile: 'rails_6_1' } @@ -44,6 +42,9 @@ jobs: - { ruby: '3.2', gemfile: 'rails_5_2' } - { ruby: '3.2', gemfile: 'rails_6_0' } - { ruby: '3.2', gemfile: 'rails_6_1' } + - { ruby: '3.3', gemfile: 'rails_5_2' } + - { ruby: '3.3', gemfile: 'rails_6_0' } + - { ruby: '3.3', gemfile: 'rails_6_1' } env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile steps: From 1e180c462391e601e72a8ca25acb7b6a2454377e Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 4 Feb 2025 16:58:19 +0000 Subject: [PATCH 05/12] Rails 5.2 has no longer any valid supported permutations - as such we can drop it from full support --- .github/workflows/test.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df6f9eee..fa6684a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,17 +32,14 @@ jobs: - { ruby: '3.4', gemfile: 'rails_8_0' } # Supported rubies will test all permissible supported rails versions ruby: ['3.1', '3.2', '3.3'] - gemfile: ['rails_5_2', 'rails_6_0', 'rails_6_1', 'rails_7_0', 'rails_7_1', 'rails_7_2', 'rails_8_0'] + gemfile: ['rails_6_0', 'rails_6_1', 'rails_7_0', 'rails_7_1', 'rails_7_2', 'rails_8_0'] exclude: - # Ruby 3.1+ has a conflicting Psych version with Rails 5.2 & 6.x: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias - - { ruby: '3.1', gemfile: 'rails_5_2' } + # Ruby 3.1+ has a conflicting Psych version with Rails 6.x: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias - { ruby: '3.1', gemfile: 'rails_6_0' } - { ruby: '3.1', gemfile: 'rails_6_1' } - { ruby: '3.1', gemfile: 'rails_8_0' } - - { ruby: '3.2', gemfile: 'rails_5_2' } - { ruby: '3.2', gemfile: 'rails_6_0' } - { ruby: '3.2', gemfile: 'rails_6_1' } - - { ruby: '3.3', gemfile: 'rails_5_2' } - { ruby: '3.3', gemfile: 'rails_6_0' } - { ruby: '3.3', gemfile: 'rails_6_1' } env: From 53c51813fce02d300496e99d4a2b8db284e955b8 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 4 Feb 2025 16:59:26 +0000 Subject: [PATCH 06/12] Rails 6.0/1 also has no longer any valid support matrices. We will leave 6.1 in as a gemfile but will mark all as excluded incase the 6.1 psych version is fixed. We also still want to support rails 6.1 as a valid option with this version 4 of cucumber rails --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa6684a7..92d32aa9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,15 +32,12 @@ jobs: - { ruby: '3.4', gemfile: 'rails_8_0' } # Supported rubies will test all permissible supported rails versions ruby: ['3.1', '3.2', '3.3'] - gemfile: ['rails_6_0', 'rails_6_1', 'rails_7_0', 'rails_7_1', 'rails_7_2', 'rails_8_0'] + gemfile: ['rails_6_1', 'rails_7_0', 'rails_7_1', 'rails_7_2', 'rails_8_0'] exclude: # Ruby 3.1+ has a conflicting Psych version with Rails 6.x: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias - - { ruby: '3.1', gemfile: 'rails_6_0' } - { ruby: '3.1', gemfile: 'rails_6_1' } - { ruby: '3.1', gemfile: 'rails_8_0' } - - { ruby: '3.2', gemfile: 'rails_6_0' } - { ruby: '3.2', gemfile: 'rails_6_1' } - - { ruby: '3.3', gemfile: 'rails_6_0' } - { ruby: '3.3', gemfile: 'rails_6_1' } env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile From 3ea82ff5016f526a6db6fb3d2257eb9c6f4cafb2 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 4 Feb 2025 17:01:02 +0000 Subject: [PATCH 07/12] Regenerate appraisals files and purge rails 5.2 and 6.0 gemfiles --- Appraisals | 25 ------------------------- gemfiles/rails_5_2.gemfile | 15 --------------- gemfiles/rails_6_0.gemfile | 16 ---------------- 3 files changed, 56 deletions(-) delete mode 100644 gemfiles/rails_5_2.gemfile delete mode 100644 gemfiles/rails_6_0.gemfile diff --git a/Appraisals b/Appraisals index 9ecd6f45..6d94c614 100644 --- a/Appraisals +++ b/Appraisals @@ -1,30 +1,5 @@ # frozen_string_literal: true -appraise 'rails_5_2' do - gem 'activerecord' - gem 'capybara', '< 3.33' - gem 'concurrent-ruby', '< 1.3.5' - gem 'cucumber', '< 6' - gem 'factory_bot', '< 6.4' - gem 'psych', '< 4' - gem 'rails-html-sanitizer', '< 1.4.3' - gem 'railties', '~> 5.2.8' - gem 'sqlite3', '~> 1.3.13' -end - -appraise 'rails_6_0' do - gem 'activerecord' - gem 'capybara', '< 3.35' - gem 'concurrent-ruby', '< 1.3.5' - gem 'cucumber', '< 6' - gem 'factory_bot', '< 6.4' - gem 'matrix' - gem 'psych', '< 4' - gem 'rails-html-sanitizer', '< 1.4.3' - gem 'railties', '~> 6.0.6' - gem 'sqlite3', '< 1.6' -end - appraise 'rails_6_1' do gem 'activerecord' gem 'capybara', '< 3.38' diff --git a/gemfiles/rails_5_2.gemfile b/gemfiles/rails_5_2.gemfile deleted file mode 100644 index 229b959d..00000000 --- a/gemfiles/rails_5_2.gemfile +++ /dev/null @@ -1,15 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord" -gem "capybara", "< 3.33" -gem "concurrent-ruby", "< 1.3.5" -gem "cucumber", "< 6" -gem "factory_bot", "< 6.4" -gem "psych", "< 4" -gem "rails-html-sanitizer", "< 1.4.3" -gem "railties", "~> 5.2.8" -gem "sqlite3", "~> 1.3.13" - -gemspec path: "../" diff --git a/gemfiles/rails_6_0.gemfile b/gemfiles/rails_6_0.gemfile deleted file mode 100644 index a9df4acf..00000000 --- a/gemfiles/rails_6_0.gemfile +++ /dev/null @@ -1,16 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord" -gem "capybara", "< 3.35" -gem "concurrent-ruby", "< 1.3.5" -gem "cucumber", "< 6" -gem "factory_bot", "< 6.4" -gem "matrix" -gem "psych", "< 4" -gem "rails-html-sanitizer", "< 1.4.3" -gem "railties", "~> 6.0.6" -gem "sqlite3", "< 1.6" - -gemspec path: "../" From e5ece390324baad517fab79c129f34b96653ef83 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 4 Feb 2025 17:02:06 +0000 Subject: [PATCH 08/12] Update readme to hint new supported versions --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 41dca2c7..98f95747 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,9 @@ [![Gem Version](https://badge.fury.io/rb/cucumber-rails.svg)](http://badge.fury.io/rb/cucumber-rails) [![build](https://github.com/cucumber/cucumber-rails/actions/workflows/test.yml/badge.svg)](https://github.com/cucumber/cucumber-rails/actions/workflows/test.yml) -[![Code Climate](https://codeclimate.com/github/cucumber/cucumber-rails.svg)](https://codeclimate.com/github/cucumber/cucumber-rails) [![Open Source Helpers](https://www.codetriage.com/cucumber/cucumber-rails/badges/users.svg)](https://www.codetriage.com/cucumber/cucumber-rails) -Cucumber-Rails brings Cucumber to Rails 5.2, 6.x, 7.x, and 8.x. +Cucumber-Rails brings Cucumber to Rails 6.1, 7.x, and 8.x. ## Installation @@ -103,7 +102,7 @@ suite against all gemfiles, run the following commands: To run the suite against a named gemfile, use the following: - [bundle exec] appraisal rails_6_0 rake test + [bundle exec] appraisal rails_8_0 rake test ### Adding dependencies From e178c3fca0a247c7b0d10b51c6876b62fa3986ba Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 4 Feb 2025 17:03:18 +0000 Subject: [PATCH 09/12] Update contributing docs --- CONTRIBUTING.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 22bb49e4..831b7048 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,10 @@ -## About to create a new Github Issue? +## About to create a new GitHub Issue? We appreciate that. But before you do, please learn our basic rules: * This is not a support forum. If you have a question, please go to [The Cukes Google Group](http://groups.google.com/group/cukes). -* Do you have an idea for a new feature? Then don't expect it to be implemented unless you or someone else sends a [pull request](https://help.github.com/articles/using-pull-requests). You might be better to start a discussion on [the google group](http://groups.google.com/group/cukes). +* Do you have an idea for a new feature? Then don't expect it to be implemented unless you or someone else +sends a [pull request](https://help.github.com/articles/using-pull-requests). You might be better to start a discussion on [the google group](http://groups.google.com/group/cukes). * Reporting a bug? Please tell us: * which version of Cucumber you're using * which version of Ruby you're using @@ -30,8 +31,8 @@ This document is a guide for those maintaining Cucumber-Rails, and others who wo bundle install bin/install_geckodriver.sh bin/install_webpacker.sh - # Then to run tests on one version-specific Gemfile (e.g. gemfiles/rails_6_0.gemfile), run - bundle exec appraisal rails_6_0 rake test + # Then to run tests on one version-specific Gemfile (e.g. gemfiles/rails_8_0.gemfile), run + bundle exec appraisal rails_8_0 rake test # Or run tests across the full supported stack. Note that because we support many versions. This takes 5-10 minutes bundle exec rake appraisal From 5ebb8eb0ef78b9e612b1f9699dfbaa40bd304cd2 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 4 Feb 2025 17:03:43 +0000 Subject: [PATCH 10/12] Update rubocop linting guidelines --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 30ac32ca..0b59c067 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,7 +6,7 @@ require: - rubocop-rspec AllCops: - TargetRubyVersion: 2.6 + TargetRubyVersion: 3.1 NewCops: enable Exclude: # These are auto-generated from a load of features that use aruba From 21ee71cb568edd65dd6362b10b15f2e6ac8ef664 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 4 Feb 2025 17:12:52 +0000 Subject: [PATCH 11/12] Update test workflow notes --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 92d32aa9..06c87a4f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,15 +26,16 @@ jobs: # 3.1 -> EOL Mar '25 -> Only test Rails versions initially released before Sep '25 # 3.2 -> EOL Mar '26 -> Only test Rails versions initially released before Sep '26 include: - # Ruby 3.1+ has issues with Rails 6.1 https://github.com/rails/rails/issues/46883#issuecomment-1371325906 - # It (Rails 6.1.x), has been marked as a won't fix and as such it's likely this will need to just be excluded until out of support window - { ruby: '3.4', gemfile: 'rails_7_2' } - { ruby: '3.4', gemfile: 'rails_8_0' } # Supported rubies will test all permissible supported rails versions ruby: ['3.1', '3.2', '3.3'] gemfile: ['rails_6_1', 'rails_7_0', 'rails_7_1', 'rails_7_2', 'rails_8_0'] exclude: + # Ruby 3.1+ has issues with Rails 6.1 https://github.com/rails/rails/issues/46883#issuecomment-1371325906 + # It (Rails 6.1.x), has been marked as a won't fix and as such it's likely this will need to just be excluded until out of support window # Ruby 3.1+ has a conflicting Psych version with Rails 6.x: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias + # Rails 8.x has a minimum ruby of 3.2 - { ruby: '3.1', gemfile: 'rails_6_1' } - { ruby: '3.1', gemfile: 'rails_8_0' } - { ruby: '3.2', gemfile: 'rails_6_1' } From f02fa33301f5d33e79500de61d408e6c58602448 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 4 Feb 2025 17:17:15 +0000 Subject: [PATCH 12/12] Fix rubocop --- lib/cucumber/rails/capybara/select_dates_and_times.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cucumber/rails/capybara/select_dates_and_times.rb b/lib/cucumber/rails/capybara/select_dates_and_times.rb index 72565d12..bf7234bb 100644 --- a/lib/cucumber/rails/capybara/select_dates_and_times.rb +++ b/lib/cucumber/rails/capybara/select_dates_and_times.rb @@ -45,7 +45,7 @@ def select_datetime(datetime, options) if html5_input_field_present?(base_dom_id) fill_in options[:from], with: DateTime.parse(datetime) else - extended_options = options.merge(base_dom_id: base_dom_id) + extended_options = options.merge(base_dom_id:) select_date(datetime, extended_options) select_time(datetime, extended_options) end