Skip to content

Commit 82c4afb

Browse files
compwronclaude
andcommitted
fix: complete prosopite setup and remove bullet
Resolves merge conflicts and completes the migration from bullet to prosopite for N+1 query detection. Changes: - Resolve Gemfile.lock merge conflicts (remove bullet/uniform_notifier) - Replace Bullet configuration with Prosopite in development.rb - Replace Bullet configuration with Prosopite in test.rb - Fix prosopite initializer to use config.x (Rails custom config) - Update rails_helper comment to reference prosopite - Add :disable_prosopite metadata to error handling test - Create .prosopite_ignore file for test exclusions Prosopite is now fully configured and working to detect N+1 queries in both development and test environments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent bd762c6 commit 82c4afb

File tree

7 files changed

+17
-33
lines changed

7 files changed

+17
-33
lines changed

.prosopite_ignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This file contains paths to ignore for Prosopite N+1 query detection
2+
# Add spec file paths (one per line) that should be excluded from N+1 detection
3+
# Example: spec/system/some_feature

Gemfile.lock

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,6 @@ GEM
115115
bugsnag (6.28.0)
116116
concurrent-ruby (~> 1.0)
117117
builder (3.3.0)
118-
<<<<<<< HEAD
119-
bullet (8.1.0)
120-
activesupport (>= 3.0.0)
121-
uniform_notifier (~> 1.11)
122-
=======
123-
>>>>>>> c9fda4adf (WIP replace bullet with prosopite for finding performance issues like db n+1 queries)
124118
bundler-audit (0.9.2)
125119
bundler (>= 1.2.0, < 3)
126120
thor (~> 1.0)
@@ -666,10 +660,6 @@ GEM
666660
unicode-display_width (3.2.0)
667661
unicode-emoji (~> 4.1)
668662
unicode-emoji (4.1.0)
669-
<<<<<<< HEAD
670-
uniform_notifier (1.18.0)
671-
=======
672-
>>>>>>> c9fda4adf (WIP replace bullet with prosopite for finding performance issues like db n+1 queries)
673663
useragent (0.16.11)
674664
view_component (3.22.0)
675665
activesupport (>= 5.2.0, < 8.1)

config/environments/development.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,9 @@
6868
# Raises error for missing translations.
6969
# config.i18n.raise_on_missing_translations = true
7070

71-
config.after_initialize do
72-
Bullet.enable = true
73-
Bullet.console = true
74-
Bullet.rails_logger = true
75-
Bullet.bullet_logger = true
76-
end
71+
# Prosopite configuration for N+1 query detection
72+
config.x.prosopite_enabled = true
73+
config.x.prosopite_min_n_queries = 2
7774

7875
# Annotate rendered view with file names.
7976
config.action_view.annotate_rendered_view_with_filenames = true

config/environments/test.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,10 @@
6363
# Raises error for missing translations.
6464
config.i18n.raise_on_missing_translations = true
6565

66-
config.after_initialize do
67-
Bullet.enable = true
68-
Bullet.console = true
69-
Bullet.bullet_logger = true
70-
Bullet.rails_logger = true
71-
# Bullet.raise = true # TODO https://github.com/rubyforgood/casa/issues/2441
72-
end
66+
# Prosopite configuration for N+1 query detection
67+
# Detailed configuration is in spec/support/prosopite.rb
68+
config.x.prosopite_enabled = false # Managed by spec/support/prosopite.rb
69+
config.x.prosopite_min_n_queries = 2
7370

7471
# Annotate rendered view with file names.
7572
# config.action_view.annotate_rendered_view_with_filenames = true

config/initializers/prosopite.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# frozen_string_literal: true
22

3-
if Rails.configuration.application.prosopite_enabled
3+
if Rails.configuration.x.prosopite_enabled
44
require "prosopite/middleware/rack"
55
Rails.configuration.middleware.use(Prosopite::Middleware::Rack)
66
end
77

88
Rails.application.config.after_initialize do
9-
Prosopite.enabled = Rails.configuration.application.prosopite_enabled
10-
Prosopite.min_n_queries = Rails.configuration.application.prosopite_min_n_queries
9+
Prosopite.enabled = Rails.configuration.x.prosopite_enabled
10+
Prosopite.min_n_queries = Rails.configuration.x.prosopite_min_n_queries
1111
Prosopite.rails_logger = true
1212
end

spec/models/case_court_report_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@
386386
let(:casa_case_with_contacts) { volunteer.casa_cases.first }
387387
let(:nonexistent_path) { "app/documents/templates/nonexisitent_report_template.docx" }
388388

389-
it "raises Zip::Error when generating report" do
389+
it "raises Zip::Error when generating report", :disable_prosopite do
390390
args = {
391391
case_id: casa_case_with_contacts.id,
392392
volunteer_id: volunteer.id,

spec/rails_helper.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,9 @@
121121
raise StandardError.new "\"#{example.full_description}\" in #{example.location} timed out."
122122
end
123123

124-
# NOTE: not applicable currently, left to show how to skip bullet errrors
125-
# config.around :each, :disable_bullet do |example|
126-
# Bullet.raise = false
127-
# example.run
128-
# Bullet.raise = true
129-
# end
124+
# NOTE: not applicable currently, left to show how to skip prosopite errors
125+
# You can use the :disable_prosopite metadata tag on specific examples
126+
# See spec/support/prosopite.rb for configuration
130127

131128
config.around do |example|
132129
Capybara.server_port = 7654 + ENV["TEST_ENV_NUMBER"].to_i

0 commit comments

Comments
 (0)