From db42cd6fb09e6ed5409b35d7f78cd8aee4211822 Mon Sep 17 00:00:00 2001 From: sylph Date: Thu, 14 Nov 2024 11:07:37 -0800 Subject: [PATCH 1/8] Update to ruby 3 and bundler update --- .ruby-version | 1 + Gemfile | 2 +- Gemfile.lock | 8 +++----- 3 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..818bd47 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.0.6 diff --git a/Gemfile b/Gemfile index 20a20d0..271449c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby '>= 2.3.1' +ruby '3.0.6' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.1' diff --git a/Gemfile.lock b/Gemfile.lock index d1222c5..d2dd835 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -95,10 +95,9 @@ GEM domain_name (~> 0.5) i18n (1.10.0) concurrent-ruby (~> 1.0) - listen (3.1.5) + listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) loofah (2.14.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -182,7 +181,6 @@ GEM rspec-mocks (~> 3.8.0) rspec-support (~> 3.8.0) rspec-support (3.8.0) - ruby_dep (1.5.0) rubyzip (1.3.0) selenium-webdriver (3.142.3) childprocess (>= 0.5, < 2.0) @@ -254,7 +252,7 @@ DEPENDENCIES tzinfo-data RUBY VERSION - ruby 2.3.1p112 + ruby 3.0.6p216 BUNDLED WITH - 1.17.3 + 2.5.23 From 055ba0f24fd259618be15c98fe6fbbad7ee4eaf5 Mon Sep 17 00:00:00 2001 From: sylph Date: Thu, 14 Nov 2024 12:07:46 -0800 Subject: [PATCH 2/8] App boots on ruby 3.0 and rails 6.1 --- Gemfile | 10 +- Gemfile.lock | 294 ++++++++++++++++------------- config/environments/development.rb | 4 - 3 files changed, 170 insertions(+), 138 deletions(-) diff --git a/Gemfile b/Gemfile index 271449c..c3dea4f 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '3.0.6' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 5.2.1' +gem 'rails', '>= 6.0', '< 7.0' gem 'rack', '>= 2.0.8' # Use postgresql as the database for Active Record gem 'pg', '>= 0.18', '< 2.0' @@ -17,8 +17,8 @@ gem 'rack-cors', '>= 1.0.4', require: 'rack/cors' gem 'nokogiri', '>= 1.10.8' gem 'loofah', '>= 2.3.1' gem 'delayed_job_active_record' -gem 'delayed_job_web' -gem 'sentry-raven' +gem 'delayed_job_web', '~> 1.4' +gem 'sentry-raven', '~> 3.1.2' gem 'congress_forms', '~> 0.1.14' gem 'groupdate' gem 'rubyzip', '>= 1.3.0' @@ -34,7 +34,7 @@ gem 'rubyzip', '>= 1.3.0' # gem 'capistrano-rails', group: :development # Reduces boot times through caching; required in config/boot.rb -gem 'bootsnap', '>= 1.4.2', require: false +gem 'bootsnap', '~> 1.18', require: false # Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible # gem 'rack-cors' @@ -47,10 +47,8 @@ group :development, :test do end group :development do - 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' end diff --git a/Gemfile.lock b/Gemfile.lock index d2dd835..498baff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,80 +1,100 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.2.6.2) - actionpack (= 5.2.6.2) + actioncable (6.1.7.10) + actionpack (= 6.1.7.10) + activesupport (= 6.1.7.10) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.6.2) - actionpack (= 5.2.6.2) - actionview (= 5.2.6.2) - activejob (= 5.2.6.2) + actionmailbox (6.1.7.10) + actionpack (= 6.1.7.10) + activejob (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) + mail (>= 2.7.1) + actionmailer (6.1.7.10) + actionpack (= 6.1.7.10) + actionview (= 6.1.7.10) + activejob (= 6.1.7.10) + activesupport (= 6.1.7.10) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.6.2) - actionview (= 5.2.6.2) - activesupport (= 5.2.6.2) - rack (~> 2.0, >= 2.0.8) + actionpack (6.1.7.10) + actionview (= 6.1.7.10) + activesupport (= 6.1.7.10) + rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.6.2) - activesupport (= 5.2.6.2) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.1.7.10) + actionpack (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) + nokogiri (>= 1.8.5) + actionview (6.1.7.10) + activesupport (= 6.1.7.10) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.6.2) - activesupport (= 5.2.6.2) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.1.7.10) + activesupport (= 6.1.7.10) globalid (>= 0.3.6) - activemodel (5.2.6.2) - activesupport (= 5.2.6.2) - activerecord (5.2.6.2) - activemodel (= 5.2.6.2) - activesupport (= 5.2.6.2) - arel (>= 9.0) - activestorage (5.2.6.2) - actionpack (= 5.2.6.2) - activerecord (= 5.2.6.2) - marcel (~> 1.0.0) - activesupport (5.2.6.2) + activemodel (6.1.7.10) + activesupport (= 6.1.7.10) + activerecord (6.1.7.10) + activemodel (= 6.1.7.10) + activesupport (= 6.1.7.10) + activestorage (6.1.7.10) + actionpack (= 6.1.7.10) + activejob (= 6.1.7.10) + activerecord (= 6.1.7.10) + activesupport (= 6.1.7.10) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (6.1.7.10) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - addressable (2.6.0) - public_suffix (>= 2.0.2, < 4.0) - arel (9.0.0) - bootsnap (1.10.3) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + base64 (0.2.0) + bootsnap (1.18.4) msgpack (~> 1.2) - builder (3.2.4) + builder (3.3.0) byebug (10.0.2) - capybara (3.15.1) + capybara (3.40.0) addressable + matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) - regexp_parser (~> 1.2) + regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) capybara-selenium (0.0.6) capybara selenium-webdriver childprocess (1.0.1) rake (< 13.0) - concurrent-ruby (1.1.9) + concurrent-ruby (1.3.4) congress_forms (0.1.16) capybara-selenium (~> 0.0.6) nokogiri (>= 1.8.2) rest-client (~> 2.0) webdrivers (~> 3.9) crass (1.0.6) - delayed_job (4.1.5) - activesupport (>= 3.0, < 5.3) - delayed_job_active_record (4.1.3) - activerecord (>= 3.0, < 5.3) + date (3.4.0) + delayed_job (4.1.13) + activesupport (>= 3.0, < 9.0) + delayed_job_active_record (4.1.11) + activerecord (>= 3.0, < 9.0) delayed_job (>= 3.0, < 5) - delayed_job_web (1.4.3) + delayed_job_web (1.4.4) activerecord (> 3.0.0) delayed_job (> 2.0.3) rack-protection (>= 1.5.5) @@ -83,83 +103,103 @@ GEM domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) dotenv (2.5.0) - erubi (1.10.0) - faraday (0.15.2) - multipart-post (>= 1.2, < 3) - ffi (1.10.0) - globalid (1.0.0) - activesupport (>= 5.0) + erubi (1.13.0) + faraday (2.12.1) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-net_http (3.4.0) + net-http (>= 0.5.0) + globalid (1.2.1) + activesupport (>= 6.1) groupdate (2.5.3) activesupport (>= 3) http-cookie (1.0.3) domain_name (~> 0.5) - i18n (1.10.0) + i18n (1.14.6) concurrent-ruby (~> 1.0) - listen (3.0.8) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - loofah (2.14.0) + json (2.8.2) + logger (1.6.1) + loofah (2.23.1) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) - marcel (1.0.2) - method_source (1.0.0) - mime-types (3.2.2) + net-imap + net-pop + net-smtp + marcel (1.0.4) + matrix (0.4.2) + method_source (1.1.0) + mime-types (3.6.0) + logger mime-types-data (~> 3.2015) - mime-types-data (3.2019.0331) - mini_mime (1.1.2) - mini_portile2 (2.7.1) - minitest (5.15.0) - msgpack (1.4.5) - multipart-post (2.0.0) - mustermann (1.0.3) + mime-types-data (3.2024.1105) + mini_mime (1.1.5) + mini_portile2 (2.8.7) + minitest (5.25.1) + msgpack (1.7.5) + mustermann (3.0.3) + ruby2_keywords (~> 0.0.1) + net-http (0.5.0) + uri + net-imap (0.4.18) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.0) + net-protocol netrc (0.11.0) - nio4r (2.5.8) - nokogiri (1.13.1) - mini_portile2 (~> 2.7.0) + nio4r (2.7.4) + nokogiri (1.16.7) + mini_portile2 (~> 2.8.2) racc (~> 1.4) pg (1.1.3) - public_suffix (3.1.1) + public_suffix (6.0.1) puma (4.3.1) nio4r (~> 2.0) - racc (1.6.0) - rack (2.2.3) + racc (1.8.1) + rack (2.2.10) rack-cors (1.1.1) rack (>= 2.0.0) - rack-protection (2.0.4) - rack - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (5.2.6.2) - actioncable (= 5.2.6.2) - actionmailer (= 5.2.6.2) - actionpack (= 5.2.6.2) - actionview (= 5.2.6.2) - activejob (= 5.2.6.2) - activemodel (= 5.2.6.2) - activerecord (= 5.2.6.2) - activestorage (= 5.2.6.2) - activesupport (= 5.2.6.2) - bundler (>= 1.3.0) - railties (= 5.2.6.2) + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) + rack-test (2.1.0) + rack (>= 1.3) + rails (6.1.7.10) + actioncable (= 6.1.7.10) + actionmailbox (= 6.1.7.10) + actionmailer (= 6.1.7.10) + actionpack (= 6.1.7.10) + actiontext (= 6.1.7.10) + actionview (= 6.1.7.10) + activejob (= 6.1.7.10) + activemodel (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) + bundler (>= 1.15.0) + railties (= 6.1.7.10) sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) - loofah (~> 2.3) - railties (5.2.6.2) - actionpack (= 5.2.6.2) - activesupport (= 5.2.6.2) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (6.1.7.10) + actionpack (= 6.1.7.10) + activesupport (= 6.1.7.10) method_source - rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) + rake (>= 12.2) + thor (~> 1.0) rake (12.3.3) - rb-fsevent (0.10.3) - rb-inotify (0.9.10) - ffi (>= 0.5.0, < 2) - regexp_parser (1.5.1) + regexp_parser (2.9.2) rest-client (2.0.2) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) @@ -181,73 +221,71 @@ GEM rspec-mocks (~> 3.8.0) rspec-support (~> 3.8.0) rspec-support (3.8.0) + ruby2_keywords (0.0.5) rubyzip (1.3.0) selenium-webdriver (3.142.3) childprocess (>= 0.5, < 2.0) rubyzip (~> 1.2, >= 1.2.2) - sentry-raven (2.7.4) - faraday (>= 0.7.6, < 1.0) - sinatra (2.0.4) - mustermann (~> 1.0) - rack (~> 2.0) - rack-protection (= 2.0.4) + sentry-raven (3.1.2) + faraday (>= 1.0) + sinatra (3.2.0) + mustermann (~> 3.0) + rack (~> 2.2, >= 2.2.4) + rack-protection (= 3.2.0) tilt (~> 2.0) spring (2.0.2) activesupport (>= 4.2) - spring-watcher-listen (2.0.1) - listen (>= 2.7, < 4.0) - spring (>= 1.2, < 3.0) - sprockets (4.0.2) + sprockets (4.2.1) concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + rack (>= 2.2.4, < 4) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) sqlite3 (1.3.13) - thor (1.2.1) - thread_safe (0.3.6) - tilt (2.0.8) - tzinfo (1.2.9) - thread_safe (~> 0.1) + thor (1.3.2) + tilt (2.4.0) + timeout (0.4.2) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext unf_ext (0.0.7.6) + uri (1.0.2) webdrivers (3.9.4) nokogiri (~> 1.6) rubyzip (~> 1.0) selenium-webdriver (~> 3.0) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) + zeitwerk (2.6.18) PLATFORMS ruby DEPENDENCIES - bootsnap (>= 1.4.2) + bootsnap (~> 1.18) byebug congress_forms (~> 0.1.14) delayed_job_active_record - delayed_job_web + delayed_job_web (~> 1.4) dotenv groupdate - listen (>= 3.0.5, < 3.2) loofah (>= 2.3.1) nokogiri (>= 1.10.8) pg (>= 0.18, < 2.0) puma (>= 3.12.2) rack (>= 2.0.8) rack-cors (>= 1.0.4) - rails (~> 5.2.1) + rails (>= 6.0, < 7.0) rspec-core rspec-rails rubyzip (>= 1.3.0) - sentry-raven + sentry-raven (~> 3.1.2) spring - spring-watcher-listen (~> 2.0.0) sqlite3 tzinfo-data diff --git a/config/environments/development.rb b/config/environments/development.rb index ab570d4..a0bbf1e 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -42,8 +42,4 @@ # Raises error for missing translations # config.action_view.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. - config.file_watcher = ActiveSupport::EventedFileUpdateChecker end From cbf9f6158d5609710508e32fb4ad7b9b37433694 Mon Sep 17 00:00:00 2001 From: sylph Date: Wed, 20 Nov 2024 16:02:14 -0800 Subject: [PATCH 3/8] Upgrade rspec-rails --- Gemfile | 3 +- Gemfile.lock | 34 +++++++++---------- .../congress_members_controller_spec.rb | 6 ++-- spec/controllers/fills_controller_spec.rb | 2 +- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/Gemfile b/Gemfile index c3dea4f..e924e92 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,6 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '3.0.6' -# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '>= 6.0', '< 7.0' gem 'rack', '>= 2.0.8' # Use postgresql as the database for Active Record @@ -43,7 +42,7 @@ group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'rspec-core' - gem 'rspec-rails' + gem 'rspec-rails', '~> 5.0' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 498baff..d6819f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -99,7 +99,7 @@ GEM delayed_job (> 2.0.3) rack-protection (>= 1.5.5) sinatra (>= 1.4.4) - diff-lcs (1.3) + diff-lcs (1.5.1) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) dotenv (2.5.0) @@ -204,23 +204,23 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rspec-core (3.8.0) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.1) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-rails (3.8.0) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.0) + rspec-support (~> 3.13.0) + rspec-rails (5.1.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + railties (>= 5.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) + rspec-support (3.13.1) ruby2_keywords (0.0.5) rubyzip (1.3.0) selenium-webdriver (3.142.3) @@ -282,7 +282,7 @@ DEPENDENCIES rack-cors (>= 1.0.4) rails (>= 6.0, < 7.0) rspec-core - rspec-rails + rspec-rails (~> 5.0) rubyzip (>= 1.3.0) sentry-raven (~> 3.1.2) spring diff --git a/spec/controllers/congress_members_controller_spec.rb b/spec/controllers/congress_members_controller_spec.rb index ff7e46d..770fb43 100644 --- a/spec/controllers/congress_members_controller_spec.rb +++ b/spec/controllers/congress_members_controller_spec.rb @@ -43,7 +43,7 @@ post :form_actions, as: :json, body: { bio_ids: Array(senator.bioguide_id) }.to_json - expect(response.content_type).to eq("application/json") + expect(response.content_type).to include("application/json") result = JSON.load(response.body) expect(result).to have_key(senator.bioguide_id) @@ -58,7 +58,7 @@ post :form_actions, as: :json, body: { bio_ids: Array(senator.bioguide_id) }.to_json - expect(response.content_type).to eq("application/json") + expect(response.content_type).to include("application/json") expect(JSON.load(response.body)).to eq({}) end end @@ -67,7 +67,7 @@ it "should respond with an error" do post :form_actions - expect(response.content_type).to eq("application/json") + expect(response.content_type).to include("application/json") result = JSON.load(response.body) expect(result).to include("status" => "error") diff --git a/spec/controllers/fills_controller_spec.rb b/spec/controllers/fills_controller_spec.rb index 942eabf..d6c9229 100644 --- a/spec/controllers/fills_controller_spec.rb +++ b/spec/controllers/fills_controller_spec.rb @@ -46,7 +46,7 @@ [{}, { "bio_id" => senator.bioguide_id }, { "fields" => {} }].each do |params| post :create, as: :json, body: params.to_json - expect(response.content_type).to eq("application/json") + expect(response.content_type).to include("application/json") result = JSON.load(response.body) expect(result).to include("status" => "error") From f3cad67e0e2fbdb744b3ba32bb99536c70a28984 Mon Sep 17 00:00:00 2001 From: sylph Date: Wed, 20 Nov 2024 16:07:05 -0800 Subject: [PATCH 4/8] Upgrade to ruby 3.1 --- .ruby-version | 2 +- Gemfile | 17 ++--------------- Gemfile.lock | 4 ++-- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/.ruby-version b/.ruby-version index 818bd47..9cec716 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.6 +3.1.6 diff --git a/Gemfile b/Gemfile index e924e92..3fa913d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,9 +1,9 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby '3.0.6' +ruby '3.1.6' -gem 'rails', '>= 6.0', '< 7.0' +gem 'rails', '~> 6.1' gem 'rack', '>= 2.0.8' # Use postgresql as the database for Active Record gem 'pg', '>= 0.18', '< 2.0' @@ -21,23 +21,10 @@ gem 'sentry-raven', '~> 3.1.2' gem 'congress_forms', '~> 0.1.14' gem 'groupdate' gem 'rubyzip', '>= 1.3.0' -# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -# gem 'jbuilder', '~> 2.5' -# Use ActiveModel has_secure_password -# gem 'bcrypt', '~> 3.1.7' - -# Use ActiveStorage variant -# gem 'mini_magick', '~> 4.8' - -# Use Capistrano for deployment -# gem 'capistrano-rails', group: :development # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '~> 1.18', require: false -# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible -# gem 'rack-cors' - group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] diff --git a/Gemfile.lock b/Gemfile.lock index d6819f3..f149053 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -280,7 +280,7 @@ DEPENDENCIES puma (>= 3.12.2) rack (>= 2.0.8) rack-cors (>= 1.0.4) - rails (>= 6.0, < 7.0) + rails (~> 6.1) rspec-core rspec-rails (~> 5.0) rubyzip (>= 1.3.0) @@ -290,7 +290,7 @@ DEPENDENCIES tzinfo-data RUBY VERSION - ruby 3.0.6p216 + ruby 3.1.6p260 BUNDLED WITH 2.5.23 From 9f95f437ab9cc018d7607e0a3fb90bf9e94eee20 Mon Sep 17 00:00:00 2001 From: sylph Date: Wed, 20 Nov 2024 16:12:24 -0800 Subject: [PATCH 5/8] Upgrade to ruby 3.2 + pg 1.5.9 --- .ruby-version | 2 +- Gemfile | 2 +- Gemfile.lock | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.ruby-version b/.ruby-version index 9cec716..34cde56 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.6 +3.2.6 diff --git a/Gemfile b/Gemfile index 3fa913d..c0bca07 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby '3.1.6' +ruby file: ".ruby-version" gem 'rails', '~> 6.1' gem 'rack', '>= 2.0.8' diff --git a/Gemfile.lock b/Gemfile.lock index f149053..79c93ca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -157,7 +157,7 @@ GEM nokogiri (1.16.7) mini_portile2 (~> 2.8.2) racc (~> 1.4) - pg (1.1.3) + pg (1.5.9) public_suffix (6.0.1) puma (4.3.1) nio4r (~> 2.0) @@ -290,7 +290,7 @@ DEPENDENCIES tzinfo-data RUBY VERSION - ruby 3.1.6p260 + ruby 3.2.6p234 BUNDLED WITH 2.5.23 From 27c0450d82efe791a866ff4d3b6c6e699d861c1c Mon Sep 17 00:00:00 2001 From: sylph Date: Mon, 6 Jan 2025 13:50:48 -0800 Subject: [PATCH 6/8] Upgrade dockerfile for ruby 3 --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3110900..200e72d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.6 +FROM ruby:3.2 RUN mkdir -p /opt/congress_forms_api WORKDIR /opt/congress_forms_api @@ -19,6 +19,7 @@ RUN apt-get update -y && \ apt-get install -y --no-install-recommends google-chrome-stable COPY Gemfile* ./ +COPY .ruby-version ./ RUN bundle install COPY . . From de770b42c085f814a114092aae6541e93e322d63 Mon Sep 17 00:00:00 2001 From: Starchy Grant Date: Fri, 17 Jan 2025 11:34:49 -0800 Subject: [PATCH 7/8] Enable CI for branches --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb509bf..67cbdc2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,5 +15,3 @@ build: - git clone --depth 1 https://github.com/unitedstates/contact-congress contact_congress - docker build --pull --no-cache --label "repo=$CI_PROJECT_URL" -t $IMAGE_NAME . - docker push $IMAGE_NAME - only: - - master From b735b9e6a65268534a111911e056e002ebfd7f9f Mon Sep 17 00:00:00 2001 From: Starchy Grant Date: Fri, 17 Jan 2025 11:48:47 -0800 Subject: [PATCH 8/8] Enable tagged container builds in CI --- .gitlab-ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67cbdc2..2e6c5ca 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ stages: - build variables: - IMAGE_NAME: $CI_REGISTRY_IMAGE:latest + IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG before_script: - env @@ -15,3 +15,13 @@ build: - git clone --depth 1 https://github.com/unitedstates/contact-congress contact_congress - docker build --pull --no-cache --label "repo=$CI_PROJECT_URL" -t $IMAGE_NAME . - docker push $IMAGE_NAME + - | + if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then + docker tag "$IMAGE_NAME" "$CI_REGISTRY_IMAGE:latest" + docker push "$CI_REGISTRY_IMAGE:latest" + fi + # Run this job in a branch where a Dockerfile exists + rules: + - if: $CI_COMMIT_BRANCH + exists: + - Dockerfile