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

Update rails #442

Merged
merged 68 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
9dda17f
Rails 5.2 and compatible dependencies
barmintor Dec 18, 2023
f88c6f2
introduce ApplicationRecord base model
barmintor Dec 17, 2023
ada6c04
throw(:abort) in authz before_action
barmintor Dec 17, 2023
0e081f8
do not inherit directly from ActiveRecord::Migration, use version number
barmintor Dec 17, 2023
a37d825
rails 5.2 binstubs
barmintor Dec 17, 2023
21988f4
strong params in DigitalObjectController search methods
barmintor Dec 17, 2023
91d995b
utf conversion errors may be raised via JSON::GeneratorError
barmintor Dec 18, 2023
a4b0130
association semantics for Rails 5 in spec fixture set ups
barmintor Dec 18, 2023
bbf1967
Rails 5.2 requires an association to be defined before being used as …
barmintor Dec 18, 2023
8df3f53
Rails 5 makes belongs_to required by default, and optional when speci…
barmintor Dec 18, 2023
f96b176
noid no longer permits #seed with no params, but previous behavior an…
barmintor Dec 18, 2023
d430367
update initializers for Rails 5.2 and use Rails 5.2 defaults
barmintor Dec 18, 2023
910b690
cul_hydra no longer includes unused Resource or BagAggregator models
barmintor Dec 18, 2023
ac94dee
post_via_redirect was removed; call follow_redirect! after post
barmintor Dec 18, 2023
01c1760
guard clause in case jQuery.active returns null
barmintor Dec 18, 2023
722b442
controller test methods now use keyword params for params and session
barmintor Dec 18, 2023
fa1e0b2
run CI against ruby 2.7.6
barmintor Dec 18, 2023
d62a151
Rails 6.0 dependencies
barmintor Dec 18, 2023
6673e64
use Rails 6 initializers
barmintor Dec 18, 2023
d4d2a38
use Rails.application in routes config
barmintor Dec 18, 2023
c310c39
update the standard app environments for Rails 6
barmintor Dec 18, 2023
d5e4d4c
update binstubs for Rails 6
barmintor Dec 18, 2023
186687b
update puma config
barmintor Dec 18, 2023
8b30e56
update test cable adapter config from async to test per Rails 6 defaults
barmintor Dec 18, 2023
9c0c10f
explicitly name a shorter db index field name on controlled vocabularies
barmintor Dec 19, 2023
8f1e79f
ensure custom_field_key is a string before concatenating
barmintor Dec 19, 2023
35b5eeb
rename Assignments enum value 'annotate' to 'annotate_object'
barmintor Dec 19, 2023
cf06341
update development ruby version to 2.7.6
barmintor Dec 19, 2023
f566b75
Update deploy config and hyacinth_dev deployment target; Update capis…
elohanlon Dec 19, 2023
82efc71
Temporarily comment out resque restart in deploy.rb
elohanlon Dec 19, 2023
f385ead
Update to Ruby 2.7.8
elohanlon Dec 19, 2023
160605d
Update nokogiri
elohanlon Dec 19, 2023
050181c
Schema update after running migrations
elohanlon Dec 19, 2023
ee94cce
Set Nokogiri XML document namespace_inheritance to true in a couple o…
elohanlon Dec 19, 2023
1b4939c
Replace default_scope with self.implicit_order_column to remove some …
elohanlon Dec 19, 2023
ae9ed18
Re-enable cap hyacinth:restart_resque_workers task
elohanlon Dec 19, 2023
7e83a02
Force psych gem version < 4 (to support YAML aliases with Rails 6.0);…
elohanlon Dec 20, 2023
3c28901
Re-enable cap hyacinth:restart_resque_workers task (again)
elohanlon Dec 20, 2023
f91e3a3
In application.rb, change 'config.load_defaults 5.2' to 'config.load_…
elohanlon Dec 20, 2023
8f2448c
Use classic autoloader (instead of zeitwerk) for cul_hydra compatibility
elohanlon Dec 20, 2023
142fe30
Change 'render text:' to 'render plain:' in controllers
elohanlon Dec 20, 2023
f87bca0
Basic Vite setup (with more changes to come)
elohanlon Dec 20, 2023
7fd4d58
Fixes for slow asset compilation in development environment (and poss…
elohanlon Dec 20, 2023
40db2f6
Add NVM/node setup for deploy.rb
elohanlon Dec 20, 2023
57f49f6
Remove package-lock.json because we currently only want to use yarn a…
elohanlon Dec 20, 2023
fa000c1
Update node version to 20.10.0
elohanlon Dec 21, 2023
133fbe7
Rubocop fix
elohanlon Dec 21, 2023
162764f
Update GitHub ci.yml file to set up node
elohanlon Dec 21, 2023
539ee40
Fix a couple of errors that appear when using the Rails console on re…
elohanlon Dec 21, 2023
0ced1d3
Gemfile cleanup; Rename constant Hyacinth::XMLGenerator to Hyacinth::…
elohanlon Dec 21, 2023
b61629f
use a cul_hydra ref with no blacklight dependency and some zeitwerk-f…
barmintor Dec 21, 2023
c698d54
Remove XmlGenerator inflection override now that XMLGenerator class h…
elohanlon Dec 21, 2023
ead8367
Remove some deprecation warnings
elohanlon Dec 21, 2023
9ae0367
Switch to :hybrid cookie serializer during this transitional period s…
elohanlon Dec 21, 2023
01dbb2a
Rubocop fix and comment update
elohanlon Dec 21, 2023
d190a5e
Fix some more deprecation warnings
elohanlon Dec 21, 2023
1c57afa
Merge pull request #444 from cul/update-rails_no-blacklight_zeitwerk
elohanlon Dec 21, 2023
76fdfff
Update to Rails 6.1
elohanlon Dec 22, 2023
7d4deb1
Update rspec-rails and fix broken fixture_file_upload reference
elohanlon Dec 22, 2023
d488372
Fixes for login in development environment; Switch from secrets.yml t…
elohanlon Dec 22, 2023
4d42835
Add master.key to deployment config file symlink list (and remove sec…
elohanlon Dec 22, 2023
a796de5
Deployment config updates
elohanlon Dec 28, 2023
1b0725b
Update to bundler 2
elohanlon Dec 28, 2023
0518b65
Require net-http gem explicitly (and allow any version) to fix an iss…
elohanlon Dec 28, 2023
0760058
Pin uri gem to 0.10.0 to match the default/standard gem version that …
elohanlon Dec 28, 2023
09cabe6
Add updateHandler configs to various solr cores (to fix error message…
elohanlon Dec 29, 2023
ccd6f82
Update: Actually pin uri gem to 0.10.0.2, because that's the version …
elohanlon Dec 29, 2023
0289cc7
Update CI ruby version to 2.7.8
elohanlon Dec 29, 2023
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
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
ruby-version: ['2.6.10']
ruby-version: ['2.7.8']
node: ['20']
env:
RAILS_ENV: test
NOKOGIRI_USE_SYSTEM_LIBRARIES: true
Expand All @@ -32,5 +33,11 @@ jobs:
java-version: '8'
- name: Set up default config files
run: bundle exec rake hyacinth:setup:config_files
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm install -g yarn
- run: yarn install
- name: Run CI task
run: bundle exec rake hyacinth:ci
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/docker/docker-compose.*.yml

# Ignore config files with sensitive data
master.key
database.yml
datacite.yml
fedora.yml
Expand Down Expand Up @@ -62,3 +63,10 @@ config/subs.yml

# Ignore local rake tasks
/lib/tasks/hyacinth/local.rake

# Vite Ruby
/public/vite*
node_modules
# Vite uses dotenv and suggests to ignore local-only env files. See
# https://vitejs.dev/guide/env-and-mode.html#env-files
*.local
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.10.0
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.10
2.7.8
22 changes: 16 additions & 6 deletions Capfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# default requires
# frozen_string_literal: true

# Load DSL and set up stages
require 'capistrano/setup'

# Include default deployment tasks
require 'capistrano/deploy'
# additional optional modules used by clio
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'

# Git SCM plugin
require 'capistrano/scm/git'
install_plugin Capistrano::SCM::Git

# additional modules
require 'capistrano/rails'
require 'capistrano/passenger'
require 'capistrano/cul'

# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
100 changes: 49 additions & 51 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 4.2.11'

# BigDecimal bridge for later ruby while on Rails 4.2
gem 'bigdecimal', '~> 1.4.2'
gem 'rails', '~> 6.1.0'
gem 'bootsnap', require: false
# gem 'responders'

# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.3.10'
gem 'sqlite3', '~> 1.4'
gem 'mysql2', '~> 0.5.3'

# Lock rake due to rspec/rubocop v11 incompatibilities
gem 'rake', '~> 10.0'

# Use SCSS for stylesheets
gem 'sass'
gem 'sass-rails'
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'

# Bootstrap include
gem 'bootstrap-sass', '~> 3.3'
gem 'bootstrap-sass', '~> 3.4.1'
gem 'autoprefixer-rails' # Recommended by bootstrap-sass

# OHSynchronizer Dependencies
Expand All @@ -45,7 +40,7 @@ gem 'attr_encrypted', '>= 1.3.3'

# Mime Type detection
gem 'mime-types'

gem 'mime-types-data'
# Character encoding detection
gem 'charlock_holmes'

Expand All @@ -59,9 +54,6 @@ gem 'thread'
# Use terser as compressor for JavaScript assets
gem 'terser'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails'

# Use jquery as the JavaScript library
gem 'jquery-rails', '>= 4.0.4'

Expand All @@ -77,12 +69,7 @@ gem 'underscore-rails'
# gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
gem 'jbuilder'

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby'
Expand All @@ -94,19 +81,19 @@ end
gem 'kaminari'

# For building and parsing XML
gem 'nokogiri', '~> 1.10.10' # can't update to 1.11 because our server version of GLIBC is too old
gem 'nokogiri', '~> 1.15.5'

# For authentication
gem 'devise', '>= 3.4.1'
gem 'childprocess', '~> 2.0'
gem 'devise', '~> 4.9.3'
# gem 'childprocess', '~> 2.0'

# CUL Fedora Dependencies and Content Models
gem 'cul_hydra', '~> 1.8.0'
# gem 'cul_hydra', path: '../cul_hydra'
gem 'rubydora', git: 'https://github.com/elohanlon/rubydora', branch: 'datastream_dissemination_with_headers'
# gem 'cul_hydra', path: '../cul_hydra'
gem 'cul_hydra', git: 'https://github.com/cul/cul_hydra', ref: 'remove_blacklight'
gem 'active-fedora', '8.6.0'
gem 'rubydora'
# Temporarily use specific commit because new version of gem hasn't been released yet. Latest is 1.1.3.
gem 'rdf-rdfxml', git: 'https://github.com/ruby-rdf/rdf-rdfxml', ref: '78c13fe5dbcecaf1f56abe9535d00f16c670a764'
gem 'rdf', '>= 1.1.5'
gem 'rdf-vocab'
gem 'uri_service', '0.6.0'
# gem 'uri_service', path: '../uri_service'
gem 'solrizer', '>= 3.4.1'
Expand All @@ -118,7 +105,7 @@ gem 'best_type', '~> 1.0'
# gem 'best_type', path: '../best_type'

# Specify min version for active_fedora_relsint because of a needed fix
gem 'active_fedora_relsint', '>= 0.4.1'
gem 'active_fedora_relsint', git: 'https://github.com/cul/active_fedora_relsint', ref: '91114c78c9af344673f1e899624031da79b72693'

# URI Escaping
gem 'addressable', '~> 2.7.0'
Expand All @@ -139,48 +126,59 @@ gem 'rubyzip', '>= 1.2.1'

gem 'rainbow', '~> 3.0'

# Forcing psych 3 (not 4) so that yaml aliases can be used with Rails 6.0
gem 'psych', '<4'

# For css and js compilation
gem 'vite_rails', '~> 3.0.17'

# Require net-http gem explicitly (and allow any version) to fix an issue where the net-protocol
# dependency is loaded twice. See this: https://stackoverflow.com/a/75105591
# And this: https://github.com/ruby/net-imap/issues/16#issuecomment-803086765
gem 'net-http'

# Require uri gem explicitly and match the default.standard gem that comes with Ruby 2.7.8
# (otherwise we'll get an error about the bundle version not matching the installed version).
# See: https://stdgems.org/2.7.8/
# NOTE: This should be changed if you update to a newer version of ruby.
gem 'uri', '0.10.0.2'

# Gem min versions that are only specified here because of vulnerabilities in earlier versions:
gem 'rack-protection', '>= 1.5.5'
gem 'loofah', '>= 2.2.1'
gem 'rails-html-sanitizer', '>= 1.0.4'
gem 'loofah', '~> 2.20.0'
gem 'rails-html-sanitizer', '>= 1.2'

# Development and testing!
group :development, :test do
gem 'byebug'
gem 'rspec-rails', '~> 3.3'
gem 'rspec-rails', '~> 5.0'
gem 'rails-controller-testing'
gem 'capybara', '~> 3.32'
# For testing with chromedriver
gem 'selenium-webdriver', '~> 4.0'
# For automatically updating chromedriver
gem 'webdrivers', '~> 5.3.0', require: false
gem 'factory_girl_rails', '>= 4.4.1'
gem 'rubocop', '~> 0.58.2', require: false
gem 'rubocop-rspec', '>= 1.20.1', require: false
gem 'rubocop-rails_config', '>= 0.2.2', require: false
gem 'factory_bot_rails', '~> 4.9'
gem 'rubocop', '~> 0.67.0', require: false
gem 'rubocop-rspec', '~> 1.26.0', require: false
gem 'rubocop-rails_config', '~> 0.2.3', require: false
gem 'equivalent-xml'
gem 'listen'
end

# Development!
group :development do
# Use Capistrano for deployment
gem 'capistrano', '~> 3.5.0', require: false
# Rails and Bundler integrations were moved out from Capistrano 3
gem 'capistrano-rails', '~> 1.1', require: false
gem 'capistrano-bundler', '~> 1.1', require: false
# "idiomatic support for your preferred ruby version manager"
gem 'capistrano-rvm', '~> 0.1', require: false
# The `deploy:restart` hook for passenger applications is now in a separate gem
# Just add it to your Gemfile and require it in your Capfile.
gem 'capistrano', '~> 3.18.0', require: false
gem 'capistrano-cul', require: false
gem 'capistrano-passenger', '~> 0.1', require: false
# Use net-ssh >= 4.2 to prevent warnings with Ruby 2.4
gem 'net-ssh', '>= 4.2'

# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
gem 'capistrano-rails', '~> 1.4', require: false
end


# Alternate development webserver
gem 'puma', '~> 5.2', group: :development
# gem 'thin', group: :development
# gem 'unicorn', group: :development

gem "ejs", "~> 1.1"
Loading