diff --git a/.env.sample b/.env.sample index 0aafbcac..27ea88f1 100644 --- a/.env.sample +++ b/.env.sample @@ -2,3 +2,4 @@ ORGANIZATION_LOGIN= GITHUB_APP_ID= GITHUB_APP_SECRET= NEW_RELIC_LICENSE_KEY= +SENTRY_DSN= diff --git a/.github/workflows/tests-next.yml b/.github/workflows/tests-next.yml index 1a2c5423..9c400317 100644 --- a/.github/workflows/tests-next.yml +++ b/.github/workflows/tests-next.yml @@ -35,7 +35,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: "3.2.2" + ruby-version: "3.2.3" - name: Build App run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 73b6f4d8..4aa80abb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,7 +35,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: "3.2.2" + ruby-version: "3.2.3" bundler-cache: true - name: Build App diff --git a/Gemfile b/Gemfile index 7a49e0ac..91a77681 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ def next? File.basename(__FILE__) == "Gemfile.next" end -ruby "3.2.2" +ruby "3.2.3" git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") @@ -16,7 +16,7 @@ if next? # to make it work with ruby 3.1 # read more about it here: https://github.com/rails/rails/issues/43998, # and here: https://gist.github.com/claudiug/bdc2fb70b10d19513208c816588aed92 - gem "rails", github: "rails/rails", branch: "main" + gem "rails", "~> 7.2.0" else gem "rails", "~> 7.1.0" end @@ -64,6 +64,9 @@ gem "rack-mini-profiler" group :production do gem "newrelic_rpm" gem "terser" + gem "stackprof" + gem "sentry-ruby" + gem "sentry-rails" end group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index db41ef7d..1d4d4de6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -215,6 +215,8 @@ GEM next_rails (1.3.0) colorize (>= 0.8.1) nio4r (2.7.0) + nokogiri (1.16.2-arm64-darwin) + racc (~> 1.4) nokogiri (1.16.2-x86_64-darwin) racc (~> 1.4) nokogiri (1.16.2-x86_64-linux) @@ -375,6 +377,12 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) + sentry-rails (5.22.1) + railties (>= 5.0) + sentry-ruby (~> 5.22.1) + sentry-ruby (5.22.1) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) shoulda-matchers (3.1.3) activesupport (>= 4.0.0) simplecov (0.22.0) @@ -394,6 +402,7 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) + stackprof (0.2.26) standard (1.31.1) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) @@ -442,6 +451,7 @@ GEM zeitwerk (2.6.12) PLATFORMS + arm64-darwin-23 x86_64-darwin-21 x86_64-darwin-22 x86_64-linux @@ -479,9 +489,12 @@ DEPENDENCIES redcarpet (~> 3.5.1) rspec-rails (~> 6.0.3) sass-rails (~> 5.0) + sentry-rails + sentry-ruby shoulda-matchers (~> 3.1) simplecov spring (= 3.0.0) + stackprof standardrb terser turbolinks (~> 5) @@ -490,7 +503,7 @@ DEPENDENCIES webdrivers RUBY VERSION - ruby 3.2.2p53 + ruby 3.2.3p157 BUNDLED WITH 2.4.13 diff --git a/Gemfile.next.lock b/Gemfile.next.lock index 402230be..cb36f3d1 100644 --- a/Gemfile.next.lock +++ b/Gemfile.next.lock @@ -1,116 +1,86 @@ GIT - remote: https://github.com/rails/rails.git - revision: 358d3d3164bef399b19b089f5fed8664a2c3d39e - branch: main + remote: https://github.com/twalpole/apparition.git + revision: 7db58cc6b0e4ca4141b074ff27d5936a1b8874bf + ref: 7db58cc6b0e4ca4141b074ff27d5936a1b8874bf specs: - actioncable (7.2.0.alpha) - actionpack (= 7.2.0.alpha) - activesupport (= 7.2.0.alpha) + apparition (0.4.0) + capybara (~> 3.13, < 4) + websocket-driver (>= 0.6.5) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.2.2.1) + actionpack (= 7.2.2.1) + activesupport (= 7.2.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.2.0.alpha) - actionpack (= 7.2.0.alpha) - activejob (= 7.2.0.alpha) - activerecord (= 7.2.0.alpha) - activestorage (= 7.2.0.alpha) - activesupport (= 7.2.0.alpha) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.2.0.alpha) - actionpack (= 7.2.0.alpha) - actionview (= 7.2.0.alpha) - activejob (= 7.2.0.alpha) - activesupport (= 7.2.0.alpha) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + actionmailbox (7.2.2.1) + actionpack (= 7.2.2.1) + activejob (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) + mail (>= 2.8.0) + actionmailer (7.2.2.1) + actionpack (= 7.2.2.1) + actionview (= 7.2.2.1) + activejob (= 7.2.2.1) + activesupport (= 7.2.2.1) + mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.2.0.alpha) - actionview (= 7.2.0.alpha) - activesupport (= 7.2.0.alpha) + actionpack (7.2.2.1) + actionview (= 7.2.2.1) + activesupport (= 7.2.2.1) nokogiri (>= 1.8.5) - rack (>= 2.2.4) + racc + rack (>= 2.2.4, < 3.2) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.2.0.alpha) - actionpack (= 7.2.0.alpha) - activerecord (= 7.2.0.alpha) - activestorage (= 7.2.0.alpha) - activesupport (= 7.2.0.alpha) + useragent (~> 0.16) + actiontext (7.2.2.1) + actionpack (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.2.0.alpha) - activesupport (= 7.2.0.alpha) + actionview (7.2.2.1) + activesupport (= 7.2.2.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.2.0.alpha) - activesupport (= 7.2.0.alpha) + activejob (7.2.2.1) + activesupport (= 7.2.2.1) globalid (>= 0.3.6) - activemodel (7.2.0.alpha) - activesupport (= 7.2.0.alpha) - activerecord (7.2.0.alpha) - activemodel (= 7.2.0.alpha) - activesupport (= 7.2.0.alpha) + activemodel (7.2.2.1) + activesupport (= 7.2.2.1) + activerecord (7.2.2.1) + activemodel (= 7.2.2.1) + activesupport (= 7.2.2.1) timeout (>= 0.4.0) - activestorage (7.2.0.alpha) - actionpack (= 7.2.0.alpha) - activejob (= 7.2.0.alpha) - activerecord (= 7.2.0.alpha) - activesupport (= 7.2.0.alpha) + activestorage (7.2.2.1) + actionpack (= 7.2.2.1) + activejob (= 7.2.2.1) + activerecord (= 7.2.2.1) + activesupport (= 7.2.2.1) marcel (~> 1.0) - activesupport (7.2.0.alpha) + activesupport (7.2.2.1) base64 + benchmark (>= 0.3) bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) - rails (7.2.0.alpha) - actioncable (= 7.2.0.alpha) - actionmailbox (= 7.2.0.alpha) - actionmailer (= 7.2.0.alpha) - actionpack (= 7.2.0.alpha) - actiontext (= 7.2.0.alpha) - actionview (= 7.2.0.alpha) - activejob (= 7.2.0.alpha) - activemodel (= 7.2.0.alpha) - activerecord (= 7.2.0.alpha) - activestorage (= 7.2.0.alpha) - activesupport (= 7.2.0.alpha) - bundler (>= 1.15.0) - railties (= 7.2.0.alpha) - railties (7.2.0.alpha) - actionpack (= 7.2.0.alpha) - activesupport (= 7.2.0.alpha) - irb - rackup (>= 1.0.0) - rake (>= 12.2) - thor (~> 1.0, >= 1.2.2) - zeitwerk (~> 2.6) - -GIT - remote: https://github.com/twalpole/apparition.git - revision: 7db58cc6b0e4ca4141b074ff27d5936a1b8874bf - ref: 7db58cc6b0e4ca4141b074ff27d5936a1b8874bf - specs: - apparition (0.4.0) - capybara (~> 3.13, < 4) - websocket-driver (>= 0.6.5) - -GEM - remote: https://rubygems.org/ - specs: + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) acts_as_list (1.1.0) activerecord (>= 4.2) addressable (2.8.5) @@ -120,6 +90,7 @@ GEM execjs (~> 2) base64 (0.1.1) bcrypt (3.1.19) + benchmark (0.4.0) bigdecimal (3.1.4) bindex (0.8.1) bootstrap-sass (3.4.1) @@ -146,14 +117,14 @@ GEM execjs coffee-script-source (1.12.2) colorize (1.1.0) - concurrent-ruby (1.2.2) + concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) database_cleaner-active_record (2.1.0) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - date (3.3.3) + date (3.4.1) devise (4.8.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -189,9 +160,9 @@ GEM i18n (1.14.1) concurrent-ruby (~> 1.0) io-console (0.6.0) - irb (1.8.1) - rdoc - reline (>= 0.3.8) + irb (1.14.3) + rdoc (>= 4.0.0) + reline (>= 0.4.2) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) @@ -210,6 +181,7 @@ GEM listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + logger (1.6.4) loofah (2.21.3) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -221,7 +193,7 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) matrix (0.4.2) mimemagic (0.3.10) nokogiri (~> 1) @@ -230,15 +202,14 @@ GEM mini_portile2 (2.8.4) minitest (5.20.0) multi_xml (0.6.0) - mutex_m (0.1.2) - net-imap (0.4.1) + net-imap (0.5.5) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.4.0) + net-smtp (0.5.0) net-protocol newrelic_rpm (9.5.0) next_rails (1.3.0) @@ -302,6 +273,20 @@ GEM rackup (1.0.0) rack (< 3) webrick + rails (7.2.2.1) + actioncable (= 7.2.2.1) + actionmailbox (= 7.2.2.1) + actionmailer (= 7.2.2.1) + actionpack (= 7.2.2.1) + actiontext (= 7.2.2.1) + actionview (= 7.2.2.1) + activejob (= 7.2.2.1) + activemodel (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) + bundler (>= 1.15.0) + railties (= 7.2.2.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -313,6 +298,14 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) + railties (7.2.2.1) + actionpack (= 7.2.2.1) + activesupport (= 7.2.2.1) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.0.6) rb-fsevent (0.11.2) @@ -323,7 +316,7 @@ GEM recursive-open-struct (1.1.3) redcarpet (3.5.1) regexp_parser (2.8.1) - reline (0.3.9) + reline (0.6.0) io-console (~> 0.5) responders (3.1.0) actionpack (>= 5.2) @@ -379,10 +372,17 @@ GEM tilt (>= 1.1, < 3) sassc (2.4.0) ffi (~> 1.9) + securerandom (0.4.1) selenium-webdriver (4.10.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) + sentry-rails (5.22.1) + railties (>= 5.0) + sentry-ruby (~> 5.22.1) + sentry-ruby (5.22.1) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) shoulda-matchers (3.1.3) activesupport (>= 4.0.0) simplecov (0.22.0) @@ -402,6 +402,7 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) + stackprof (0.2.26) standard (1.31.1) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) @@ -428,6 +429,7 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) + useragent (0.16.11) version_gem (1.1.3) warden (1.2.9) rack (>= 2.0.9) @@ -477,18 +479,21 @@ DEPENDENCIES next_rails ombu_labs-auth pg - puma (~> 6.3) + puma (~> 6.4) pundit (~> 2.2) rack-mini-profiler - rails! + rails (~> 7.2.0) rails-controller-testing recursive-open-struct redcarpet (~> 3.5.1) rspec-rails (~> 6.0.3) sass-rails (~> 5.0) + sentry-rails + sentry-ruby shoulda-matchers (~> 3.1) simplecov spring (= 3.0.0) + stackprof standardrb terser turbolinks (~> 5) @@ -497,7 +502,7 @@ DEPENDENCIES webdrivers RUBY VERSION - ruby 3.2.2p53 + ruby 3.2.3p157 BUNDLED WITH - 2.4.10 + 2.5.16 diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb new file mode 100644 index 00000000..49163708 --- /dev/null +++ b/config/initializers/sentry.rb @@ -0,0 +1,19 @@ +if Rails.env.production? + Sentry.init do |config| + config.dsn = ENV["SENTRY_DSN"] + config.breadcrumbs_logger = [:active_support_logger, :http_logger] + + # Set traces_sample_rate to 1.0 to capture 100% + # of transactions for tracing. + # We recommend adjusting this value in production. + config.traces_sample_rate = 1.0 + # or + config.traces_sampler = lambda do |context| + true + end + # Set profiles_sample_rate to profile 100% + # of sampled transactions. + # We recommend adjusting this value in production. + config.profiles_sample_rate = 1.0 + end +end