Skip to content

[CI] (f51b3be) rails/fizzy - #2641

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-f51b3be-rails-fizzy
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-f51b3be-rails-fizzy

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: f51b3be
App: rails/fizzy
App directory: apps/rails/fizzy
Workbench branch: wizard-ci-f51b3be-rails-fizzy
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-09T22:36:36.269Z
Duration: 273.2s

YARA Scanner

✓ 118 tool calls scanned, 0 violations detected

No violations: ✓ 118 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown
Author

Now I have all the context needed. Let me produce the full evaluation report.


PR Evaluation Report

Summary

This PR integrates PostHog into a Ruby on Rails app ("fizzy") using both posthog-ruby/posthog-rails gems for backend tracking and the posthog-js HTML snippet for frontend tracking. It adds server-side event capture for signup, login, board creation, card publishing, and webhook creation flows, plus client-side user identification via meta tags and Turbo events. Automatic exception capture is enabled via the Rails config, and manual capture_exception calls are added in several controllers.

Files changed Lines added Lines removed
13 +210 -2

Confidence score: 4/5 👍

  • Duplicate exception captures: With auto_capture_exceptions: true and report_rescued_exceptions: true enabled in the initializer, the manual rescue => error; PostHog.capture_exception(...) blocks in five controllers will fire alongside the middleware's automatic capture, causing duplicate exception events. Remove the manual rescue blocks or disable report_rescued_exceptions. [MEDIUM]
  • No posthog.reset() on logout: The sessions_controller#destroy action terminates the session but no posthog.reset() call is made on the client side. PostHog docs strongly recommend calling reset() on logout to prevent event attribution across users sharing a device. [MEDIUM]
  • No reverse proxy configured: The frontend uses the posthog-js snippet loading directly from PostHog's servers. A reverse proxy would improve reliability against ad blockers. [MEDIUM]

File changes

Filename Score Description
Gemfile 5/5 Correctly adds posthog-ruby (with require: "posthog") and posthog-rails gems
config/initializers/posthog.rb 5/5 Proper PostHog.init and PostHog::Rails.configure setup with env vars and sensible defaults
app/controllers/application_controller.rb 4/5 Adds posthog_identify and posthog_capture helper methods; clean pattern
app/controllers/boards_controller.rb 3/5 Good event capture but redundant manual exception handling
app/controllers/cards/publishes_controller.rb 3/5 Good event capture but redundant manual exception handling
app/controllers/sessions/magic_links_controller.rb 4/5 Properly identifies user on login with posthog_identify
app/controllers/signups/completions_controller.rb 4/5 Identifies user and captures signup completion event
app/controllers/signups_controller.rb 4/5 Captures signup_requested event with relevant properties
app/controllers/webhooks_controller.rb 3/5 Good event capture but redundant manual exception handling
app/javascript/application.js 4/5 Client-side identify on turbo:load using meta tags; missing reset() on logout
app/models/user.rb 5/5 Clean posthog_distinct_id and posthog_properties methods on User model
app/views/layouts/shared/_head.html.erb 4/5 PostHog JS snippet with env-var-driven init; passes user context via meta tags
posthog-setup-report.md N/A Wizard-generated setup report

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Syntax is valid Ruby/ERB/JS; gem additions are correct
Preserves existing env vars & configs Yes Existing current-user-id meta tag replaced but functionality preserved via new meta tags; no configs deleted
No syntax or type errors Yes All code is syntactically valid
Correct imports/exports Yes require: "posthog" is correct per docs; gems are properly specified
Minimal, focused changes Yes All changes relate to PostHog integration
Pre-existing issues None No pre-existing issues detected

Issues

  • No .env.example update: The env vars POSTHOG_PROJECT_TOKEN and POSTHOG_HOST are used but not documented in a .env.example file (a .env file exists with actual values but that's not committed). The setup report mentions this as a TODO. [LOW]

Other completed criteria

  • App builds without errors — valid Ruby, ERB, and JavaScript syntax throughout
  • Existing functionality preserved — authentication flow, controller logic, and view rendering unchanged
  • Changes are minimal and focused on PostHog integration
  • Build configuration valid — Gemfile properly formatted with correct gem specifications

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-ruby and posthog-rails gems in Gemfile; posthog-js loaded via HTML <script> snippet in layout
PostHog client initialized Yes Backend: PostHog.init block in config/initializers/posthog.rb. Frontend: posthog.init() with token and host from meta tags
capture() Yes Six meaningful server-side capture calls across controllers; autocapture enabled on frontend
identify() Yes Server-side: PostHog.identify called on login and signup. Client-side: posthog.identify on turbo:load with user ID from meta tag, person properties (email, name)
Error tracking Yes auto_capture_exceptions: true, report_rescued_exceptions: true, and auto_instrument_active_job: true in Rails config. Manual capture_exception calls also added (creates duplication)
Reverse proxy No No reverse proxy configured for the frontend posthog-js snippet

Issues

  • Duplicate exception captures: The initializer enables auto_capture_exceptions and report_rescued_exceptions, which means the PostHog Rails middleware automatically captures all controller exceptions. The manual rescue => error; PostHog.capture_exception(...); raise blocks in 5 controllers will cause every exception to be reported twice. Remove the manual rescue blocks since the middleware handles this automatically. [MEDIUM]
  • No posthog.reset() on logout: The sessions_controller#destroy action terminates the session but posthog.reset() is never called client-side. This means if another user logs in on the same device, their events may be attributed to the previous user. Add a posthog.reset() call before or after logout redirect. [MEDIUM]
  • No reverse proxy for client-side tracking: The posthog-js snippet loads directly from PostHog's CDN. Ad blockers may intercept these requests. Consider setting up a reverse proxy via Rails rewrites or a CDN. [MEDIUM]
  • Missing defaults config option: The frontend posthog.init() call does not include the defaults option (e.g., defaults: '2026-05-30'), which is recommended in the current PostHog docs to ensure consistent default behavior. [LOW]

Other completed criteria

  • API key loaded from environment variables on both frontend (meta tags populated from ENV) and backend (ENV["POSTHOG_PROJECT_TOKEN"])
  • API host correctly configured from environment variables on both sides
  • posthog_distinct_id method on User model returns user.id — a real database identifier, not a fabricated value
  • Frontend identify uses user.posthog_distinct_id (the user's actual ID) as distinct_id, with email/name as person properties
  • capture_exception uses correct positional argument syntax per Rails docs
  • Test mode properly disabled in non-test environments

PostHog insights and events ✅

Filename PostHog events Description
signups_controller.rb signup_requested Tracks when a visitor submits signup email form; includes signup_method, magic_link_purpose
signups/completions_controller.rb user_signed_up Tracks successful account creation; includes signup_method, account_id
sessions/magic_links_controller.rb user_logged_in Tracks successful magic link authentication; includes login_method, requires_signup_completion
boards_controller.rb board_created Tracks board creation; includes board_id, visibility
cards/publishes_controller.rb card_published Tracks card publishing; includes card_id, board_id, creation_type
webhooks_controller.rb webhook_created Tracks webhook creation; includes webhook_id, board_id, subscribed_action_count
application.js posthog.identify Identifies authenticated users on the client side with email, name, account_id
Multiple controllers captureException Manual exception capture in rescue blocks (redundant with auto-capture middleware)

Issues

  • No critical or medium issues with event quality.

Other completed criteria

  • Events represent real user actions mapping to actual product flows (signup → login → create board → publish card → create webhook)
  • Events enable product insights — can build a complete signup funnel, track feature adoption for boards/cards/webhooks
  • Events include relevant contextual properties (IDs, methods, types, counts)
  • No PII in capture() properties — email and name only appear in identify() person properties
  • Event names use consistent snake_case convention with descriptive action-oriented names

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants