Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support Ruby 3.3 and Rails 7.2 #6913

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1ea669f
Support Ruby 3.3 and Rails 7.2
randalldfloyd Oct 2, 2024
920eca1
Upgrade to rails 7.2 and bump dependencies
cjcolvar Oct 2, 2024
9e1ff8a
Require callbacks required
cjcolvar Oct 2, 2024
46e33e6
Autoload FileListener
cjcolvar Oct 2, 2024
dd79d08
Deal with reloadable constants that get autoloaded during initialization
randalldfloyd Oct 7, 2024
21b8eac
Changing to correct usage of nulldb adapter when no DB ops are desired
randalldfloyd Oct 8, 2024
a08c76e
Fixing how Uglifier is configured due to compile errors in Rails 7
randalldfloyd Oct 9, 2024
7ffefa5
Resolving test suite incompatibilities for Rails 7.2
randalldfloyd Oct 11, 2024
840e36d
Rails 7.2 db:migrate updated schema
randalldfloyd Oct 11, 2024
e2f33ab
Patching Arel to add deprecated table_name alias, which is used exten…
randalldfloyd Oct 11, 2024
e8ca710
Upgrading rspec-rails
randalldfloyd Oct 14, 2024
0ee7f53
Patching AR to add deprecated fixture_path alias, which is used exten…
randalldfloyd Oct 14, 2024
99893ff
Temporarily override active_fedora until changed upstream
randalldfloyd Oct 15, 2024
8d46141
Various fixes to specs dealing mostly with changes in rspec/rspec-rails
randalldfloyd Oct 15, 2024
98f2362
Removing extensions from template render calls due to changes in rspe…
randalldfloyd Oct 15, 2024
5f814d8
Include TaggedLogging in FactoryBot to workaround issue
cjcolvar Oct 22, 2024
a1bf3a1
Workaround for missing method in FactoryBot::SyntaxRunner
cjcolvar Oct 22, 2024
89c9a6c
Remove override that is no longer needed
cjcolvar Oct 22, 2024
2c39fce
More workarounds for perform_enqueued_jobs
cjcolvar Oct 22, 2024
a50e3f1
Test with patched hydra-editor
cjcolvar Nov 11, 2024
485800e
Skipping send of uncountable when iterating across instance variables
randalldfloyd Dec 4, 2024
0a05e5c
Ensure that remote_files in attributes has been permitted
randalldfloyd Dec 11, 2024
ef66ca8
Use ActiveSupport::BroadcastLogger
cjcolvar Dec 9, 2024
2942d68
Allow for zero-arg invoking
cjcolvar Dec 13, 2024
bef3762
Use errors#add instead of <<
cjcolvar Dec 13, 2024
bdb08ab
Use typical pattern for removing constant instead of removed ActiveSu…
cjcolvar Dec 13, 2024
05aacaf
Reverting previous workaround for spec now that strong parameters are…
randalldfloyd Dec 13, 2024
cfd6cee
Changing expectations where ::Hash was testing equal to ActionControl…
randalldfloyd Dec 13, 2024
cf2f47b
Rounding date comparisons in expectations due to drift when using the…
randalldfloyd Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .dassie/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ gem 'jbuilder', '~> 2.5'
gem 'jquery-rails'
gem 'pg', '~> 1.3'
gem 'puma'
gem 'rails', '~> 6.1'
gem 'rails', '~> 7.2', '< 8.0'
gem 'riiif', '~> 2.1'
gem 'rsolr', '>= 1.0', '< 3'
gem 'sass-rails', '~> 6.0'
Expand All @@ -39,14 +39,15 @@ gem 'turbolinks', '~> 5'
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'uglifier', '>= 1.3.0'
gem 'activerecord-nulldb-adapter', git: 'https://github.com/taylorthurlow/nulldb', branch: 'fix/activerecord72-register-adapter'
gem 'hydra-editor', github: 'samvera/hydra-editor', branch: 'revert_and_modernize'

group :development do
gem 'better_errors' # add command line in browser when errors
gem 'binding_of_caller' # deeper stack trace used by better errors

# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
Expand All @@ -57,4 +58,4 @@ group :development, :test do
gem 'pry-doc'
gem 'pry-rails'
gem 'pry-rescue'
end
end
2 changes: 1 addition & 1 deletion .dassie/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
config.assets.prefix = '/dev-assets'

# Raises error for missing translations
config.action_view.raise_on_missing_translations = true
config.i18n.raise_on_missing_translations = true

# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
Expand Down
6 changes: 4 additions & 2 deletions .dassie/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

# Compress JavaScripts and CSS.
config.assets.js_compressor = Uglifier.new(harmony: true)
# config.assets.css_compressor = :sass
config.assets.configure do |env|
env.js_compressor = :uglifier
# env.css_compressor = :sass
end

# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
Expand Down
2 changes: 1 addition & 1 deletion .dassie/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@
config.active_support.deprecation = :stderr

# Raises error for missing translations
config.action_view.raise_on_missing_translations = true
config.i18n.raise_on_missing_translations = true
end
38 changes: 20 additions & 18 deletions .dassie/config/initializers/riiif.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,31 @@
module Hyrax
# Adds file locking to Riiif::File
# @see RiiifFileResolver
class RiiifFile < Riiif::File
include ActiveSupport::Benchmarkable

attr_reader :id
def initialize(input_path, tempfile = nil, id:)
super(input_path, tempfile)
raise(ArgumentError, "must specify id") if id.blank?
@id = id
end
Rails.application.reloader.to_prepare do
class RiiifFile < Riiif::File
include ActiveSupport::Benchmarkable

attr_reader :id
def initialize(input_path, tempfile = nil, id:)
super(input_path, tempfile)
raise(ArgumentError, "must specify id") if id.blank?
@id = id
end

# Wrap extract in a read lock and benchmark it
def extract(transformation, image_info = nil)
Riiif::Image.file_resolver.file_locks[id].with_read_lock do
benchmark "RiiifFile extracted #{path} with #{transformation.to_params}", level: :debug do
super
# Wrap extract in a read lock and benchmark it
def extract(transformation, image_info = nil)
Riiif::Image.file_resolver.file_locks[id].with_read_lock do
benchmark "RiiifFile extracted #{path} with #{transformation.to_params}", level: :debug do
super
end
end
end
end

private
private

def logger
Hyrax.logger
def logger
Hyrax.logger
end
end
end

Expand Down
Loading
Loading