diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 260a1f55..908fedeb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,9 @@ jobs: sudo sysctl -w fs.file-max=262144 sudo sysctl -w vm.max_map_count=262144 - - uses: getong/elasticsearch-action@v1.2 + - uses: ankane/setup-opensearch@v1 with: - elasticsearch version: '7.6.1' + opensearch-version: 1.2 host port: 9200 container port: 9200 host node port: 9300 diff --git a/Gemfile.lock b/Gemfile.lock index fc0cfff8..54cbd741 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,34 +60,35 @@ GEM minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - addressable (2.7.0) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) ast (2.4.2) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) - bootsnap (1.7.4) - msgpack (~> 1.0) - brakeman (5.0.1) + bootsnap (1.10.3) + msgpack (~> 1.2) + brakeman (5.2.1) browser (5.3.1) builder (3.2.4) byebug (11.1.3) - capybara (3.35.3) + capybara (3.36.0) addressable + matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - childprocess (3.0.0) + childprocess (4.1.0) coderay (1.1.3) - concurrent-ruby (1.1.8) + concurrent-ruby (1.1.9) crack (0.4.5) rexml crass (1.0.6) debug_inspector (1.1.0) - diff-lcs (1.4.4) - docile (1.3.5) + diff-lcs (1.5.0) + docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) elasticsearch (7.11.2) @@ -95,72 +96,93 @@ GEM elasticsearch-transport (= 7.11.2) elasticsearch-api (7.11.2) multi_json - elasticsearch-model (7.1.1) + elasticsearch-model (7.2.0) activesupport (> 3) - elasticsearch (> 1) + elasticsearch (~> 7) hashie - elasticsearch-rails (7.1.1) + elasticsearch-rails (7.2.0) elasticsearch-transport (7.11.2) faraday (~> 1) multi_json erubi (1.10.0) - execjs (2.7.0) - factory_bot (6.1.0) + execjs (2.8.1) + factory_bot (6.2.0) activesupport (>= 5.0.0) - faraday (1.4.1) + faraday (1.10.0) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) - multipart-post (>= 1.2, < 3) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.3) + multipart-post (>= 1.2, < 3) faraday-net_http (1.0.1) - faraday-net_http_persistent (1.1.0) - faraday_middleware (1.0.0) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) faraday (~> 1.0) - ffi (1.15.0) - globalid (0.4.2) - activesupport (>= 4.2.0) - govuk_app_config (3.0.0) + ffi (1.15.5) + globalid (1.0.0) + activesupport (>= 5.0) + govuk_app_config (4.3.0) logstasher (>= 1.2.2, < 2.2.0) - sentry-raven (~> 3.1.1) + 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.0) + govuk_frontend_toolkit (9.0.1) railties (>= 3.1.0) - sass (>= 3.2.0) - govuk_publishing_components (24.10.0) + govuk_personalisation (0.11.2) + plek (>= 1.9.0) + rails (>= 6, < 8) + govuk_publishing_components (28.6.0) govuk_app_config + govuk_personalisation (>= 0.7.0) kramdown plek - rails (>= 5.0.0.1) + rails (~> 6) rouge sprockets (< 4) - govuk_test (1.0.2) + govuk_test (2.3.0) + brakeman (>= 5.0.2) capybara puma selenium-webdriver (>= 3.142) webdrivers (>= 4) hashdiff (1.0.1) - hashie (4.1.0) + hashie (5.0.0) htmlentities (4.3.4) http-accept (1.7.0) - http-cookie (1.0.3) + http-cookie (1.0.4) domain_name (~> 0.5) - i18n (1.8.10) + i18n (1.10.0) concurrent-ruby (~> 1.0) inflection (1.0.0) - jbuilder (2.11.2) + jbuilder (2.11.5) + actionview (>= 5.0.0) activesupport (>= 5.0.0) jquery-rails (4.4.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (2.5.1) + json (2.6.1) kaminari (1.1.1) activesupport (>= 4.1.0) kaminari-actionview (= 1.1.1) @@ -173,10 +195,10 @@ GEM activerecord kaminari-core (= 1.1.1) kaminari-core (1.1.1) - kgio (2.11.3) + kgio (2.11.4) kramdown (2.3.1) rexml - listen (3.5.1) + listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) lograge (0.11.2) @@ -188,32 +210,33 @@ GEM logstasher (2.1.5) activesupport (>= 5.2) request_store - loofah (2.9.1) + loofah (2.14.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (1.0.1) + marcel (1.0.2) + matrix (0.4.2) method_source (1.0.0) - mime-types (3.3.1) + mime-types (3.4.1) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0225) + mime-types-data (3.2022.0105) mini_mime (1.0.3) - mini_portile2 (2.5.1) - minitest (5.14.4) - msgpack (1.4.2) + mini_portile2 (2.8.0) + minitest (5.15.0) + msgpack (1.4.5) multi_json (1.15.0) multipart-post (2.1.1) netrc (0.11.0) - nio4r (2.5.7) - nokogiri (1.11.3) - mini_portile2 (~> 2.5.0) + nio4r (2.5.8) + nokogiri (1.13.3) + mini_portile2 (~> 2.8.0) racc (~> 1.4) - parallel (1.20.1) - parser (3.0.1.1) + parallel (1.21.0) + parser (3.1.1.0) ast (~> 2.4.1) parslet (2.0.0) - pg (1.2.3) + pg (1.3.2) plek (4.0.0) pry (0.14.1) coderay (~> 1.1) @@ -225,9 +248,9 @@ GEM binding_of_caller (~> 1.0) pry (~> 0.13) public_suffix (4.0.6) - puma (5.2.2) + puma (5.6.2) nio4r (~> 2.0) - racc (1.5.2) + racc (1.6.0) rack (2.2.3) rack-test (1.1.0) rack (>= 1.0, < 3) @@ -249,7 +272,7 @@ GEM 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 (6.1.3.1) actionpack (= 6.1.3.1) @@ -257,15 +280,15 @@ GEM method_source rake (>= 0.8.7) thor (~> 1.0) - rainbow (3.0.0) - raindrops (0.19.1) - rake (13.0.3) - rb-fsevent (0.10.4) + rainbow (3.1.1) + raindrops (0.20.0) + rake (13.0.6) + rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) redcarpet (3.5.1) - regexp_parser (2.1.1) - request_store (1.5.0) + regexp_parser (2.2.1) + request_store (1.5.1) rack (>= 1.4) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) @@ -273,20 +296,20 @@ GEM mime-types (>= 1.16, < 4.0) netrc (~> 0.8) rexml (3.2.5) - rouge (3.26.0) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rouge (3.28.0) + rspec (3.11.0) + rspec-core (~> 3.11.0) + rspec-expectations (~> 3.11.0) + rspec-mocks (~> 3.11.0) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.11.0) + rspec-mocks (3.11.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-rails (5.0.1) + rspec-support (~> 3.11.0) + rspec-rails (5.1.0) actionpack (>= 5.2) activesupport (>= 5.2) railties (>= 5.2) @@ -294,36 +317,35 @@ GEM rspec-expectations (~> 3.10) rspec-mocks (~> 3.10) rspec-support (~> 3.10) - rspec-support (3.10.2) - rubocop (1.15.0) + rspec-support (3.11.0) + rubocop (1.25.0) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 1.5.0, < 2.0) + rubocop-ast (>= 1.15.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.6.0) + rubocop-ast (1.15.1) parser (>= 3.0.1.1) - rubocop-govuk (4.0.0) - rubocop (~> 1.15.0) - rubocop-ast (~> 1.6.0) - rubocop-rails (~> 2.10.0) - rubocop-rake (= 0.5.1) - rubocop-rspec (~> 2.3.0) - rubocop-rails (2.10.1) + rubocop-govuk (4.3.0) + rubocop (= 1.25.0) + rubocop-ast (= 1.15.1) + rubocop-rails (= 2.13.2) + rubocop-rake (= 0.6.0) + rubocop-rspec (= 2.7.0) + rubocop-rails (2.13.2) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) - rubocop-rake (0.5.1) - rubocop - rubocop-rspec (2.3.0) + rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-ast (>= 1.1.0) + rubocop-rspec (2.7.0) + rubocop (~> 1.19) ruby-progressbar (1.11.0) - ruby2_keywords (0.0.4) - rubyzip (2.3.0) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) @@ -339,12 +361,23 @@ GEM sprockets (> 3.0) sprockets-rails tilt - secure_headers (6.3.2) - selenium-webdriver (3.142.7) - childprocess (>= 0.5, < 4.0) + secure_headers (6.3.3) + selenium-webdriver (4.1.0) + childprocess (>= 0.5, < 5.0) + rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2) + sentry-rails (4.5.2) + railties (>= 5.0) + sentry-ruby-core (~> 4.5.0) sentry-raven (3.1.2) faraday (>= 1.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) @@ -359,12 +392,12 @@ GEM sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) statsd-ruby (1.5.0) - thor (1.1.0) + thor (1.2.1) tilt (2.0.10) tzinfo (2.0.4) concurrent-ruby (~> 1.0) @@ -372,28 +405,28 @@ GEM execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext - unf_ext (0.0.7.7) - unicode-display_width (2.0.0) + unf_ext (0.0.8) + unicode-display_width (2.1.0) unicorn (5.8.0) kgio (~> 2.6) raindrops (~> 0.7) - webdrivers (4.6.0) + webdrivers (5.0.0) nokogiri (~> 1.6) rubyzip (>= 1.3.0) - selenium-webdriver (>= 3.0, < 4.0) - webmock (3.12.2) - addressable (>= 2.3.6) + selenium-webdriver (~> 4.0) + webmock (3.14.0) + addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - websocket-driver (0.7.3) + websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.4.2) - zendesk_api (1.29.0) + zeitwerk (2.5.4) + zendesk_api (1.35.0) faraday (>= 0.9.0, < 2.0.0) - hashie (>= 3.5.2, < 5.0.0) + hashie (>= 3.5.2, < 6.0.0) inflection mini_mime multipart-post (~> 2.0) diff --git a/config/application.rb b/config/application.rb index b30b78b6..c4c7c8c1 100644 --- a/config/application.rb +++ b/config/application.rb @@ -58,7 +58,7 @@ class Application < Rails::Application config.filter_parameters << :password config.filter_parameters << :password_confirmation - config.elasticsearch = config_for(:elasticsearch) + config.elasticsearch = config_for(:opensearch) config.ssl_options = { hsts: { expires: 1.week } } diff --git a/config/initializers/elasticsearch.rb b/config/initializers/elasticsearch.rb index 652668d7..1a2e71b7 100644 --- a/config/initializers/elasticsearch.rb +++ b/config/initializers/elasticsearch.rb @@ -4,10 +4,10 @@ if host.blank? vcap = JSON.parse(es_config[:vcap_services]) - host = vcap.dig("elasticsearch", 0, "credentials", "uri") + host = vcap.dig("opensearch", 0, "credentials", "uri") end -raise StandardError, "No elasticsearch environment variables found" if host.blank? +raise StandardError, "No opensearch environment variables found" if host.blank? Elasticsearch::Model.client = Elasticsearch::Client.new( host: host, diff --git a/config/elasticsearch.yml b/config/opensearch.yml similarity index 100% rename from config/elasticsearch.yml rename to config/opensearch.yml diff --git a/integration-manifest.yml b/integration-manifest.yml index 6e093575..08561ad3 100644 --- a/integration-manifest.yml +++ b/integration-manifest.yml @@ -15,5 +15,5 @@ applications: GOVUK_WEBSITE_ROOT: https://www.gov.uk services: - find-integration-secrets - - elasticsearch-7-integration + - opensearch-integration - logit-ssl-drain diff --git a/production-manifest.yml b/production-manifest.yml index 9ccd623b..7a6dc262 100644 --- a/production-manifest.yml +++ b/production-manifest.yml @@ -16,5 +16,5 @@ applications: GOVUK_WEBSITE_ROOT: https://www.gov.uk services: - find-production-secrets - - elasticsearch-7-production + - opensearch-production - logit-ssl-drain diff --git a/staging-manifest.yml b/staging-manifest.yml index dd523361..cb8e1c82 100644 --- a/staging-manifest.yml +++ b/staging-manifest.yml @@ -16,5 +16,5 @@ applications: GOVUK_WEBSITE_ROOT: https://www.gov.uk services: - find-staging-secrets - - elasticsearch-7-staging + - opensearch-staging - logit-ssl-drain