From dd0d68bd760955e73870b439f2fe786f1b645d50 Mon Sep 17 00:00:00 2001 From: Splines <37160523+Splines@users.noreply.github.com> Date: Thu, 22 Aug 2024 23:28:02 +0200 Subject: [PATCH] Clean up Gemfile & pin all gems (#680) * Pin versions for GitHub repos * Replace >= with ~> and current version * Group gems according to name & clean up comments * Remove SQLite dependency We've been using PostgreSQL instead for a long time. * Pin all dependencies to allow only automatic minor updates --- .gitignore | 3 - Gemfile | 202 ++++++++++++++-------------------- Gemfile.lock | 192 +++++++++++++++----------------- config/database.yml | 8 -- docker/development/Dockerfile | 2 +- docker/test/Dockerfile | 2 +- 6 files changed, 168 insertions(+), 241 deletions(-) diff --git a/.gitignore b/.gitignore index fa78b9564..fa5ed4bd3 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,6 @@ # Ignore bundler config. /.bundle -# Ignore the default SQLite database. -/db/*.sqlite3 -/db/*.sqlite3-journal /db/csv/* /db/backups/* !/backups/.gitkeep diff --git a/Gemfile b/Gemfile index 88a53f4e6..ae1dffb97 100644 --- a/Gemfile +++ b/Gemfile @@ -1,144 +1,102 @@ source "https://rubygems.org" -git_source(:github) { |repo| "https://github.com/#{repo}.git" } +# We only pin versions to specific Git commits when they are "problem childs" +# and we want to review each commit before updating to the latest version. ruby "3.1.4" -# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem "active_model_serializers", "~> 0.10" +gem "activerecord-import", "~>1.7" +gem "activerecord-nulldb-adapter", "~> 1.0" # for assets precompilation in production +gem "acts_as_list", "~> 1.2" +gem "acts_as_tree", "~> 2.9" +gem "acts_as_votable", "~> 0.14" +gem "barby", "~> 0.6" +gem "bootsnap", "~> 1.18", require: false # reduces boot times through caching +gem "bootstrap", "~>5.3" +gem "bootstrap_form", "~> 5.4" +gem "cancancan", "~> 3.6" +gem "clipboard-rails", "~> 1.7" +gem "coffee-rails", "~> 5.0" # CoffeeScript for .coffee assets and views +gem "commontator", "~> 7.0.1" +gem "coveralls", "~> 0.7", require: false +gem "dalli", "~> 3.2" # caching to memcached in production +gem "devise", "~> 4.9" +gem "devise-bootstrap-views", "~> 1.1" +gem "erubis", "~> 2.7" +gem "exception_handler", "~> 0.8.0.0", "~> 0.8.0" +gem "faraday", "~> 1.8", "~> 1.10" +gem "fastimage", "~> 2.3" +gem "filesize", "~> 0.2" +gem "fuzzy-string-match", "~> 1.0" +gem "image_processing", "~> 1.13" +gem "jbuilder", "~> 2.12" # build JSON APIs easily +gem "jquery-rails", "~> 4.6" +gem "jquery-ui-rails", "~> 7.0" +gem "js-routes", "~> 1.4" +gem "kaminari", "~> 1.2" +gem "kaminari-i18n", "~> 0.5" +gem "kramdown-parser-gfm", "~> 1.1" +gem "mini_magick", "~> 4.13" +gem "mobility", "~> 1.2" +gem "net-smtp", "~> 0.5" +gem "pdf-reader", "~> 2.12" +gem "pg", "~> 1.5" +gem "premailer-rails", "~> 1.12" +gem "progress_bar", "~> 1.3" +gem "prometheus_exporter", "~> 2.1" +gem "puma", "~> 6.4" # app server +gem "rack", "~> 2.2" gem "rails", "~> 7.1.3" -# Use dalli for caching to memcached in production -gem "dalli", ">= 2.7" -# Ruby wrapper for UglifyJS JavaScript compressor -gem "terser" -# Use nulldb adapter for assets precompilation in production -gem "activerecord-nulldb-adapter" -# Use sqlite3 as the database for Active Record -gem "sqlite3", "~> 1.4" -# Use Puma as the app server -gem "puma", "< 7" -# Use SCSS for stylesheets -gem "sass-rails", ">= 6" -# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker -# gem 'webpacker', '~> 4.0' -# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks -gem "turbolinks", "~> 5" -# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -gem "jbuilder" -# Use Redis adapter to run Action Cable in production -# gem 'redis', '~> 4.0' -# Use Active Model has_secure_password -# gem 'bcrypt', '~> 3.1.7' - -# Use Active Storage variant -# gem 'image_processing', '~> 1.2' - -# Reduces boot times through caching; required in config/boot.rb -gem "active_model_serializers" -gem "bootsnap", ">= 1.4.2", require: false -gem "rack", "<3" -# Use CoffeeScript for .coffee assets and views -gem "coffee-rails", "~> 5.0.0" - -# Use Redis adapter to run Action Cable in production -# gem 'redis', '~> 3.0' -gem "fastimage" -gem "image_processing" -gem "mini_magick" -gem "pdf-reader" -gem "shrine" -gem "streamio-ffmpeg" -# Use ActiveModel has_secure_password -# gem 'bcrypt', '~> 3.1.7' -gem "filesize" -# Use Capistrano for deployment -# gem 'capistrano-rails', group: :development -gem "activerecord-import", - git: "https://github.com/zdennis/activerecord-import.git", - branch: "master" -gem "acts_as_list" -gem "acts_as_tree" -gem "acts_as_votable" -gem "barby" -gem "bootstrap", "~>5" -gem "bootstrap_form" -gem "cancancan" -gem "clipboard-rails" -gem "commontator" -gem "coveralls", require: false -gem "devise" -gem "devise-bootstrap-views" -gem "erubis" -gem "exception_handler", "~> 0.8.0.0" -gem "faraday", "~> 1.8" -gem "fuzzy-string-match" -gem "jquery-rails" -gem "jquery-ui-rails" -gem "js-routes", "1.4.9" -gem "kaminari" -gem "kaminari-i18n" -gem "kramdown-parser-gfm" -gem "mobility" -gem "net-smtp" -gem "pg" -gem "premailer-rails" -gem "progress_bar" -gem "rails-i18n" -gem "responders" -gem "rgl" -gem "rqrcode" -gem "rubyzip", "~> 2.3.0" -gem "sidekiq" -gem "sidekiq-cron", "~> 1.1" -gem "sprockets-rails", - git: "https://github.com/rails/sprockets-rails", - branch: "master" -gem "sunspot_rails", - github: "sunspot/sunspot", - glob: "sunspot_rails/*.gemspec" -gem "sunspot_solr" +gem "rails-i18n", "~> 7.0" +gem "responders", "~> 3.1" +gem "rgl", "~> 0.6" +gem "rqrcode", "~> 2.2" +gem "rubyzip", "~> 2.3" +gem "sass-rails", "~> 6.0" # SCSS for stylesheets +gem "shrine", "~> 3.6" +gem "sidekiq", "~> 7.3" +gem "sidekiq-cron", "~> 1.12" +gem "sprockets-rails", "~>3.5" +gem "streamio-ffmpeg", "~> 3.0" +gem "sunspot_rails", "~> 2.7" +gem "sunspot_solr", "~> 2.7" +gem "terser", "~> 1.2" # Ruby wrapper for UglifyJS JavaScript compressor gem "thredded", git: "https://github.com/thredded/thredded.git", ref: "1340e913affd1af5fcc060fbccd271184ece9a6a" gem "thredded-markdown_katex", git: "https://github.com/thredded/thredded-markdown_katex.git", - branch: "main" -gem "trix-rails", require: "trix" -gem "webpacker", "~> 5.x" + ref: "e2830bdb40880018a0e59d2b82c94b0a9f237365" +gem "trix-rails", "~> 2.4", require: "trix" +gem "turbolinks", "~> 5.2" # make navigating the app faster +gem "webpacker", "~> 5.4" group :development, :docker_development do gem "listen", "~> 3.9" - gem "rails-erd" - # Access an interactive console on exception pages or by calling 'console' anywhere in the code. - gem "web-console", ">= 3.3.0" - # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring - gem "marcel" - gem "pgreset" - gem "rubocop", "~> 1.63", require: false + gem "marcel", "~> 1.0" + gem "pgreset", "~> 0.4" + gem "rails-erd", "~> 1.7" + gem "rubocop", "~> 1.65", require: false gem "rubocop-performance", "~> 1.21", require: false gem "rubocop-rails", "~> 2.24", require: false - gem "spring" - gem "spring-watcher-listen", "~> 2.0.0" - # gem 'bullet' + gem "spring", "~> 2.1" # app preloader, keeps app running in background for development + gem "spring-watcher-listen", "~> 2.0" + gem "web-console", "~> 4.2" # interactive console on exception pages end group :test do - # Adds support for Capybara system testing and selenium driver - gem "selenium-webdriver" - # Easy installation and use of web drivers to run system tests with browsers - gem "database_cleaner-active_record" - gem "faker" - gem "launchy" - gem "simplecov", require: false - gem "webdrivers" + gem "database_cleaner-active_record", "~> 2.2" # clean up database between tests + gem "faker", "~> 3.4" + gem "launchy", "~> 3.0" + gem "selenium-webdriver" # support for Capybara system testing and selenium driver, '~> 4.10.0' + gem "simplecov", "~> 0.22", require: false + gem "webdrivers", "~> 5.3" end group :test, :development, :docker_development do # Call 'byebug' anywhere in the code to stop execution and get a debugger console - gem "byebug", platforms: [:mri, :mingw, :x64_mingw] - gem "factory_bot_rails" - gem "rspec-rails" - - gem "simplecov-cobertura" - - gem "rspec-github" + gem "byebug", "~> 11.1", platforms: [:mri, :mingw, :x64_mingw] + gem "factory_bot_rails", "~> 6.4" + gem "rspec-github", "~> 2.4" + gem "rspec-rails", "~> 6.1" + gem "simplecov-cobertura", "~> 2.1" end - -gem "prometheus_exporter" diff --git a/Gemfile.lock b/Gemfile.lock index 9cd99b59f..be6716650 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,26 +1,7 @@ -GIT - remote: https://github.com/rails/sprockets-rails - revision: 2c04236faaacd021b7810289cbac93e962ff14da - branch: master - specs: - sprockets-rails (3.5.2) - actionpack (>= 6.1) - activesupport (>= 6.1) - sprockets (>= 3.0.0) - -GIT - remote: https://github.com/sunspot/sunspot.git - revision: 2cb3e49c6e9c8ec23b8d95f9dcf2d28d1248d61b - glob: sunspot_rails/*.gemspec - specs: - sunspot_rails (2.7.1) - rails (>= 5) - sunspot (= 2.7.1) - GIT remote: https://github.com/thredded/thredded-markdown_katex.git revision: e2830bdb40880018a0e59d2b82c94b0a9f237365 - branch: main + ref: e2830bdb40880018a0e59d2b82c94b0a9f237365 specs: thredded-markdown_katex (1.0.0) katex (>= 0.4.3) @@ -53,14 +34,6 @@ GIT sprockets-es6 timeago_js (>= 3.0.2.2) -GIT - remote: https://github.com/zdennis/activerecord-import.git - revision: fca8b823ae695b03714837cc6603f51525c60505 - branch: master - specs: - activerecord-import (1.7.0) - activerecord (>= 4.2) - GEM remote: https://rubygems.org/ specs: @@ -133,6 +106,8 @@ GEM activemodel (= 7.1.3.4) activesupport (= 7.1.3.4) timeout (>= 0.4.0) + activerecord-import (1.7.0) + activerecord (>= 4.2) activerecord-nulldb-adapter (1.0.1) activerecord (>= 5.2.0, < 7.2) activestorage (7.1.3.4) @@ -620,7 +595,10 @@ GEM babel-source (>= 5.8.11) babel-transpiler sprockets (>= 3.0.0) - sqlite3 (1.7.3-x86_64-linux) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) + sprockets (>= 3.0.0) stream (0.5.5) streamio-ffmpeg (3.0.2) multi_json (~> 1.8) @@ -630,6 +608,9 @@ GEM bigdecimal pr_geohash (~> 1.0) rsolr (>= 1.1.1, < 3) + sunspot_rails (2.7.1) + rails (>= 5) + sunspot (= 2.7.1) sunspot_solr (2.7.1) sync (0.5.0) term-ansicolor (1.11.2) @@ -681,90 +662,89 @@ PLATFORMS x86_64-linux DEPENDENCIES - active_model_serializers - activerecord-import! - activerecord-nulldb-adapter - acts_as_list - acts_as_tree - acts_as_votable - barby - bootsnap (>= 1.4.2) - bootstrap (~> 5) - bootstrap_form - byebug - cancancan - clipboard-rails - coffee-rails (~> 5.0.0) - commontator - coveralls - dalli (>= 2.7) - database_cleaner-active_record - devise - devise-bootstrap-views - erubis - exception_handler (~> 0.8.0.0) - factory_bot_rails - faker - faraday (~> 1.8) - fastimage - filesize - fuzzy-string-match - image_processing - jbuilder - jquery-rails - jquery-ui-rails - js-routes (= 1.4.9) - kaminari - kaminari-i18n - kramdown-parser-gfm - launchy + active_model_serializers (~> 0.10) + activerecord-import (~> 1.7) + activerecord-nulldb-adapter (~> 1.0) + acts_as_list (~> 1.2) + acts_as_tree (~> 2.9) + acts_as_votable (~> 0.14) + barby (~> 0.6) + bootsnap (~> 1.18) + bootstrap (~> 5.3) + bootstrap_form (~> 5.4) + byebug (~> 11.1) + cancancan (~> 3.6) + clipboard-rails (~> 1.7) + coffee-rails (~> 5.0) + commontator (~> 7.0.1) + coveralls (~> 0.7) + dalli (~> 3.2) + database_cleaner-active_record (~> 2.2) + devise (~> 4.9) + devise-bootstrap-views (~> 1.1) + erubis (~> 2.7) + exception_handler (~> 0.8.0.0, ~> 0.8.0) + factory_bot_rails (~> 6.4) + faker (~> 3.4) + faraday (~> 1.8, ~> 1.10) + fastimage (~> 2.3) + filesize (~> 0.2) + fuzzy-string-match (~> 1.0) + image_processing (~> 1.13) + jbuilder (~> 2.12) + jquery-rails (~> 4.6) + jquery-ui-rails (~> 7.0) + js-routes (~> 1.4) + kaminari (~> 1.2) + kaminari-i18n (~> 0.5) + kramdown-parser-gfm (~> 1.1) + launchy (~> 3.0) listen (~> 3.9) - marcel - mini_magick - mobility - net-smtp - pdf-reader - pg - pgreset - premailer-rails - progress_bar - prometheus_exporter - puma (< 7) - rack (< 3) + marcel (~> 1.0) + mini_magick (~> 4.13) + mobility (~> 1.2) + net-smtp (~> 0.5) + pdf-reader (~> 2.12) + pg (~> 1.5) + pgreset (~> 0.4) + premailer-rails (~> 1.12) + progress_bar (~> 1.3) + prometheus_exporter (~> 2.1) + puma (~> 6.4) + rack (~> 2.2) rails (~> 7.1.3) - rails-erd - rails-i18n - responders - rgl - rqrcode - rspec-github - rspec-rails - rubocop (~> 1.63) + rails-erd (~> 1.7) + rails-i18n (~> 7.0) + responders (~> 3.1) + rgl (~> 0.6) + rqrcode (~> 2.2) + rspec-github (~> 2.4) + rspec-rails (~> 6.1) + rubocop (~> 1.65) rubocop-performance (~> 1.21) rubocop-rails (~> 2.24) - rubyzip (~> 2.3.0) - sass-rails (>= 6) + rubyzip (~> 2.3) + sass-rails (~> 6.0) selenium-webdriver - shrine - sidekiq - sidekiq-cron (~> 1.1) - simplecov - simplecov-cobertura - spring - spring-watcher-listen (~> 2.0.0) - sprockets-rails! - sqlite3 (~> 1.4) - streamio-ffmpeg - sunspot_rails! - sunspot_solr - terser + shrine (~> 3.6) + sidekiq (~> 7.3) + sidekiq-cron (~> 1.12) + simplecov (~> 0.22) + simplecov-cobertura (~> 2.1) + spring (~> 2.1) + spring-watcher-listen (~> 2.0) + sprockets-rails (~> 3.5) + streamio-ffmpeg (~> 3.0) + sunspot_rails (~> 2.7) + sunspot_solr (~> 2.7) + terser (~> 1.2) thredded! thredded-markdown_katex! - trix-rails - turbolinks (~> 5) - web-console (>= 3.3.0) - webdrivers - webpacker (~> 5.x) + trix-rails (~> 2.4) + turbolinks (~> 5.2) + web-console (~> 4.2) + webdrivers (~> 5.3) + webpacker (~> 5.4) RUBY VERSION ruby 3.1.4p223 diff --git a/config/database.yml b/config/database.yml index 747a89c11..964d81a7d 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,9 +1,3 @@ -# SQLite version 3.x -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' -# default: &default adapter: postgresql pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> @@ -74,8 +68,6 @@ test: migrations_paths: db/interactions_migrate production: - # <<: *default - # database: db/development.sqlite3 primary: adapter: <%= ENV['PRODUCTION_DATABASE_ADAPTER'] ||= 'postgresql' %> encoding: <%= ENV['PRODUCTION_DATABASE_ENCODING'] %> diff --git a/docker/development/Dockerfile b/docker/development/Dockerfile index 4aa9b05c7..8b6201bd7 100644 --- a/docker/development/Dockerfile +++ b/docker/development/Dockerfile @@ -53,7 +53,7 @@ RUN yarn set version "${YARN_VERSION}" RUN apt update && \ apt-get install -y --no-install-recommends \ ffmpeg imagemagick pdftk ghostscript shared-mime-info \ - libarchive-tools postgresql-client-13 sqlite3 wget wait-for-it + libarchive-tools postgresql-client-13 wget wait-for-it # Setup ImageMagick RUN sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml diff --git a/docker/test/Dockerfile b/docker/test/Dockerfile index 470e065f5..32bf1eb51 100644 --- a/docker/test/Dockerfile +++ b/docker/test/Dockerfile @@ -52,7 +52,7 @@ RUN yarn set version "${YARN_VERSION}" RUN apt update && \ apt-get install -y --no-install-recommends \ ffmpeg imagemagick pdftk ghostscript shared-mime-info \ - libarchive-tools postgresql-client-13 sqlite3 wget wait-for-it + libarchive-tools postgresql-client-13 wget wait-for-it # Setup ImageMagick RUN sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml