Skip to content

[CI] (0e81558) rails/fizzy - #4257

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

wizard-ci-bot[bot] wants to merge 2 commits into
mainfrom
wizard-ci-0e81558-rails-fizzy

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 0e81558
App: rails/fizzy
App directory: apps/rails/fizzy
Workbench branch: wizard-ci-0e81558-rails-fizzy
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-29T08:41:37.810Z
Duration: 454.7s

YARA Scanner

✓ 248 tool calls scanned, 0 violations detected

No violations: ✓ 248 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 29, 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 environment-variable-based configuration, defining a posthog_distinct_id method on the User model, adding a helper method in ApplicationController, and instrumenting 14 custom events across various controllers covering core product actions.

Files changed Lines added Lines removed
17 +128 -0

Confidence score: 4/5 👍

  • No .env.example or equivalent documentation for required environment variables: POSTHOG_PROJECT_TOKEN and POSTHOG_HOST are required but not documented in any committed file (only .env added to .gitignore). [MEDIUM]
  • require 'posthog' not explicitly added: The initializer calls PostHog.init without an explicit require 'posthog' — this likely works via Bundler autoloading in Rails, but should be verified. [LOW]

File changes

Filename Score Description
config/initializers/posthog.rb 5/5 New initializer with env-var-based config, PostHog.init block, Rails-specific config, and a helpful dev-mode error for missing vars
app/models/user.rb 5/5 Adds posthog_distinct_id returning stable UUID-based user ID
app/controllers/application_controller.rb 5/5 Adds posthog_current_user and guarded capture_posthog_event helper
Gemfile 5/5 Adds posthog-ruby and posthog-rails gems correctly
.gitignore 5/5 Adds .env to gitignore
Various controllers (12 files) 4/5 Well-placed capture calls for meaningful product events with appropriate properties

App sanity check ✅

Criteria Result Description
App builds and runs Yes Gems are valid, initializer syntax is correct, no breaking changes
Preserves existing env vars & configs Yes All existing code untouched; PostHog additions are purely additive
No syntax or type errors Yes All Ruby syntax is valid; capture(...) delegation pattern is correct Ruby 3.1+ syntax
Correct imports/exports Yes Gems specified correctly; posthog-ruby with require: 'posthog' not explicitly set in Gemfile but posthog-rails handles initialization
Minimal, focused changes Yes Every change relates to PostHog integration
Pre-existing issues None No pre-existing issues observed

Issues

  • Environment variables not documented: POSTHOG_PROJECT_TOKEN and POSTHOG_HOST are required but there is no .env.example or README update documenting them. The dev-mode error message partially mitigates this but a committed example file would be better. [MEDIUM]

Other completed criteria

  • Build configuration is valid — Gemfile additions are properly formatted
  • Changes are all relevant to PostHog integration
  • Code follows existing codebase patterns (indentation, naming, controller structure)

PostHog implementation ✅

Criteria Result Description
PostHog SDKs installed Yes Both posthog-ruby (~> 3.0) and posthog-rails added to Gemfile
PostHog client initialized Yes PostHog.init block with api_key and host in initializer; PostHog::Rails.configure sets up auto exception capture, ActiveJob, and user context
capture() Yes 14 meaningful PostHog.capture() calls via capture_posthog_event helper across controllers
identify() N/A Server-only app; user context handled via posthog_distinct_id on User model and capture_user_context config
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 — reverse proxy not applicable

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 uses stable id.to_s (UUID) — proper distinct ID strategy
  • posthog_current_user configured as current_user_method for automatic user association
  • Guard pattern (if Rails.configuration.x.posthog.enabled) prevents errors when PostHog is not configured
  • Uses PostHog.capture() class-level methods as documented for Rails (not instance methods)

PostHog insights and events ✅

Filename PostHog events Description
signups/completions_controller.rb account_created Tracks new account signups
account/cancellations_controller.rb account_canceled Tracks account deletions — captures distinct_id before cancel
account/exports_controller.rb data_export_requested Tracks data export requests
boards_controller.rb board_created Tracks board creation with all_access property
boards/publications_controller.rb board_published Tracks board publication
cards_controller.rb card_created Tracks card creation with creation_source: "api"
cards/publishes_controller.rb card_published Tracks card publishing with add_another property
cards/closures_controller.rb card_closed, card_reopened Tracks card lifecycle state changes
cards/assignments_controller.rb card_assignment_toggled Tracks assignment changes
cards/comments_controller.rb comment_created Tracks comment creation
my/access_tokens_controller.rb access_token_created Tracks token creation with permission property
webhooks_controller.rb webhook_created Tracks webhook creation
config/initializers/posthog.rb capturedException (auto) Automatic exception capture via posthog-rails

Issues

None.

Other completed criteria

  • Events represent real user actions mapping to actual product flows (signup → create boards → publish cards → manage account)
  • Events enable product insights — can build signup-to-engagement funnels, retention analysis on board/card creation
  • Several events include enriched properties (all_access, creation_source, permission, add_another)
  • No PII in event properties — distinct IDs are UUIDs, no emails or names in capture properties
  • Event names follow consistent snake_case [object]_[verb] convention
  • Smart detail: account_canceled captures distinct_id before the cancel call, preventing potential issues if the user record is destroyed

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