Skip to content

[CI] (38ef7e6) rails/fizzy - #2609

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

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-38ef7e6-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: 38ef7e6
App: rails/fizzy
App directory: apps/rails/fizzy
Workbench branch: wizard-ci-38ef7e6-rails-fizzy
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-09T19:40:16.941Z
Duration: 1195.4s

YARA Scanner

✓ 97 tool calls scanned, 3 violations detected

  [REVERTED] posthog_pii_in_capture_call (HIGH) — PostToolUse:Edit
  [REVERTED] posthog_pii_in_capture_call (HIGH) — PostToolUse:Edit
  [REVERTED] posthog_pii_in_capture_call (HIGH) — PostToolUse:Edit

No violations: ✓ 94 clean scans

⚠️ YARA violations detected — see report above

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into a Ruby on Rails app ("Fizzy") by adding the posthog-ruby and posthog-rails gems, creating a server-side initializer with automatic exception/ActiveJob instrumentation, embedding the posthog-js snippet in the frontend layout, and instrumenting 12 business events across 10 controller files covering the full user lifecycle from signup to account cancellation.

Files changed Lines added Lines removed
19 +182 -0

Confidence score: 4/5 👍

  • No .env.example update: POSTHOG_PROJECT_TOKEN and POSTHOG_HOST are referenced via ENV.fetch but never documented in a .env.example file. The setup report itself flags this as a TODO. [MEDIUM]
  • No reverse proxy for frontend posthog-js: The posthog-js snippet points directly to us.i.posthog.com with no reverse proxy, making it vulnerable to ad blockers. [MEDIUM]

File changes

Filename Score Description
Gemfile 5/5 Adds posthog-ruby and posthog-rails gems correctly
config/initializers/posthog.rb 5/5 Proper PostHog.init and PostHog::Rails.configure with auto exception capture, ActiveJob, and user context
app/views/layouts/shared/_head.html.erb 4/5 posthog-js snippet with env-based config and frontend identify; no reverse proxy
app/controllers/application_controller.rb 5/5 Adds current_user method needed by posthog-rails for user context
app/models/user.rb 5/5 Adds posthog_distinct_id using identity.id with fallback, plus posthog_properties helper
app/controllers/sessions/magic_links_controller.rb 5/5 Identify + capture on sign-in with login_method property
app/controllers/signups/completions_controller.rb 5/5 Identify + capture on signup completion
app/controllers/boards_controller.rb 5/5 Captures board_created with board context
app/controllers/boards/publications_controller.rb 5/5 Captures board_published event
app/controllers/cards/*.rb (6 files) 5/5 Card lifecycle events (assigned, closed, commented, gilded, postponed, created)
app/controllers/account/cancellations_controller.rb 5/5 Captures account_cancelled with account context
app/controllers/account/exports_controller.rb 5/5 Captures data_export_started event
.gitignore 5/5 Adds .env to gitignore
posthog-setup-report.md 5/5 Comprehensive setup report with event table and next steps

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes All syntax is valid Ruby/ERB; gems are correctly referenced
Preserves existing env vars & configs Yes No existing code modified destructively; only additions
No syntax or type errors Yes All capture/identify calls use valid Ruby hash syntax
Correct imports/exports Yes Gems properly declared; PostHog class methods used correctly per posthog-rails pattern
Minimal, focused changes Yes Every change directly supports PostHog integration
Pre-existing issues None —

Issues

  • Missing .env.example documentation: POSTHOG_PROJECT_TOKEN and POSTHOG_HOST are used in both the initializer and the frontend snippet but are not documented in any .env.example or equivalent. New developers won't know what to set. [MEDIUM]

Other completed criteria

  • All changes are relevant to PostHog integration
  • Correct files modified for Rails framework (initializer, Gemfile, controllers, model, layout partial)
  • No unnecessary modifications or reformatting
  • Code follows existing codebase patterns (Rails 2-space indentation, Current.identity usage, controller structure)
  • Build configuration is valid (Gemfile additions are syntactically correct)

PostHog implementation ✅

Criteria Result Description
PostHog SDKs installed Yes posthog-ruby and posthog-rails gems in Gemfile; posthog-js via <script> snippet in layout
PostHog client initialized Yes PostHog.init block in initializer with API key and host; posthog-js init() in head partial with person_profiles: 'identified_only'
capture() Yes 12 meaningful PostHog.capture() calls across controllers using class-level methods
identify() Yes PostHog.identify() on sign-in and signup; frontend posthog.identify() for logged-in users; distinct_id uses identity.id consistently
Error tracking Yes auto_capture_exceptions: true, report_rescued_exceptions: true, auto_instrument_active_job: true — full coverage
Reverse proxy No posthog-js snippet points directly to PostHog host with no reverse proxy configured

Issues

  • No reverse proxy for posthog-js: The frontend snippet uses the PostHog host directly, making client-side tracking susceptible to ad blockers. A Rails route or Nginx proxy should be configured. [MEDIUM]

Other completed criteria

  • API key loaded from ENV.fetch("POSTHOG_PROJECT_TOKEN", nil) — not hardcoded
  • Host correctly configured via ENV.fetch("POSTHOG_HOST", "https://us.i.posthog.com") with sensible default
  • posthog_distinct_id defined on User model for automatic user association in error reports
  • current_user method added to ApplicationController for posthog-rails user context detection
  • user_id_method: :posthog_distinct_id configured in Rails config for explicit distinct ID extraction
  • Frontend and backend use consistent identity.id as distinct_id

PostHog insights and events ✅

Filename PostHog events Description
signups/completions_controller.rb signup_completed Tracks completed signups with account_id; identify sets email and name
sessions/magic_links_controller.rb user_signed_in Tracks magic link authentication with login_method property; identify sets email
boards_controller.rb board_created Tracks new board creation with board_id and board_name
boards/publications_controller.rb board_published Tracks boards being made public
cards/publishes_controller.rb card_created Tracks card publication with card_id and board_id
cards/closures_controller.rb card_closed Tracks card completion
cards/comments_controller.rb card_commented Tracks user engagement via comments
cards/assignments_controller.rb card_assigned Tracks task assignment
cards/goldnesses_controller.rb card_gilded Tracks high-priority marking
cards/not_nows_controller.rb card_postponed Tracks deferred cards
account/cancellations_controller.rb account_cancelled Tracks churn/account deletion
account/exports_controller.rb data_export_started Tracks data export requests
config/initializers/posthog.rb capturedException Automatic exception capture for controllers and ActiveJob

Issues

No issues.

Other completed criteria

  • Events represent real user actions mapping to actual product flows (signup → login → create board → create cards → manage cards → cancellation)
  • Events enable product insights: signup-to-login funnel, board-to-card funnel, engagement metrics, churn tracking
  • Events include relevant contextual properties (board_id, card_id, account_id, login_method, board_name)
  • No PII in capture properties — only IDs and non-sensitive metadata; email correctly placed in identify() person properties only
  • Event names are descriptive, consistent snake_case, and follow [object]_[verb] convention

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