From 1b48ec6ad69fe536640d3075c1dc0764e6c10c8a Mon Sep 17 00:00:00 2001 From: bshand Date: Thu, 23 Oct 2025 12:58:08 +0100 Subject: [PATCH 1/3] Support Ruby 3.4, Rails 8.0 (#39) --- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 10 ++++++++++ CHANGELOG.md | 3 ++- gemfiles/Gemfile.rails80 | 5 +++++ ndr_error.gemspec | 2 +- 5 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 gemfiles/Gemfile.rails80 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 81c7841..4380a00 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.0 + ruby-version: 3.4 - name: Install dependencies run: bundle install - name: Run RuboCop against BASE..HEAD changes diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa9eaa3..291e48d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,18 +5,28 @@ on: [push] jobs: test: strategy: + fail-fast: false matrix: ruby-version: - '3.0' - '3.1' - '3.2' - '3.3' + - '3.4' gemfile: - gemfiles/Gemfile.rails61 - gemfiles/Gemfile.rails70 - gemfiles/Gemfile.rails71 - gemfiles/Gemfile.rails72 + - gemfiles/Gemfile.rails80 exclude: + # rails 6.1 requires ruby < 3.4 + - ruby-version: '3.4' + gemfile: 'gemfiles/Gemfile.rails61' + # rails 7.0 requires ruby >= 2.7, < 3.4 + # https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html + - ruby-version: '3.4' + gemfile: 'gemfiles/Gemfile.rails70' # rails 7.2 requires ruby >= 3.1 # https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html - ruby-version: '3.0' diff --git a/CHANGELOG.md b/CHANGELOG.md index 6943646..018286d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [Unreleased] -* no unreleased changes +### Fixed +* Support Ruby 3.4, Rails 8.0 ## 2.3.2 / 2024-11-21 ### Fixed diff --git a/gemfiles/Gemfile.rails80 b/gemfiles/Gemfile.rails80 new file mode 100644 index 0000000..4377f7d --- /dev/null +++ b/gemfiles/Gemfile.rails80 @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gemspec path: '..' + +gem 'rails', '~> 8.0.0' diff --git a/ndr_error.gemspec b/ndr_error.gemspec index b3cec27..3b8d096 100644 --- a/ndr_error.gemspec +++ b/ndr_error.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 3.0' - s.add_dependency 'rails', '>= 6.1', '< 7.3' + s.add_dependency 'rails', '>= 6.1', '< 8.1' # Support rails 6.1 with Ruby 3.1 s.add_dependency 'net-imap' From bdabaf9cf68876e658818f4412e9d8256d5d5378 Mon Sep 17 00:00:00 2001 From: bshand Date: Fri, 7 Nov 2025 09:53:32 +0000 Subject: [PATCH 2/3] Fix ruby 3.4 frozen string literal warnings (#41) GitHub Actions gem installation fix for sass-embedded on ruby 3.1 --- CHANGELOG.md | 1 + app/helpers/ndr_error/errors_helper.rb | 8 ++++---- ndr_error.gemspec | 7 +++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 018286d..71890a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [Unreleased] ### Fixed * Support Ruby 3.4, Rails 8.0 +* Fix ruby 3.4 frozen string literal warnings ## 2.3.2 / 2024-11-21 ### Fixed diff --git a/app/helpers/ndr_error/errors_helper.rb b/app/helpers/ndr_error/errors_helper.rb index 4296571..4a03470 100644 --- a/app/helpers/ndr_error/errors_helper.rb +++ b/app/helpers/ndr_error/errors_helper.rb @@ -11,7 +11,7 @@ def highlighted_trace_for(error) error.backtrace.map do |line| css_classes = 'trace-item' - css_classes << ' stack-only' unless highlighting.include?(line) + css_classes += ' stack-only' unless highlighting.include?(line) content_tag(:span, line, class: css_classes) end @@ -59,7 +59,7 @@ def downstream_fingerprint_link(print) def ticket_link_for(fingerprint, small = false) text = glyphicon_tag('asterisk') + ' View ticket' css = 'btn btn-default' - css << ' btn-xs' if small + css += ' btn-xs' if small url = fingerprint.ticket_url link_to(text, /^http/i =~ url ? url : "http://#{url}", class: css) @@ -87,7 +87,7 @@ def purge_button_for(fingerprint) def previous_button_for(error) css = 'btn btn-default' - css << ' disabled' if error.nil? + css += ' disabled' if error.nil? text = glyphicon_tag('chevron-left') path = error.nil? ? '#' : error_fingerprint_path(error.error_fingerprint, log_id: error) @@ -96,7 +96,7 @@ def previous_button_for(error) def next_button_for(error) css = 'btn btn-default' - css << ' disabled' if error.nil? + css += ' disabled' if error.nil? text = glyphicon_tag('chevron-right') path = error.nil? ? '#' : error_fingerprint_path(error.error_fingerprint, log_id: error) diff --git a/ndr_error.gemspec b/ndr_error.gemspec index 3b8d096..e13bc77 100644 --- a/ndr_error.gemspec +++ b/ndr_error.gemspec @@ -45,6 +45,13 @@ Gem::Specification.new do |s| # https://bugs.ruby-lang.org/issues/19371 s.add_development_dependency 'psych', '< 5' + # Workaround build issue on GitHub Actions with ruby <= 3.1 when installing sass-embedded + # Versions 1.77.0 and above require ruby >= 3.2 for packaged x86_64-linux binaries + # but say they're compatible with ruby 3.1. + # 1.76.0 has a bug that was fixed in 1.77.1, which we can't use yet. + # https://github.com/sass/dart-sass/issues/2239 + s.add_development_dependency 'sass-embedded', '~> 1.75.0' if RUBY_VERSION.start_with?('3.1') # rubocop:disable Gemspec/RubyVersionGlobalsUsage + s.add_development_dependency 'mocha' s.add_development_dependency 'test-unit', '~> 3.0' From 4f3adbee1f5640b4cbaf86c4127e714d1907f2b4 Mon Sep 17 00:00:00 2001 From: Brian Shand Date: Mon, 24 Nov 2025 14:12:32 +0000 Subject: [PATCH 3/3] tag version v2.3.3 --- CHANGELOG.md | 7 +++++-- lib/ndr_error/version.rb | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71890a1..3efd781 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ ## [Unreleased] +* no unreleased changes + +## 2.3.3 / 2025-11-24 ### Fixed -* Support Ruby 3.4, Rails 8.0 -* Fix ruby 3.4 frozen string literal warnings +* Support Ruby 3.4, Rails 8.0 [backported from v2.4.3] +* Fix ruby 3.4 frozen string literal warnings [backported from v2.4.3] ## 2.3.2 / 2024-11-21 ### Fixed diff --git a/lib/ndr_error/version.rb b/lib/ndr_error/version.rb index 54ef468..c7322d6 100644 --- a/lib/ndr_error/version.rb +++ b/lib/ndr_error/version.rb @@ -2,5 +2,5 @@ # Contains the version of NdrError. Sourced by the gemspec. module NdrError - VERSION = '2.3.2' + VERSION = '2.3.3' end