diff --git a/services/backend/Dockerfile b/services/backend/Dockerfile index 6884dbe9..8094f2f2 100644 --- a/services/backend/Dockerfile +++ b/services/backend/Dockerfile @@ -1,9 +1,18 @@ -FROM ruby:3.0.3 +FROM ruby:3.1.7 RUN apt-get update -yq \ && apt-get upgrade -yq \ - #ESSENTIALS - && apt-get install -y -qq --no-install-recommends build-essential curl git-core vim passwd unzip cron gcc wget netcat imagemagick postgresql-client wait-for-it \ + # ESSENTIALS + && apt-get install -y -qq --no-install-recommends \ + build-essential \ + gcc \ + git \ + curl \ + wget \ + netcat-traditional \ + imagemagick \ + postgresql-client \ + wait-for-it \ # INSTALL NODE && curl -sL https://deb.nodesource.com/setup_20.x | bash - \ && apt-get install -y --no-install-recommends nodejs \ @@ -15,23 +24,18 @@ RUN apt-get clean -qy \ && rm -rf /var/lib/apt/lists/* WORKDIR /app - -# install specific version of bundler -RUN gem install bundler -v 2.2.32 - ARG DD_GIT_REPOSITORY_URL ARG DD_GIT_COMMIT_SHA ENV BUNDLE_GEMFILE=/app/Gemfile \ - BUNDLE_JOBS=20 \ - BUNDLE_PATH=/bundle \ - BUNDLE_BIN=/bundle/bin \ - GEM_HOME=/bundle \ - # Default environment variables - RAILS_ENV=production \ - REDIS_URL=redis://redis:6379/0 \ - DB_HOST=postgres \ - DB_PORT=5432 \ + BUNDLE_JOBS=20 \ + BUNDLE_BIN=/bundle/bin \ + GEM_HOME=/bundle \ + # Default environment variables + RAILS_ENV=production \ + REDIS_URL=redis://redis:6379/0 \ + DB_HOST=postgres \ + DB_PORT=5432 \ POSTGRES_PASSWORD=postgres \ POSTGRES_USER=postgres \ DB_POOL=25 \ @@ -50,4 +54,4 @@ RUN npm run build EXPOSE 4000 -CMD ["/bin/bash", "-c", "rm -f /app/tmp/pids/server.pid && bundle exec ddprofrb exec rails s -b 0.0.0.0 -p 4000"] +CMD ["/bin/bash", "-c", "rm -f /app/tmp/pids/server.pid && bundle exec rails s -b 0.0.0.0 -p 4000"] diff --git a/services/backend/Gemfile b/services/backend/Gemfile index 5374dd54..bb85268c 100644 --- a/services/backend/Gemfile +++ b/services/backend/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -ruby '3.0.3' +ruby '3.1.7' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.1.4' @@ -73,9 +73,6 @@ gem 'spree_auth_devise' gem 'spree_i18n', '>= 5.0' gem 'spree_dev_tools', require: false, group: %w[test development] -# Sentry Client -gem 'sentry-raven' - # Rack CORS Middleware gem 'rack-cors' @@ -93,12 +90,17 @@ gem 'oj' # Fix SCSS errors with Ruby 3 on MacOS gem 'sassc', github: 'sass/sassc-ruby', group: :development +# Required for Ruby 3.1.7 +gem 'net-smtp' +gem 'net-pop' +gem 'net-imap' + +# JSON log formatter +gem 'lograge' + # monitoring gem 'datadog', '~> 2.18.0', require: 'datadog/auto_instrument' # needed for Datadog Continuous Profiler gem 'google-protobuf', '~> 4.30' # needed for runtime metrics gem 'dogstatsd-ruby', '~> 5.6', require: 'datadog/statsd' - -# JSON log formatter -gem 'lograge' diff --git a/services/backend/Gemfile.lock b/services/backend/Gemfile.lock index 611f5216..cf9cb0b5 100644 --- a/services/backend/Gemfile.lock +++ b/services/backend/Gemfile.lock @@ -133,7 +133,7 @@ GEM babel-source (>= 4.0, < 6) execjs (~> 2.0) bcrypt (3.1.16) - bigdecimal (3.1.9) + bigdecimal (3.2.2) bindex (0.8.1) bootsnap (1.10.2) msgpack (~> 1.2) @@ -174,13 +174,14 @@ GEM activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - datadog (2.12.2) - datadog-ruby_core_source (~> 3.4) - libdatadog (~> 16.0.1.1.0) - libddwaf (~> 1.18.0.0.1) + datadog (2.18.0) + datadog-ruby_core_source (~> 3.4, >= 3.4.1) + libdatadog (~> 18.1.0.1.0) + libddwaf (~> 1.24.1.0.0) logger msgpack datadog-ruby_core_source (3.4.1) + date (3.4.1) devise (4.8.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -248,7 +249,7 @@ GEM globalid (1.0.0) activesupport (>= 5.0) glyphicons (1.0.2) - google-protobuf (4.30.1-aarch64-linux) + google-protobuf (4.31.1-x86_64-linux-gnu) bigdecimal rake (>= 13) hashdiff (1.0.1) @@ -300,8 +301,8 @@ GEM addressable (~> 2.7) letter_opener (1.7.0) launchy (~> 2.2) - libdatadog (16.0.1.1.0-aarch64-linux) - libddwaf (1.18.0.0.1-aarch64-linux) + libdatadog (18.1.0.1.0-x86_64-linux) + libddwaf (1.24.1.0.0-x86_64-linux) ffi (~> 1.0) listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) @@ -322,7 +323,6 @@ GEM method_source (1.0.0) mini_magick (4.11.0) mini_mime (1.1.2) - mini_portile2 (2.8.0) minitest (5.15.0) monetize (1.12.0) money (~> 6.12) @@ -331,9 +331,17 @@ GEM msgpack (1.4.4) multi_json (1.15.0) multipart-post (2.1.1) + net-imap (0.5.9) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol nio4r (2.5.8) - nokogiri (1.13.3) - mini_portile2 (~> 2.8.0) + nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) octokit (4.22.0) faraday (>= 0.9) @@ -639,6 +647,7 @@ GEM thor (1.2.1) tilt (2.0.10) timecop (0.9.4) + timeout (0.4.3) timers (4.3.3) tinymce-rails (5.10.2) railties (>= 3.1.1) @@ -674,7 +683,7 @@ GEM zeitwerk (2.5.3) PLATFORMS - ruby + x86_64-linux DEPENDENCIES activerecord-nulldb-adapter @@ -682,7 +691,7 @@ DEPENDENCIES aws-sdk-s3 bootsnap dalli - datadog (~> 2.12.2) + datadog (~> 2.18.0) dogstatsd-ruby (~> 5.6) dotenv-rails (~> 2.1, >= 2.1.1) font_assets @@ -690,6 +699,9 @@ DEPENDENCIES letter_opener listen lograge + net-imap + net-pop + net-smtp oj pg puma @@ -719,7 +731,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 3.0.3p157 + ruby 3.1.7 BUNDLED WITH - 2.2.32 + 2.3.27 diff --git a/services/backend/app.json b/services/backend/app.json index 97d08207..3bea717c 100644 --- a/services/backend/app.json +++ b/services/backend/app.json @@ -32,7 +32,6 @@ "heroku-postgresql", "rediscloud", "sendgrid", - "sentry", "scout" ] } diff --git a/services/backend/app/jobs/sentry_job.rb b/services/backend/app/jobs/sentry_job.rb deleted file mode 100644 index 180caa89..00000000 --- a/services/backend/app/jobs/sentry_job.rb +++ /dev/null @@ -1,7 +0,0 @@ -class SentryJob < ApplicationJob - queue_as :sentry - - def perform(event) - Raven.send_event(event) - end -end diff --git a/services/backend/app/models/.keep b/services/backend/app/models/.keep new file mode 100644 index 00000000..e69de29b diff --git a/services/backend/config/initializers/raven.rb b/services/backend/config/initializers/raven.rb deleted file mode 100644 index 4ca93a48..00000000 --- a/services/backend/config/initializers/raven.rb +++ /dev/null @@ -1,7 +0,0 @@ -Raven.configure do |config| - config.async = lambda { |event| SentryJob.perform_later(event) } - config.environments = %w[ production ] - config.excluded_exceptions += ['ActionController::RoutingError', 'ActiveRecord::RecordNotFound', - 'Rack::Timeout::RequestExpiryError', 'Rack::Timeout::RequestTimeoutException'] - config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s) -end diff --git a/services/backend/config/sidekiq.yml b/services/backend/config/sidekiq.yml index 1c576ee8..8741febf 100644 --- a/services/backend/config/sidekiq.yml +++ b/services/backend/config/sidekiq.yml @@ -5,7 +5,6 @@ :queues: - default - mailers - - sentry - active_storage_analysis - spree_stock_location_stock_items - spree_webhooks