Skip to content

[CI] (3f39e0e) rails/fizzy - #4170

Closed
wizard-ci-bot[bot] wants to merge 2 commits into
mainfrom
wizard-ci-3f39e0e-rails-fizzy
Closed

wizard-ci-bot[bot] wants to merge 2 commits into
mainfrom
wizard-ci-3f39e0e-rails-fizzy

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 3f39e0e
App: rails/fizzy
App directory: apps/rails/fizzy
Workbench branch: wizard-ci-3f39e0e-rails-fizzy
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-23T22:12:40.384Z
Duration: 620.9s

YARA Scanner

✓ 254 tool calls scanned, 0 violations detected

No violations: ✓ 254 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into a Ruby on Rails application ("fizzy") by adding the posthog-ruby and posthog-rails gems, creating an initializer with OpenTelemetry log forwarding, adding a posthog_distinct_id method on the User model, and instrumenting 13 controllers with meaningful event captures across core product flows.

Files changed Lines added Lines removed
17 +143 -1

Confidence score: 5/5 🧙

  • PostHogLogCapture references undefined class: PostHogLogCapture is used in controllers but defined only in the initializer module — this works at runtime but the class is not a standard PostHog pattern and uses an OpenTelemetry logger API (emit with severity_text, body, attributes) that needs verification against the actual gem version.
  • Development environment raises on missing env vars: The initializer raises a hard error in development if either env var is missing, which could break rails console or rails db:migrate for developers who haven't configured PostHog yet. A warning would be more appropriate.

File changes

Filename Score Description
config/initializers/posthog.rb 4/5 Well-structured initializer with PostHog.init, Rails config, OTel log forwarding, and env var guard
app/models/user.rb 5/5 Adds posthog_distinct_id returning id.to_s — clean, follows Rails docs
app/controllers/application_controller.rb 5/5 Adds capture_posthog helper with configuration guard and current_user method
.env.example 5/5 Documents both required env vars
Gemfile 4/5 Adds posthog-ruby, posthog-rails, OTel gems, and dotenv-rails
.gitignore 5/5 Properly excludes .env but allows .env.example
Controller files (12 files) 4/5 Consistent event capture across product flows with meaningful names and properties

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Gems are valid, syntax is correct, initializer properly guards against missing config
Preserves existing env vars & configs Yes No existing code removed (only 1 line changed in assignments controller to extract variable), configs untouched
No syntax or type errors Yes All Ruby syntax is valid, method signatures correct
Correct imports/exports Yes require 'opentelemetry/sdk' and require 'opentelemetry/exporter/otlp' are correct for the gems added
Minimal, focused changes Yes All changes relate to PostHog integration
Pre-existing issues None —

Issues

  • Hard error in development for missing env vars: The initializer raises an exception in development if either POSTHOG_PROJECT_TOKEN or POSTHOG_HOST is missing. This will break any rails command for developers who haven't set up PostHog. A Rails.logger.warn would be safer and more conventional. [MEDIUM]

Other completed criteria

  • All changes are relevant to PostHog integration
  • Correct files modified for Rails (initializer, Gemfile, controllers, model)
  • Code follows existing codebase patterns (indentation, naming conventions)
  • Environment variables documented in .env.example
  • .gitignore properly updated to allow .env.example

PostHog implementation ✅

Criteria Result Description
PostHog SDKs installed Yes posthog-ruby (~> 3.0) and posthog-rails added to Gemfile
PostHog client initialized Yes PostHog.init block with api_key and host; PostHog::Rails.configure with exception tracking, ActiveJob instrumentation, and user context
capture() Yes 13 capture_posthog calls across controllers using PostHog.capture via helper method
identify() N/A Server-only app
Error tracking Yes auto_capture_exceptions: true, report_rescued_exceptions: true, auto_instrument_active_job: true — comprehensive error tracking setup
Reverse proxy N/A Server-only app

Issues

None.

Other completed criteria

  • API key loaded from ENV["POSTHOG_PROJECT_TOKEN"] — not hardcoded
  • Host loaded from ENV["POSTHOG_HOST"] — correctly configured
  • posthog_distinct_id method defined on User model returning id.to_s — follows Rails docs pattern
  • user_id_method = :posthog_distinct_id configured in Rails config
  • current_user_method = :current_user configured, matching the new current_user helper in ApplicationController
  • capture_user_context: true enables automatic user association for exceptions
  • Class-level PostHog.capture() used correctly (not instance methods) per Rails docs
  • Configuration guard (Rails.configuration.x.posthog_configured) prevents calls when PostHog is not set up

PostHog insights and events ✅

Filename PostHog events Description
cancellations_controller.rb account_cancelled Tracks account deletion
exports_controller.rb account_export_started Tracks data export initiation
signups/completions_controller.rb account_created Tracks new account signup completion
users/joins_controller.rb profile_completed Tracks user profile completion
boards_controller.rb board_created Tracks board creation
boards/publications_controller.rb board_published Tracks board publishing
cards_controller.rb card_created Tracks card creation with creation_flow property (draft/api)
cards/assignments_controller.rb card_assignment_changed Tracks assignment changes with assignment_action property
cards/closures_controller.rb card_closed, card_reopened Tracks card lifecycle state changes
cards/comments_controller.rb comment_created Tracks comment creation
webhooks/activations_controller.rb webhook_activated Tracks webhook activation
config/initializers/posthog.rb capturedException (auto) Automatic exception capture via posthog-rails

Issues

None.

Other completed criteria

  • Events represent real user actions across the full product lifecycle (signup → board/card management → account deletion)
  • Events enable product insights: signup funnel (account_created → profile_completed), engagement (card_created, comment_created, board_published), and churn (account_cancelled)
  • Key events include contextual properties (creation_flow, assignment_action)
  • No PII in event properties — distinct_id uses numeric user ID
  • Event names follow consistent snake_case [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