Skip to content

[CI] (4c70a79) rails/fizzy - #3870

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

[CI] (4c70a79) rails/fizzy#3870
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-4c70a79-rails-fizzy

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 4c70a79
App: rails/fizzy
App directory: apps/rails/fizzy
Workbench branch: wizard-ci-4c70a79-rails-fizzy
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-09T22:30:47.485Z
Duration: 448.9s

YARA Scanner

✓ 219 tool calls scanned, 0 violations detected

No violations: ✓ 219 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 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 an initializer with proper configuration, adding a posthog_distinct_id method on the User model, and instrumenting 13 meaningful user actions across controllers covering signup, session, board, and card flows.

Files changed Lines added Lines removed
14 +137 -1

Confidence score: 5/5 🧙

  • Missing distinct_id in pre-auth capture calls: The sessions_controller.rb (sign_in, sign_up) and signups_controller.rb (signup_started) capture events without a distinct_id. Without frontend tracing headers, these become personless events with generated UUIDs that cannot be attributed to users. [MEDIUM]
  • Missing require: 'posthog' on gem declaration: The Gemfile declares gem "posthog-ruby" without require: 'posthog'. The docs specify gem 'posthog-ruby', require: 'posthog'. The explicit require "posthog" in the initializer compensates, but Bundler's auto-require will attempt require 'posthog-ruby' which is incorrect per SDK docs. [LOW]

File changes

Filename Score Description
config/initializers/posthog.rb 5/5 New initializer with PostHog.init and PostHog::Rails.configure, env var loading, graceful missing-var handling
app/models/user.rb 5/5 Adds posthog_distinct_id method returning id.to_s for user identification
app/controllers/application_controller.rb 5/5 Adds capture_posthog_event helper with feature toggle and posthog_current_user method
Gemfile 4/5 Adds both gems but missing require: 'posthog' on posthog-ruby
app/controllers/sessions_controller.rb 3/5 Captures magic_link_requested events but without distinct_id
app/controllers/signups_controller.rb 3/5 Captures signup_started without distinct_id
app/controllers/signups/completions_controller.rb 5/5 Captures signup_completed with distinct_id and signup method
app/controllers/boards_controller.rb 5/5 Captures board_created with properties
app/controllers/boards/publications_controller.rb 5/5 Captures board_published and board_unpublished
app/controllers/cards_controller.rb 5/5 Captures card_created for both draft and published flows
app/controllers/cards/closures_controller.rb 5/5 Captures card_closed and card_reopened
app/controllers/cards/comments_controller.rb 5/5 Captures card_comment_created
app/controllers/cards/steps_controller.rb 5/5 Captures card_step_created
app/controllers/account/cancellations_controller.rb 5/5 Captures account_cancelled with account_id

App sanity check ✅

Criteria Result Description
App builds and runs Yes Valid Ruby syntax, gems exist, initializer guards against missing env vars
Preserves existing env vars & configs Yes Only additive changes; existing controller logic and flow untouched
No syntax or type errors Yes All Ruby syntax is valid; ... forwarding operator used correctly
Correct imports/exports Yes require "posthog" in initializer is correct; gems properly declared
Minimal, focused changes Yes All changes directly serve the PostHog integration
Pre-existing issues None N/A

Issues

  • Missing require: 'posthog' in Gemfile: The gem "posthog-ruby", "~> 3.0" line lacks require: 'posthog'. Bundler auto-require will attempt require 'posthog-ruby' which is the wrong require path per SDK docs. The explicit require "posthog" in the initializer compensates, but it's better to follow the documented pattern. [LOW]

Other completed criteria

  • Environment variables documented in .env.example with POSTHOG_PROJECT_TOKEN and POSTHOG_HOST
  • Build configuration valid — Gemfile additions are syntactically correct

PostHog implementation ✅

Criteria Result Description
PostHog SDKs installed Yes Both posthog-ruby (~> 3.0) and posthog-rails gems added to Gemfile
PostHog client initialized Yes PostHog.init with api_key and host, plus PostHog::Rails.configure with exception tracking, ActiveJob instrumentation, and user context
capture() Yes 13 capture_posthog_event calls across 10 controllers using PostHog.capture class-level method
identify() N/A Server-only app
Error tracking Yes auto_capture_exceptions: true, report_rescued_exceptions: true, auto_instrument_active_job: true configured
Reverse proxy N/A Server-only app

Issues

  • Missing distinct_id in pre-auth events: Three capture calls (magic_link_requested ×2 in sessions_controller.rb and signup_started in signups_controller.rb) omit distinct_id. Without frontend tracing headers configured, these events become personless with auto-generated UUIDs. Fix: pass the email identity's user ID where available, or accept the limitation for pre-auth flows and document it. [MEDIUM]

Other completed criteria

  • API key loaded from ENV["POSTHOG_PROJECT_TOKEN"] — not hardcoded
  • Host loaded from ENV["POSTHOG_HOST"] — correctly configured
  • posthog_distinct_id defined on User model returning id.to_s — proper distinct ID source
  • posthog_current_user helper configured via current_user_method for automatic user context
  • user_id_method: :posthog_distinct_id configured for user ID extraction
  • Graceful degradation when env vars missing (raises in development, silently disables in production)

PostHog insights and events ✅

Filename PostHog events Description
sessions_controller.rb magic_link_requested Tracks sign-in and sign-up magic link requests with flow property
signups_controller.rb signup_started Tracks initial signup form submission
signups/completions_controller.rb signup_completed Tracks successful signup completion
account/cancellations_controller.rb account_cancelled Tracks account cancellation with account_id
boards_controller.rb board_created Tracks board creation with access level
boards/publications_controller.rb board_published, board_unpublished Tracks board publish/unpublish lifecycle
cards_controller.rb card_created Tracks card creation for both draft and published flows
cards/closures_controller.rb card_closed, card_reopened Tracks card close/reopen lifecycle
cards/comments_controller.rb card_comment_created Tracks comment creation on cards
cards/steps_controller.rb card_step_created Tracks step creation on cards
Automatic (posthog-rails) capturedException Auto-captures controller exceptions, rescued exceptions, and ActiveJob failures

Issues

No critical or medium issues with event quality.

Other completed criteria

  • Events represent real user actions across signup, board, and card workflows
  • Events enable product insights — signup funnel (signup_startedsignup_completed), board lifecycle, card management funnel
  • Events include relevant contextual properties (board_id, card_id, account_id, status, flow, signup_method)
  • No PII in event properties — only IDs and metadata
  • Event names are descriptive and consistently use snake_case 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