Skip to content

Commit

Permalink
Merge pull request #1155 from alphagov/revert-1154-update-ruby-versio…
Browse files Browse the repository at this point in the history
…n-to-3-2-0

Revert "Update Ruby version to 3.2.0"
  • Loading branch information
robinjam authored Mar 21, 2023
2 parents 6cb2094 + 5dc57c7 commit 6945355
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.0
2.7.6
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.2.0
FROM ruby:2.7.6

WORKDIR /srv/app/datagovuk_find

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ gem "govuk_publishing_components"
gem "htmlentities"
gem "jbuilder"
gem "jquery-rails"
gem "kaminari"
gem "kaminari", "< 1.2" # do not upgrade this unless elasticsearch is also upgraded
gem "lograge"
gem "logstash-event"
gem "mime-types"
Expand Down
93 changes: 38 additions & 55 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ GEM
debug_inspector (>= 0.0.1)
bootsnap (1.10.3)
msgpack (~> 1.2)
brakeman (5.4.1)
brakeman (5.2.1)
browser (5.3.1)
builder (3.2.4)
byebug (11.1.3)
Expand All @@ -86,7 +86,6 @@ GEM
crack (0.4.5)
rexml
crass (1.0.6)
date (3.3.3)
debug_inspector (1.1.0)
diff-lcs (1.5.0)
docile (1.4.0)
Expand Down Expand Up @@ -137,33 +136,30 @@ GEM
ffi (1.15.5)
globalid (1.0.0)
activesupport (>= 5.0)
govuk_app_config (5.1.0)
logstasher (~> 2.1)
plek (>= 4, < 6)
prometheus_exporter (~> 2.0)
puma (>= 5.6, < 7.0)
rack-proxy (~> 0.7)
sentry-rails (~> 5.3)
sentry-ruby (~> 5.3)
statsd-ruby (~> 1.5)
unicorn (~> 6.1)
govuk_app_config (4.3.0)
logstasher (>= 1.2.2, < 2.2.0)
puma (~> 5.0)
sentry-rails (~> 4.5.0)
sentry-ruby (~> 4.5.0)
statsd-ruby (~> 1.5.0)
unicorn (>= 5.4, < 5.9)
govuk_elements_rails (3.1.3)
govuk_frontend_toolkit (>= 6.0.2)
rails (>= 4.1.0)
sass (>= 3.2.0)
govuk_frontend_toolkit (9.0.1)
railties (>= 3.1.0)
govuk_personalisation (0.13.0)
govuk_personalisation (0.11.2)
plek (>= 1.9.0)
rails (>= 6, < 8)
govuk_publishing_components (35.0.0)
govuk_publishing_components (28.6.0)
govuk_app_config
govuk_personalisation (>= 0.7.0)
kramdown
plek
rails (>= 6)
rails (~> 6)
rouge
sprockets (>= 3)
sprockets (< 4)
govuk_test (2.3.0)
brakeman (>= 5.0.2)
capybara
Expand All @@ -187,20 +183,20 @@ GEM
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.6.2)
kaminari (1.2.2)
kaminari (1.1.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
kaminari-activerecord (= 1.2.2)
kaminari-core (= 1.2.2)
kaminari-actionview (1.2.2)
kaminari-actionview (= 1.1.1)
kaminari-activerecord (= 1.1.1)
kaminari-core (= 1.1.1)
kaminari-actionview (1.1.1)
actionview
kaminari-core (= 1.2.2)
kaminari-activerecord (1.2.2)
kaminari-core (= 1.1.1)
kaminari-activerecord (1.1.1)
activerecord
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
kaminari-core (= 1.1.1)
kaminari-core (1.1.1)
kgio (2.11.4)
kramdown (2.4.0)
kramdown (2.3.1)
rexml
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
Expand All @@ -217,11 +213,8 @@ GEM
loofah (2.18.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.8.1)
mail (2.7.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
Expand All @@ -234,28 +227,17 @@ GEM
msgpack (1.4.5)
multi_json (1.15.0)
multipart-post (2.1.1)
net-imap (0.3.4)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
timeout
net-smtp (0.3.3)
net-protocol
netrc (0.11.0)
nio4r (2.5.8)
nokogiri (1.14.2)
nokogiri (1.13.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
parallel (1.22.1)
parser (3.1.2.1)
ast (~> 2.4.1)
parslet (2.0.0)
pg (1.3.2)
plek (5.0.0)
prometheus_exporter (2.0.8)
webrick
plek (4.0.0)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
Expand All @@ -270,8 +252,6 @@ GEM
nio4r (~> 2.0)
racc (1.6.0)
rack (2.2.4)
rack-proxy (0.7.6)
rack
rack-test (2.0.2)
rack (>= 1.3)
rails (6.1.6.1)
Expand Down Expand Up @@ -301,7 +281,7 @@ GEM
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
raindrops (0.20.1)
raindrops (0.20.0)
rake (13.0.6)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
Expand All @@ -316,7 +296,7 @@ GEM
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.5)
rouge (4.1.0)
rouge (3.28.0)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
Expand Down Expand Up @@ -387,13 +367,18 @@ GEM
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
sentry-rails (5.8.0)
sentry-rails (4.5.2)
railties (>= 5.0)
sentry-ruby (~> 5.8.0)
sentry-ruby-core (~> 4.5.0)
sentry-raven (3.1.2)
faraday (>= 1.0)
sentry-ruby (5.8.0)
sentry-ruby (4.5.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
faraday (>= 1.0)
sentry-ruby-core (= 4.5.2)
sentry-ruby-core (4.5.2)
concurrent-ruby
faraday
simplecov (0.17.1)
docile (~> 1.1)
json (>= 1.8, < 3)
Expand All @@ -415,7 +400,6 @@ GEM
statsd-ruby (1.5.0)
thor (1.2.1)
tilt (2.0.10)
timeout (0.3.2)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
Expand All @@ -424,7 +408,7 @@ GEM
unf_ext
unf_ext (0.0.8)
unicode-display_width (2.2.0)
unicorn (6.1.0)
unicorn (5.8.0)
kgio (~> 2.6)
raindrops (~> 0.7)
webdrivers (5.0.0)
Expand All @@ -435,7 +419,6 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.8.1)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand Down Expand Up @@ -471,7 +454,7 @@ DEPENDENCIES
htmlentities
jbuilder
jquery-rails
kaminari
kaminari (< 1.2)
lograge
logstash-event
mime-types
Expand Down Expand Up @@ -500,7 +483,7 @@ DEPENDENCIES
zendesk_api

RUBY VERSION
ruby 3.2.0p0
ruby 2.7.6p219

BUNDLED WITH
2.1.4
2 changes: 1 addition & 1 deletion app/controllers/legacy/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def redirect
licence: licence_param,
}.compact

redirect_to search_path(q: params["q"], filters:)
redirect_to search_path(q: params["q"], filters: filters)
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/models/datafile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ def wfs?
end

def preview
@preview ||= Preview.new(url:, format:)
@preview ||= Preview.new(url: url, format: format)
end
end
8 changes: 4 additions & 4 deletions app/services/search/query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def self.by_legacy_name(legacy_name)
query: {
constant_score: {
filter: {
term: { legacy_name: },
term: { legacy_name: legacy_name },
},
},
},
Expand All @@ -197,7 +197,7 @@ def self.by_uuid(uuid)
query: {
constant_score: {
filter: {
term: { uuid: },
term: { uuid: uuid },
},
},
},
Expand Down Expand Up @@ -285,7 +285,7 @@ def self.organisation_category_filter(organisation_category, boost: 2)
term: {
"organisation.category.keyword" => {
value: organisation_category,
boost:,
boost: boost,
},
},
},
Expand All @@ -302,7 +302,7 @@ def self.organisation_title_filter(organisation_title, boost: 2)
"organisation.title.english" => {
query: organisation_title,
analyzer: "english",
boost:,
boost: boost,
},
},
},
Expand Down
22 changes: 22 additions & 0 deletions config/brakeman.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"ignored_warnings": [
{
"warning_type": "Unmaintained Dependency",
"warning_code": 123,
"fingerprint": "870fa4a5cfd770898e1b7a159368b4210fe366634512563f9fb1c1cbbfef1d78",
"check_name": "EOLRuby",
"message": "Support for Ruby 2.7.6 ends on 2023-03-31",
"file": "Gemfile.lock",
"line": 257,
"link": "https://brakemanscanner.org/docs/warning_types/unmaintained_dependency/",
"code": null,
"render_path": null,
"location": null,
"user_input": null,
"confidence": "Medium",
"note": "CI won't pass with this warning enabled, preventing us from deploying"
}
],
"updated": "2023-03-21 15:53:39 +0000",
"brakeman_version": "5.2.1"
}
2 changes: 1 addition & 1 deletion config/initializers/elasticsearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
raise StandardError, "No opensearch environment variables found" if host.blank?

Elasticsearch::Model.client = Elasticsearch::Client.new(
host:,
host: host,
transport_options: {
request: {
timeout: es_config.fetch(:elastic_timeout),
Expand Down
2 changes: 1 addition & 1 deletion spec/services/search/phrase_clause_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

let(:phrase) { double }

it { is_expected.to have_attributes(phrase:) }
it { is_expected.to have_attributes(phrase: phrase) }
end
2 changes: 1 addition & 1 deletion spec/services/search/terms_clause_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

let(:terms) { double }

it { is_expected.to have_attributes(terms:) }
it { is_expected.to have_attributes(terms: terms) }
end

0 comments on commit 6945355

Please sign in to comment.