From e0b7ed9744d5de720e277274bf1760930fdfca42 Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 26 May 2024 18:05:07 +0200 Subject: [PATCH 01/10] Ruby version & Sentry --- .ruby-version | 2 +- .tool-versions | 2 +- Gemfile | 1 + Gemfile.lock | 25 ++++++++++++------- app/controllers/application_controller.rb | 3 +++ .../concerns/sentry_user_context.rb | 24 ++++++++++++++++++ config/initializers/sentry.rb | 1 + 7 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 app/controllers/concerns/sentry_user_context.rb diff --git a/.ruby-version b/.ruby-version index b0f2dcb3..bea438e9 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.4 +3.3.1 diff --git a/.tool-versions b/.tool-versions index 6e624cf0..f76d2631 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -ruby 3.0.4 +ruby 3.3.1 yarn 1.22.19 nodejs 16.15.0 diff --git a/Gemfile b/Gemfile index b2afbe5e..b6ee5894 100644 --- a/Gemfile +++ b/Gemfile @@ -72,6 +72,7 @@ gem "httparty", "~> 0.20.0" gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw] # Sentry +gem "stackprof" gem "sentry-rails" gem "sentry-ruby" diff --git a/Gemfile.lock b/Gemfile.lock index a16051fa..77029255 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -193,10 +193,12 @@ GEM net-ssh (>= 2.6.5, < 7.0.0) net-ssh (6.1.0) netrc (0.11.0) - nio4r (2.5.8) - nokogiri (1.13.6-x86_64-darwin) + nio4r (2.7.3) + nokogiri (1.16.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.13.6-x86_64-linux) + nokogiri (1.16.5-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) oauth2 (1.4.9) faraday (>= 0.17.3, < 3.0) @@ -220,12 +222,12 @@ GEM parallel (1.22.1) parser (3.1.2.0) ast (~> 2.4.1) - psych (4.0.3) + psych (5.1.2) stringio public_suffix (4.0.7) puma (5.5.2) nio4r (~> 2.0) - racc (1.6.0) + racc (1.8.0) rack (2.2.3.1) rack-protection (2.2.0) rack @@ -268,7 +270,7 @@ GEM rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) - rdoc (6.4.0) + rdoc (6.7.0) psych (>= 4.0.0) regexp_parser (2.4.0) responders (3.0.1) @@ -324,7 +326,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt - sdoc (2.4.0) + sdoc (2.6.1) rdoc (>= 5.0) semantic_range (3.0.0) sentry-rails (5.5.0) @@ -345,11 +347,14 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.4.2) + sqlite3 (1.7.3-arm64-darwin) + sqlite3 (1.7.3-x86_64-darwin) + sqlite3 (1.7.3-x86_64-linux) sshkit (1.21.2) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) - stringio (3.0.2) + stackprof (0.2.26) + stringio (3.1.0) sync (0.5.0) term-ansicolor (1.7.1) tins (~> 1.0) @@ -387,6 +392,7 @@ GEM zeitwerk (2.5.4) PLATFORMS + arm64-darwin-23 x86_64-darwin-21 x86_64-linux @@ -436,6 +442,7 @@ DEPENDENCIES sentry-ruby spring (~> 3.0) sqlite3 (~> 1.4) + stackprof tqdm (~> 0.3.0) tzinfo-data vanilla_nested (~> 1.6) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e7c56778..f6dabf6a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,6 +2,9 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception + + include SentryUserContext + skip_before_action :verify_authenticity_token, if: :api_request? before_action :authenticate_user_from_token! before_action :authenticate_user! diff --git a/app/controllers/concerns/sentry_user_context.rb b/app/controllers/concerns/sentry_user_context.rb new file mode 100644 index 00000000..f13a693a --- /dev/null +++ b/app/controllers/concerns/sentry_user_context.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module SentryUserContext + extend ActiveSupport::Concern + + included do + before_action :set_sentry_context + end + + private + + def sentry_user_context + {}.tap do |user| + next unless current_user + + user[:id] = current_user.id + user[:name] = current_user.name + end + end + + def set_sentry_context + Sentry.set_user(sentry_user_context) + end +end diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index 5c4cdb4d..08738dca 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -1,6 +1,7 @@ Sentry.init do |config| config.dsn = ENV["SENTRY_DSN"] config.breadcrumbs_logger = [:active_support_logger, :http_logger] + config.enable_tracing = true config.enabled_environments = %w[production] end From 9af121177d01081e2e7191f469e7f6544b535e16 Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 26 May 2024 18:11:14 +0200 Subject: [PATCH 02/10] Bump Rubocop --- Gemfile.lock | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 77029255..09d62c71 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -170,6 +170,7 @@ GEM marcel (~> 1.0.1) mime-types terrapin (~> 0.6.0) + language_server-protocol (3.17.0.3) listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) @@ -219,9 +220,10 @@ GEM omniauth-zeuswpi (1.0.0) omniauth-oauth2 (~> 1.7.1) orm_adapter (0.5.0) - parallel (1.22.1) - parser (3.1.2.0) + parallel (1.24.0) + parser (3.3.1.0) ast (~> 2.4.1) + racc psych (5.1.2) stringio public_suffix (4.0.7) @@ -272,7 +274,7 @@ GEM ffi (~> 1.0) rdoc (6.7.0) psych (>= 4.0.0) - regexp_parser (2.4.0) + regexp_parser (2.9.2) responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) @@ -281,7 +283,8 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.2.5) + rexml (3.2.8) + strscan (>= 3.0.9) rspec-core (3.11.0) rspec-support (~> 3.11.0) rspec-expectations (3.11.0) @@ -299,24 +302,26 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.11.0) - rubocop (1.30.0) + rubocop (1.64.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.18.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.18.0) - parser (>= 3.1.1.0) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) rubocop-rails (2.14.2) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) rubocop-rspec (2.11.1) rubocop (~> 1.19) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) sassc (2.4.0) ffi (~> 1.9) @@ -355,6 +360,7 @@ GEM net-ssh (>= 2.8.0) stackprof (0.2.26) stringio (3.1.0) + strscan (3.1.0) sync (0.5.0) term-ansicolor (1.7.1) tins (~> 1.0) @@ -370,7 +376,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.1) - unicode-display_width (2.1.0) + unicode-display_width (2.5.0) vanilla_nested (1.6.1) warden (1.2.9) rack (>= 2.0.9) From 456b1348db0f87304f331a2dde5c4ae46290270f Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 26 May 2024 18:13:07 +0200 Subject: [PATCH 03/10] Bump Sentry --- Gemfile.lock | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 09d62c71..18d8eecb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -70,6 +70,7 @@ GEM ast (2.4.2) bcrypt (3.1.17) bcrypt_pbkdf (1.1.0) + bigdecimal (3.1.8) bootsnap (1.11.1) msgpack (~> 1.2) builder (3.2.4) @@ -100,7 +101,7 @@ GEM climate_control (0.2.0) codeclimate-test-reporter (1.0.9) simplecov (<= 0.13) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.3) coveralls (0.7.1) multi_json (~> 1.3) rest-client @@ -131,7 +132,7 @@ GEM dotenv (= 2.8.1) railties (>= 3.2) ed25519 (1.3.0) - erubi (1.10.0) + erubi (1.12.0) factory_bot (6.2.1) activesupport (>= 5.0.0) factory_bot_rails (6.2.0) @@ -158,7 +159,7 @@ GEM httparty (0.20.0) mime-types (~> 3.0) multi_xml (>= 0.5.2) - i18n (1.10.0) + i18n (1.14.5) concurrent-ruby (~> 1.0) identicon (0.0.5) chunky_png @@ -174,18 +175,18 @@ GEM listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.18.0) + loofah (2.22.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) + nokogiri (>= 1.12.0) mail (2.7.1) mini_mime (>= 0.1.1) marcel (1.0.2) - method_source (1.0.0) + method_source (1.1.0) mime-types (3.4.1) mime-types-data (~> 3.2015) mime-types-data (3.2022.0105) mini_mime (1.1.2) - minitest (5.15.0) + minitest (5.23.1) msgpack (1.5.1) multi_json (1.15.0) multi_xml (0.6.0) @@ -230,13 +231,13 @@ GEM puma (5.5.2) nio4r (~> 2.0) racc (1.8.0) - rack (2.2.3.1) + rack (2.2.9) rack-protection (2.2.0) rack rack-proxy (0.7.2) rack - rack-test (1.1.0) - rack (>= 1.0, < 3) + rack-test (2.1.0) + rack (>= 1.3) rails (6.1.6) actioncable (= 6.1.6) actionmailbox (= 6.1.6) @@ -256,11 +257,13 @@ GEM actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) - loofah (~> 2.3) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) railties (6.1.6) actionpack (= 6.1.6) activesupport (= 6.1.6) @@ -268,7 +271,7 @@ GEM rake (>= 12.2) thor (~> 1.0) rainbow (3.1.1) - rake (13.0.6) + rake (13.2.1) rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) @@ -334,10 +337,11 @@ GEM sdoc (2.6.1) rdoc (>= 5.0) semantic_range (3.0.0) - sentry-rails (5.5.0) + sentry-rails (5.17.3) railties (>= 5.0) - sentry-ruby (~> 5.5.0) - sentry-ruby (5.5.0) + sentry-ruby (~> 5.17.3) + sentry-ruby (5.17.3) + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) simplecov (0.13.0) docile (~> 1.1.0) @@ -366,12 +370,12 @@ GEM tins (~> 1.0) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) - thor (1.2.1) + thor (1.3.1) tilt (2.0.10) tins (1.31.1) sync tqdm (0.3.0) - tzinfo (2.0.4) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext @@ -395,7 +399,7 @@ GEM will_paginate (3.3.1) will_paginate-bulma (1.0.0) will_paginate (>= 3.0.3) - zeitwerk (2.5.4) + zeitwerk (2.6.15) PLATFORMS arm64-darwin-23 From 776375da41e4241473f2541809a06dec87275964 Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 26 May 2024 18:14:15 +0200 Subject: [PATCH 04/10] Bump bundler --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 18d8eecb..2743ffd3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -462,4 +462,4 @@ DEPENDENCIES will_paginate-bulma (~> 1.0) BUNDLED WITH - 2.2.33 + 2.5.10 From a5389050f72a818f973116b8aa79fa0255e2edbf Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 26 May 2024 18:16:44 +0200 Subject: [PATCH 05/10] Bump coveralls --- Gemfile.lock | 19 ++++++++----------- README.md | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2743ffd3..8d93663d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -125,8 +125,7 @@ GEM warden (~> 1.2.3) diff-lcs (1.5.0) docile (1.1.5) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) + domain_name (0.6.20240107) dotenv (2.8.1) dotenv-rails (2.8.1) dotenv (= 2.8.1) @@ -154,7 +153,7 @@ GEM hashdiff (1.0.1) hashie (5.0.0) http-accept (1.7.0) - http-cookie (1.0.4) + http-cookie (1.0.5) domain_name (~> 0.5) httparty (0.20.0) mime-types (~> 3.0) @@ -163,7 +162,7 @@ GEM concurrent-ruby (~> 1.0) identicon (0.0.5) chunky_png - json (2.6.1) + json (2.7.2) jwt (2.3.0) kt-paperclip (7.1.1) activemodel (>= 4.2.0) @@ -182,9 +181,9 @@ GEM mini_mime (>= 0.1.1) marcel (1.0.2) method_source (1.1.0) - mime-types (3.4.1) + mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) + mime-types-data (3.2024.0507) mini_mime (1.1.2) minitest (5.23.1) msgpack (1.5.1) @@ -366,20 +365,18 @@ GEM stringio (3.1.0) strscan (3.1.0) sync (0.5.0) - term-ansicolor (1.7.1) + term-ansicolor (1.8.0) tins (~> 1.0) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) thor (1.3.1) tilt (2.0.10) - tins (1.31.1) + tins (1.33.0) + bigdecimal sync tqdm (0.3.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.1) unicode-display_width (2.5.0) vanilla_nested (1.6.1) warden (1.2.9) diff --git a/README.md b/README.md index 2feb85ce..9ccf2cb7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # [Tap](https://zeus.ugent.be/tap) [![Code Climate](https://codeclimate.com/github/ZeusWPI/Tap/badges/gpa.svg)](https://codeclimate.com/github/ZeusWPI/Tap) [![Ruby](https://github.com/ZeusWPI/Tap/actions/workflows/ruby.yml/badge.svg)](https://github.com/ZeusWPI/Tap/actions/workflows/ruby.yml) [![Coverage Status](https://coveralls.io/repos/ZeusWPI/Tap/badge.svg?branch=master&service=github)](https://coveralls.io/github/ZeusWPI/Tap?branch=master) -:beer: Yes. We have to drink. But we also have to pay. This is the drinking part. +🍺 Yes. We have to drink. But we also have to pay. This is the drinking part. ## Development From 8b66e0d5895726185b15da830995dc2fc57a8ccc Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 26 May 2024 18:20:06 +0200 Subject: [PATCH 06/10] Bump Coveralls --- Gemfile.lock | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8d93663d..a4b23b78 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -99,15 +99,15 @@ GEM chartkick (4.1.3) chunky_png (1.4.0) climate_control (0.2.0) - codeclimate-test-reporter (1.0.9) - simplecov (<= 0.13) + codeclimate-test-reporter (1.0.7) + simplecov concurrent-ruby (1.2.3) - coveralls (0.7.1) - multi_json (~> 1.3) - rest-client - simplecov (>= 0.7) - term-ansicolor - thor + coveralls (0.8.23) + json (>= 1.8, < 3) + simplecov (~> 0.16.1) + term-ansicolor (~> 1.3) + thor (>= 0.19.4, < 2.0) + tins (~> 1.6) crack (0.4.5) rexml crass (1.0.6) @@ -124,8 +124,7 @@ GEM responders warden (~> 1.2.3) diff-lcs (1.5.0) - docile (1.1.5) - domain_name (0.6.20240107) + docile (1.4.0) dotenv (2.8.1) dotenv-rails (2.8.1) dotenv (= 2.8.1) @@ -152,9 +151,6 @@ GEM activesupport (>= 5.0) hashdiff (1.0.1) hashie (5.0.0) - http-accept (1.7.0) - http-cookie (1.0.5) - domain_name (~> 0.5) httparty (0.20.0) mime-types (~> 3.0) multi_xml (>= 0.5.2) @@ -193,7 +189,6 @@ GEM net-scp (3.0.0) net-ssh (>= 2.6.5, < 7.0.0) net-ssh (6.1.0) - netrc (0.11.0) nio4r (2.7.3) nokogiri (1.16.5-arm64-darwin) racc (~> 1.4) @@ -280,11 +275,6 @@ GEM responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) - rest-client (2.1.0) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) rexml (3.2.8) strscan (>= 3.0.9) rspec-core (3.11.0) @@ -342,8 +332,8 @@ GEM sentry-ruby (5.17.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) - simplecov (0.13.0) - docile (~> 1.1.0) + simplecov (0.16.1) + docile (~> 1.1) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) From 8e517bfae39e52e8d1019904e1d85f82ee19e7f8 Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 26 May 2024 18:24:59 +0200 Subject: [PATCH 07/10] Remove deprecated Coveralls gem --- .simplecov | 9 --------- Gemfile | 2 -- Gemfile.lock | 22 ---------------------- README.md | 2 +- spec/spec_helper.rb | 3 --- 5 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 .simplecov diff --git a/.simplecov b/.simplecov deleted file mode 100644 index 62f970a0..00000000 --- a/.simplecov +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -require "simplecov" -require "coveralls" - -SimpleCov.formatter = Coveralls::SimpleCov::Formatter -SimpleCov.start do - add_filter "config/" -end diff --git a/Gemfile b/Gemfile index b6ee5894..3e44f8d6 100644 --- a/Gemfile +++ b/Gemfile @@ -83,8 +83,6 @@ end # Test dependencies group :test do - gem "codeclimate-test-reporter", require: nil - gem "coveralls", require: false gem "rspec-rails" gem "webmock" end diff --git a/Gemfile.lock b/Gemfile.lock index a4b23b78..4a07accf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -99,15 +99,7 @@ GEM chartkick (4.1.3) chunky_png (1.4.0) climate_control (0.2.0) - codeclimate-test-reporter (1.0.7) - simplecov concurrent-ruby (1.2.3) - coveralls (0.8.23) - json (>= 1.8, < 3) - simplecov (~> 0.16.1) - term-ansicolor (~> 1.3) - thor (>= 0.19.4, < 2.0) - tins (~> 1.6) crack (0.4.5) rexml crass (1.0.6) @@ -124,7 +116,6 @@ GEM responders warden (~> 1.2.3) diff-lcs (1.5.0) - docile (1.4.0) dotenv (2.8.1) dotenv-rails (2.8.1) dotenv (= 2.8.1) @@ -332,11 +323,6 @@ GEM sentry-ruby (5.17.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) - simplecov (0.16.1) - docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) spring (3.1.1) sprockets (4.0.3) concurrent-ruby (~> 1.0) @@ -354,16 +340,10 @@ GEM stackprof (0.2.26) stringio (3.1.0) strscan (3.1.0) - sync (0.5.0) - term-ansicolor (1.8.0) - tins (~> 1.0) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) thor (1.3.1) tilt (2.0.10) - tins (1.33.0) - bigdecimal - sync tqdm (0.3.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) @@ -406,8 +386,6 @@ DEPENDENCIES capistrano-rbenv (~> 2.2) capistrano-rvm (~> 0.1.2) chartkick (~> 4.0) - codeclimate-test-reporter - coveralls daemons (~> 1.4) delayed_job (~> 4.1) delayed_job_active_record diff --git a/README.md b/README.md index 9ccf2cb7..7d370570 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # [Tap](https://zeus.ugent.be/tap) -[![Code Climate](https://codeclimate.com/github/ZeusWPI/Tap/badges/gpa.svg)](https://codeclimate.com/github/ZeusWPI/Tap) [![Ruby](https://github.com/ZeusWPI/Tap/actions/workflows/ruby.yml/badge.svg)](https://github.com/ZeusWPI/Tap/actions/workflows/ruby.yml) [![Coverage Status](https://coveralls.io/repos/ZeusWPI/Tap/badge.svg?branch=master&service=github)](https://coveralls.io/github/ZeusWPI/Tap?branch=master) +[![Code Climate](https://codeclimate.com/github/ZeusWPI/Tap/badges/gpa.svg)](https://codeclimate.com/github/ZeusWPI/Tap) [![Ruby](https://github.com/ZeusWPI/Tap/actions/workflows/ruby.yml/badge.svg)](https://github.com/ZeusWPI/Tap/actions/workflows/ruby.yml) 🍺 Yes. We have to drink. But we also have to pay. This is the drinking part. diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e3fa2692..ad28bec1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,8 +1,5 @@ # frozen_string_literal: true -require "coveralls" -Coveralls.wear! - # This file was generated by the `rails generate rspec:install` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause From 0b1bc01b18568084238bfbeb5adfbbd906479a13 Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 26 May 2024 18:29:13 +0200 Subject: [PATCH 08/10] Build now? --- .rubocop.yml | 5 +++++ .rubocop_todo.yml | 41 +++++++++++++++++++++++++++++++++++++++++ Gemfile | 2 +- spec/rails_helper.rb | 2 +- 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index 635cdb8b..bc599c40 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,5 @@ +inherit_from: .rubocop_todo.yml + require: - rubocop-rails - rubocop-rspec @@ -12,6 +14,9 @@ Style/StringLiterals: Style/Documentation: Enabled: false +Style/HashSyntax: + Enabled: false + # Do not complain about blocks that are too long. Metrics/BlockLength: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 00000000..9fc63691 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,41 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2024-05-26 16:27:21 UTC using RuboCop version 1.64.0. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 14 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, BlockForwardingName. +# SupportedStyles: anonymous, explicit +Naming/BlockForwarding: + Exclude: + - 'app/form_builders/formatted_form_builder.rb' + - 'app/helpers/application_helper.rb' + +# Offense count: 14 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowOnlyRestArgument, UseAnonymousForwarding, RedundantRestArgumentNames, RedundantKeywordRestArgumentNames, RedundantBlockArgumentNames. +# RedundantRestArgumentNames: args, arguments +# RedundantKeywordRestArgumentNames: kwargs, options, opts +# RedundantBlockArgumentNames: blk, block, proc +Style/ArgumentsForwarding: + Exclude: + - 'app/form_builders/formatted_form_builder.rb' + - 'app/helpers/application_helper.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedReceivers. +# AllowedReceivers: Thread.current +Style/HashEachMethods: + Exclude: + - 'app/models/stock.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +Style/SuperArguments: + Exclude: + - 'app/form_builders/formatted_form_builder.rb' diff --git a/Gemfile b/Gemfile index 3e44f8d6..b6dfdb42 100644 --- a/Gemfile +++ b/Gemfile @@ -72,9 +72,9 @@ gem "httparty", "~> 0.20.0" gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw] # Sentry -gem "stackprof" gem "sentry-rails" gem "sentry-ruby" +gem "stackprof" # Production dependencies group :production do diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index b3f605aa..96191d5f 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -37,7 +37,7 @@ end RSpec.configure do |config| # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" + config.fixture_path = "#{Rails.root}/spec/fixtures" # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false From 994f2868f128528a115603b8887c0ef630d7462e Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 26 May 2024 18:30:40 +0200 Subject: [PATCH 09/10] Now? --- spec/rails_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 96191d5f..1c55cafc 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -37,7 +37,7 @@ end RSpec.configure do |config| # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{Rails.root}/spec/fixtures" + config.fixture_path = Rails.root.join("spec/fixtures") # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false From ccf540828c67dc029109040b9965c3b3489f1425 Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 26 May 2024 18:33:25 +0200 Subject: [PATCH 10/10] Add net-smtp to build --- Gemfile | 3 +++ Gemfile.lock | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/Gemfile b/Gemfile index b6dfdb42..2e8b6062 100644 --- a/Gemfile +++ b/Gemfile @@ -21,6 +21,9 @@ gem "sassc-rails", "~> 2.1" # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker gem "webpacker", "~> 5.0" +# Not sure why +gem "net-smtp", require: false + # Bulma gem "bulma-rails", "~> 0.9.1" gem "font-awesome-sass", "~> 5.15" diff --git a/Gemfile.lock b/Gemfile.lock index 4a07accf..ed86bece 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -177,8 +177,12 @@ GEM multi_json (1.15.0) multi_xml (0.6.0) mysql2 (0.5.4) + net-protocol (0.2.2) + timeout net-scp (3.0.0) net-ssh (>= 2.6.5, < 7.0.0) + net-smtp (0.5.0) + net-protocol net-ssh (6.1.0) nio4r (2.7.3) nokogiri (1.16.5-arm64-darwin) @@ -344,6 +348,7 @@ GEM climate_control (>= 0.0.3, < 1.0) thor (1.3.1) tilt (2.0.10) + timeout (0.4.1) tqdm (0.3.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) @@ -402,6 +407,7 @@ DEPENDENCIES kt-paperclip (~> 7.0) listen (~> 3.7) mysql2 (~> 0.5.3) + net-smtp omniauth-rails_csrf_protection omniauth-zeuswpi puma (~> 5.5.0)