From be60c15ef92af29a194fc17c10365fb6c301fd64 Mon Sep 17 00:00:00 2001 From: David Rapson Date: Fri, 22 Nov 2024 17:11:20 +0000 Subject: [PATCH] Update supported Ruby and Rails versions This makes a couple of changes to reflect the release of Rails 8 and Rails 6.1 reaching EOL. - Drop support for Rails 6.1 both in the gemspec and in the test matrix - Add support for Rails 8 - Remove old versions of view component from the test matrix, we've long stopped using v2 in production - For local development, moves the .ruby-version to the top-level directory and updates the project to use a more recent 3.3 patch version --- .github/workflows/ci-workflow.yml | 24 ++++------- .github/workflows/docs-workflow-main.yml | 2 +- .github/workflows/docs-workflow.yml | 4 +- .ruby-version | 1 + CHANGELOG.md | 5 +++ demo/.ruby-version | 1 - demo/Gemfile | 2 - demo/Gemfile.lock | 7 +--- design-system-docs/.ruby-version | 1 - design-system-docs/Gemfile.lock | 4 +- engine/.ruby-version | 1 - engine/Gemfile | 5 +-- engine/Gemfile.lock | 51 +++++++++++------------ engine/citizens_advice_components.gemspec | 2 +- 14 files changed, 49 insertions(+), 61 deletions(-) create mode 100644 .ruby-version delete mode 100644 demo/.ruby-version delete mode 100644 design-system-docs/.ruby-version delete mode 100644 engine/.ruby-version diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 2bc1dd5f9..3a25495a5 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -27,20 +27,14 @@ jobs: # Active Ruby versions (https://endoflife.date/ruby) ruby_version: ['3.1', '3.2', '3.3'] # Active Rails versions (https://endoflife.date/rails) - rails_version: ['~> 7.0.0', '~> 7.1.0', '~> 7.2.0'] - # Any supported ViewComponent versions - view_component_version: ['~> 3'] - # Explicitly test a "legacy" configuration using an older Ruby, Rails, - # and ViewComponent version to represent applications that have not been - # upgraded yet with the expectation that we'll drop Rails 6.1 along with - # ViewComponent 2.x when Rails 6.1 goes end-of-life on October 1st 2024. - include: + rails_version: ['~> 7.0.0', '~> 7.1.0', '~> 7.2.0', '~> 8.0.0'] + # Exclude certain ruby and rails combinations + exclude: + # Rails 8 supports ruby 3.2+ - ruby_version: '3.1' - rails_version: '~> 6.1' - view_component_version: '~> 2.82' + rails_version: '~> 8.0.0' env: RAILS_VERSION: ${{ matrix.rails_version }} - VIEW_COMPONENT_VERSION: ${{ matrix.view_component_version }} defaults: run: working-directory: engine @@ -67,7 +61,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: '3.3.1' + ruby-version: '3.3.5' working-directory: engine - run: bundle exec rubocop --format progress --format github - run: bundle exec erblint --lint-all @@ -93,7 +87,7 @@ jobs: # Setup demo app - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.3.1' + ruby-version: '3.3.5' bundler-cache: true working-directory: demo @@ -150,7 +144,7 @@ jobs: # Setup demo app - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.3.1' + ruby-version: '3.3.5' bundler-cache: true working-directory: demo @@ -192,7 +186,7 @@ jobs: # Setup docs site - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.3.1' + ruby-version: '3.3.5' bundler-cache: true working-directory: design-system-docs diff --git a/.github/workflows/docs-workflow-main.yml b/.github/workflows/docs-workflow-main.yml index 73133b007..09896a1e0 100644 --- a/.github/workflows/docs-workflow-main.yml +++ b/.github/workflows/docs-workflow-main.yml @@ -25,7 +25,7 @@ jobs: # Setup docs site - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.3.1' + ruby-version: '3.3.5' bundler-cache: true working-directory: design-system-docs diff --git a/.github/workflows/docs-workflow.yml b/.github/workflows/docs-workflow.yml index 0374f868e..4e31591b4 100644 --- a/.github/workflows/docs-workflow.yml +++ b/.github/workflows/docs-workflow.yml @@ -36,7 +36,7 @@ jobs: # Setup docs site - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.3.1' + ruby-version: '3.3.5' bundler-cache: true working-directory: design-system-docs @@ -81,7 +81,7 @@ jobs: # Setup docs site - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.3.1' + ruby-version: '3.3.5' bundler-cache: true working-directory: design-system-docs diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 000000000..fa7adc7ac --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.3.5 diff --git a/CHANGELOG.md b/CHANGELOG.md index 546e812d3..5b267ea1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ + +**New** +- Add support for Rails 8 +- Drop support for Rails 6.1 + ## v6.2.0 ### 13 November 2024 diff --git a/demo/.ruby-version b/demo/.ruby-version deleted file mode 100644 index bea438e9a..000000000 --- a/demo/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.3.1 diff --git a/demo/Gemfile b/demo/Gemfile index a6fb95e56..6ac4f6721 100644 --- a/demo/Gemfile +++ b/demo/Gemfile @@ -2,8 +2,6 @@ source "https://rubygems.org" -ruby "3.3.1" - # Rails gem "rails", "~> 7.2.2" diff --git a/demo/Gemfile.lock b/demo/Gemfile.lock index d6911ce24..58321e06f 100644 --- a/demo/Gemfile.lock +++ b/demo/Gemfile.lock @@ -13,8 +13,8 @@ PATH remote: ../engine specs: citizens_advice_components (0.1.0) - actionpack (>= 6.0.0, < 8.0) - railties (>= 6.0.0, < 8.0) + actionpack (>= 7.0.0, < 9.0) + railties (>= 7.0.0, < 9.0) view_component (>= 2.0.0, < 4.0) GEM @@ -306,8 +306,5 @@ DEPENDENCIES tzinfo-data web-console (>= 3.3.0) -RUBY VERSION - ruby 3.3.1p55 - BUNDLED WITH 2.5.9 diff --git a/design-system-docs/.ruby-version b/design-system-docs/.ruby-version deleted file mode 100644 index bea438e9a..000000000 --- a/design-system-docs/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.3.1 diff --git a/design-system-docs/Gemfile.lock b/design-system-docs/Gemfile.lock index 86689ce10..a67a8ae65 100644 --- a/design-system-docs/Gemfile.lock +++ b/design-system-docs/Gemfile.lock @@ -13,8 +13,8 @@ PATH remote: ../engine specs: citizens_advice_components (0.1.0) - actionpack (>= 6.0.0, < 8.0) - railties (>= 6.0.0, < 8.0) + actionpack (>= 7.0.0, < 9.0) + railties (>= 7.0.0, < 9.0) view_component (>= 2.0.0, < 4.0) GEM diff --git a/engine/.ruby-version b/engine/.ruby-version deleted file mode 100644 index bea438e9a..000000000 --- a/engine/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.3.1 diff --git a/engine/Gemfile b/engine/Gemfile index 8a130ab53..bba560c94 100644 --- a/engine/Gemfile +++ b/engine/Gemfile @@ -4,8 +4,7 @@ source "https://rubygems.org" gemspec -rails_version = ENV.fetch("RAILS_VERSION", "~> 7.1.0").to_s -view_component_version = ENV.fetch("VIEW_COMPONENT_VERSION", "~> 3").to_s +rails_version = ENV.fetch("RAILS_VERSION", "~> 7.2.0").to_s # rubocop:disable Bundler/DuplicatedGem if rails_version == "main" @@ -22,8 +21,6 @@ else end # rubocop:enable Bundler/DuplicatedGem -gem "view_component", view_component_version - group :development, :test do gem "citizens-advice-style", github: "citizensadvice/citizens-advice-style-ruby", diff --git a/engine/Gemfile.lock b/engine/Gemfile.lock index a844c3212..c8e347f5b 100644 --- a/engine/Gemfile.lock +++ b/engine/Gemfile.lock @@ -13,44 +13,44 @@ PATH remote: . specs: citizens_advice_components (0.1.0) - actionpack (>= 6.0.0, < 8.0) - railties (>= 6.0.0, < 8.0) + actionpack (>= 7.0.0, < 9.0) + railties (>= 7.0.0, < 9.0) view_component (>= 2.0.0, < 4.0) GEM remote: https://rubygems.org/ specs: - actionpack (7.1.5) - actionview (= 7.1.5) - activesupport (= 7.1.5) + actionpack (7.2.2) + actionview (= 7.2.2) + activesupport (= 7.2.2) nokogiri (>= 1.8.5) racc - rack (>= 2.2.4) + rack (>= 2.2.4, < 3.2) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actionview (7.1.5) - activesupport (= 7.1.5) + useragent (~> 0.16) + actionview (7.2.2) + activesupport (= 7.2.2) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activemodel (7.1.5) - activesupport (= 7.1.5) - activesupport (7.1.5) + activemodel (7.2.2) + activesupport (= 7.2.2) + activesupport (7.2.2) base64 benchmark (>= 0.3) bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) logger (>= 1.4.2) minitest (>= 5.1) - mutex_m securerandom (>= 0.3) - tzinfo (~> 2.0) + tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) @@ -115,7 +115,6 @@ GEM mini_mime (1.1.5) mini_portile2 (2.8.7) minitest (5.25.1) - mutex_m (0.2.0) nokogiri (1.16.7) mini_portile2 (~> 2.8.2) racc (~> 1.4) @@ -132,7 +131,7 @@ GEM rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rackup (2.2.0) + rackup (2.2.1) rack (>= 3) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) @@ -144,17 +143,17 @@ GEM rails-i18n (7.0.9) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.1.5) - actionpack (= 7.1.5) - activesupport (= 7.1.5) - irb + railties (7.2.2) + actionpack (= 7.2.2) + activesupport (= 7.2.2) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rdoc (6.7.0) + rdoc (6.8.1) psych (>= 4.0.0) regexp_parser (2.9.2) reline (0.5.11) @@ -221,29 +220,29 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.6.0) + useragent (0.16.10) view_component (3.20.0) activesupport (>= 5.2.0, < 8.1) concurrent-ruby (~> 1.0) method_source (~> 1.0) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.18) + zeitwerk (2.7.1) PLATFORMS ruby DEPENDENCIES - actionpack (~> 7.1.0) - activemodel (~> 7.1.0) + actionpack (~> 7.2.0) + activemodel (~> 7.2.0) capybara citizens-advice-style! citizens_advice_components! erb_lint i18n-tasks - railties (~> 7.1.0) + railties (~> 7.2.0) rspec rspec-rails - view_component (~> 3) BUNDLED WITH 2.5.9 diff --git a/engine/citizens_advice_components.gemspec b/engine/citizens_advice_components.gemspec index d4f05b2e6..08f77b441 100644 --- a/engine/citizens_advice_components.gemspec +++ b/engine/citizens_advice_components.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.files = Dir["{app,config,lib}/**/*", "README.md"] %w[actionpack railties].each do |rails_lib| - spec.add_dependency rails_lib, [">= 6.0.0", "< 8.0"] + spec.add_dependency rails_lib, [">= 7.0.0", "< 9.0"] end spec.add_dependency "view_component", [">= 2.0.0", "< 4.0"]