Skip to content

Commit

Permalink
SRCH-2152 Update to Rails 6.1 (#101)
Browse files Browse the repository at this point in the history
* SRCH-2212 Upgrade ASIS Rails 6.0 to 6.1

* SRCH-2213 Update Asis Rails 5.2 to 6.0 (#93)

* SRCH-2185 Use zeitwerk

* SRCH-2186 Remove airbrake from ASIS

* SRCH-2187 Update newrelic_rpm in ASIS (this was done first on master, then merged into rails-6)

* SRCH-2433 Finalize and release ASIS cookbook changes.

See tickets for each of the subtasks for more details.
  • Loading branch information
MothOnMars authored Aug 26, 2021
1 parent 30707f4 commit d5e30c5
Show file tree
Hide file tree
Showing 30 changed files with 183 additions and 256 deletions.
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ git_source(:github) do |repo_name|
"https://github.com/#{repo_name}.git"
end

gem 'rails', '~> 5.2.0'
gem 'rails', '~> 6.1.0'

gem 'rake', '~> 12.3.2'

Expand All @@ -34,7 +34,6 @@ gem 'sidekiq-unique-jobs', '3.0.11' # sidekiq-unique-jobs > 3.0.11 broke spec
gem 'sinatra', '~> 2.0.2', require: nil
gem 'whenever', '~> 0.9.4', require: false

gem 'airbrake', '~> 7.1.1'
gem 'newrelic_rpm', '~> 6.15.0'

gem 'feedjira', '~> 2.2.0'
Expand Down
158 changes: 87 additions & 71 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,53 +1,67 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.6)
actionpack (= 5.2.6)
actioncable (6.1.4.1)
actionpack (= 6.1.4.1)
activesupport (= 6.1.4.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
actionmailbox (6.1.4.1)
actionpack (= 6.1.4.1)
activejob (= 6.1.4.1)
activerecord (= 6.1.4.1)
activestorage (= 6.1.4.1)
activesupport (= 6.1.4.1)
mail (>= 2.7.1)
actionmailer (6.1.4.1)
actionpack (= 6.1.4.1)
actionview (= 6.1.4.1)
activejob (= 6.1.4.1)
activesupport (= 6.1.4.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.6)
actionview (= 5.2.6)
activesupport (= 5.2.6)
rack (~> 2.0, >= 2.0.8)
actionpack (6.1.4.1)
actionview (= 6.1.4.1)
activesupport (= 6.1.4.1)
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)
activesupport (= 5.2.6)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.4.1)
actionpack (= 6.1.4.1)
activerecord (= 6.1.4.1)
activestorage (= 6.1.4.1)
activesupport (= 6.1.4.1)
nokogiri (>= 1.8.5)
actionview (6.1.4.1)
activesupport (= 6.1.4.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.6)
activesupport (= 5.2.6)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.4.1)
activesupport (= 6.1.4.1)
globalid (>= 0.3.6)
activemodel (5.2.6)
activesupport (= 5.2.6)
activerecord (5.2.6)
activemodel (= 5.2.6)
activesupport (= 5.2.6)
arel (>= 9.0)
activestorage (5.2.6)
actionpack (= 5.2.6)
activerecord (= 5.2.6)
activemodel (6.1.4.1)
activesupport (= 6.1.4.1)
activerecord (6.1.4.1)
activemodel (= 6.1.4.1)
activesupport (= 6.1.4.1)
activestorage (6.1.4.1)
actionpack (= 6.1.4.1)
activejob (= 6.1.4.1)
activerecord (= 6.1.4.1)
activesupport (= 6.1.4.1)
marcel (~> 1.0.0)
activesupport (5.2.6)
mini_mime (>= 1.1.0)
activesupport (6.1.4.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
airbrake (7.1.1)
airbrake-ruby (~> 2.5)
airbrake-ruby (2.12.0)
arel (9.0.0)
ast (2.4.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
Expand Down Expand Up @@ -134,7 +148,7 @@ GEM
sax-machine (>= 1.0)
ffi (1.15.3)
flickraw (0.9.10)
globalid (0.5.1)
globalid (0.5.2)
activesupport (>= 5.0)
grape (1.3.3)
activesupport
Expand Down Expand Up @@ -170,15 +184,15 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.10.0)
loofah (2.12.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.1)
method_source (1.0.0)
mini_mime (1.1.0)
mini_portile2 (2.5.3)
mini_mime (1.1.1)
mini_portile2 (2.6.1)
minitest (5.14.4)
mock_redis (0.17.3)
multi_json (1.15.0)
Expand All @@ -191,9 +205,9 @@ GEM
net-ssh (>= 2.6.5, < 7.0.0)
net-ssh (6.1.0)
newrelic_rpm (6.15.0)
nio4r (2.5.7)
nokogiri (1.11.7)
mini_portile2 (~> 2.5.0)
nio4r (2.5.8)
nokogiri (1.12.3)
mini_portile2 (~> 2.6.1)
racc (~> 1.4)
parallel (1.20.1)
parser (3.0.2.0)
Expand All @@ -204,7 +218,7 @@ GEM
pry-rails (0.3.9)
pry (>= 0.10.4)
public_suffix (4.0.6)
puma (5.3.2)
puma (5.4.0)
nio4r (~> 2.0)
racc (1.5.2)
rack (2.2.3)
Expand All @@ -214,30 +228,32 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.6)
actioncable (= 5.2.6)
actionmailer (= 5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
activemodel (= 5.2.6)
activerecord (= 5.2.6)
activestorage (= 5.2.6)
activesupport (= 5.2.6)
bundler (>= 1.3.0)
railties (= 5.2.6)
rails (6.1.4.1)
actioncable (= 6.1.4.1)
actionmailbox (= 6.1.4.1)
actionmailer (= 6.1.4.1)
actionpack (= 6.1.4.1)
actiontext (= 6.1.4.1)
actionview (= 6.1.4.1)
activejob (= 6.1.4.1)
activemodel (= 6.1.4.1)
activerecord (= 6.1.4.1)
activestorage (= 6.1.4.1)
activesupport (= 6.1.4.1)
bundler (>= 1.15.0)
railties (= 6.1.4.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
railties (5.2.6)
actionpack (= 5.2.6)
activesupport (= 5.2.6)
railties (6.1.4.1)
actionpack (= 6.1.4.1)
activesupport (= 6.1.4.1)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rake (>= 0.13)
thor (~> 1.0)
rainbow (3.0.0)
rake (12.3.3)
rb-fsevent (0.11.0)
Expand Down Expand Up @@ -279,9 +295,9 @@ GEM
rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.8.0)
rubocop-ast (1.11.0)
parser (>= 3.0.1.1)
rubocop-performance (1.11.4)
rubocop-performance (1.11.5)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.11.3)
Expand All @@ -297,7 +313,7 @@ GEM
ruby2_keywords (0.0.5)
ruby_dep (1.5.0)
sax-machine (1.3.2)
searchgov_style (0.1.9)
searchgov_style (0.1.10)
rubocop (= 1.8.1)
rubocop-performance (~> 1.9)
rubocop-rails (~> 2.9)
Expand All @@ -308,7 +324,7 @@ GEM
rack (~> 2.0)
rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 4.2)
sidekiq-failures (1.0.0)
sidekiq-failures (1.0.1)
sidekiq (>= 4.0.0)
sidekiq-unique-jobs (3.0.11)
sidekiq (>= 2.6)
Expand Down Expand Up @@ -339,8 +355,8 @@ GEM
thor (1.1.0)
thread_safe (0.3.6)
tilt (2.0.10)
tzinfo (1.2.9)
thread_safe (~> 0.1)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
Expand All @@ -349,11 +365,11 @@ GEM
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
web-console (3.7.0)
actionview (>= 5.0)
activemodel (>= 5.0)
web-console (4.1.0)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 5.0)
railties (>= 6.0.0)
webmock (3.5.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
Expand All @@ -363,12 +379,12 @@ GEM
websocket-extensions (0.1.5)
whenever (0.9.7)
chronic (>= 0.6.3)
zeitwerk (2.4.2)

PLATFORMS
ruby

DEPENDENCIES
airbrake (~> 7.1.1)
binding_of_caller
capistrano (~> 3.3.5)
capistrano-bundler (~> 1.1.3)
Expand All @@ -389,7 +405,7 @@ DEPENDENCIES
newrelic_rpm (~> 6.15.0)
pry-rails
puma (~> 5.3)
rails (~> 5.2.0)
rails (~> 6.1.0)
rake (~> 12.3.2)
redis-namespace (~> 1.6.0)
rspec-rails (~> 3.8.2)
Expand Down
6 changes: 2 additions & 4 deletions app/controllers/api/base.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# frozen_string_literal: true

module API
module Api
class Base < Grape::API
rescue_from :all do |e|
Rails.logger.error "#{e.message}\n\n#{e.backtrace.join("\n")}"

Airbrake.notify(e)

Rack::Response.new({ message: e.message, backtrace: e.backtrace }, 500, 'Content-type' => 'application/json').finish
end

mount API::V1::Base
mount Api::V1::Base
end
end
10 changes: 5 additions & 5 deletions app/controllers/api/v1/base.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# frozen_string_literal: true

module API
module Api
module V1
class Base < Grape::API
mount API::V1::InstagramProfiles
mount API::V1::FlickrProfiles
mount API::V1::MrssProfiles
mount API::V1::ImageSearches
mount Api::V1::InstagramProfiles
mount Api::V1::FlickrProfiles
mount Api::V1::MrssProfiles
mount Api::V1::ImageSearches
end
end
end
2 changes: 1 addition & 1 deletion app/controllers/api/v1/flickr_profiles.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module API
module Api
module V1
class FlickrProfiles < Grape::API
version 'v1'
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/image_searches.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module API
module Api
module V1
class ImageSearches < Grape::API
version 'v1'
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/instagram_profiles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Instagram is being decommissioned per
# https://cm-jira.usa.gov/browse/SRCH-50
module API
module Api
module V1
class InstagramProfiles < Grape::API
version 'v1'
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/mrss_profiles.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module API
module Api
module V1
class MrssProfiles < Grape::API
version 'v1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Mrss

attr_accessor :feed_url

REGEX_MATCH = %r{http://purl.org/rss/1.0/modules/content/|http://search.yahoo.com/mrss/}
REGEX_MATCH = %r{http://purl.org/rss/1.0/modules/content/|http://search.yahoo.com/mrss/}.freeze

def self.able_to_parse?(first_2k_xml)
first_2k_xml =~ REGEX_MATCH
Expand Down
Loading

0 comments on commit d5e30c5

Please sign in to comment.