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 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
df92b81
Support Ruby 3.3 and Rails 7.2
randalldfloyd Oct 2, 2024
46c09d6
Upgrade to rails 7.2 and bump dependencies
cjcolvar Oct 2, 2024
45a5603
Require callbacks required
cjcolvar Oct 2, 2024
c54a552
Autoload FileListener
cjcolvar Oct 2, 2024
ffe7f21
Deal with reloadable constants that get autoloaded during initialization
randalldfloyd Oct 7, 2024
a1f3eac
Changing to correct usage of nulldb adapter when no DB ops are desired
randalldfloyd Oct 8, 2024
a49d9b8
Fixing how Uglifier is configured due to compile errors in Rails 7
randalldfloyd Oct 9, 2024
89e0fef
Resolving test suite incompatibilities for Rails 7.2
randalldfloyd Oct 11, 2024
a34ed3b
Rails 7.2 db:migrate updated schema
randalldfloyd Oct 11, 2024
ad0ba7f
Patching Arel to add deprecated table_name alias, which is used exten…
randalldfloyd Oct 11, 2024
d7eb5ef
Upgrading rspec-rails
randalldfloyd Oct 14, 2024
bffa85d
Patching AR to add deprecated fixture_path alias, which is used exten…
randalldfloyd Oct 14, 2024
8094ecd
Temporarily override active_fedora until changed upstream
randalldfloyd Oct 15, 2024
0befe1d
Various fixes to specs dealing mostly with changes in rspec/rspec-rails
randalldfloyd Oct 15, 2024
e6bf157
Removing extensions from template render calls due to changes in rspe…
randalldfloyd Oct 15, 2024
f82baa6
Merge branch 'main' into ruby-3.3_rails-7.2
randalldfloyd Oct 16, 2024
e5f221b
Include TaggedLogging in FactoryBot to workaround issue
cjcolvar Oct 22, 2024
028513b
Workaround for missing method in FactoryBot::SyntaxRunner
cjcolvar Oct 22, 2024
04da5a9
Remove override that is no longer needed
cjcolvar Oct 22, 2024
ad420a1
More workarounds for perform_enqueued_jobs
cjcolvar Oct 22, 2024
abc450c
Test with patched hydra-editor
cjcolvar Nov 11, 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