[CI] (0ae2102) rails/fizzy#1233
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
|
Now I have all the context I need. Let me produce the evaluation report. PR Evaluation ReportSummaryThis PR integrates PostHog into a Ruby on Rails kanban app ("Fizzy") using
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors, gems are correctly referenced, initializer pattern is valid |
| Preserves existing env vars & configs | Yes | Only adds new code, no existing code modified destructively |
| No syntax or type errors | Yes | All Ruby syntax is valid, ERB template is well-formed |
| Correct imports/exports | Yes | Uses PostHog.capture / PostHog.identify class-level methods as required by posthog-rails |
| Minimal, focused changes | Yes | All changes relate to PostHog integration |
| Pre-existing issues | None | Base app appears well-structured |
Issues
- No .env.example file: The
.envfile is gitignored (good) but there's no.env.exampleor.env.sampleto document requiredPOSTHOG_PROJECT_TOKENandPOSTHOG_HOSTvariables. Other developers cloning the repo won't know what env vars to set. The setup report mentions them but a proper env example file is standard practice. [MEDIUM]
Other completed criteria
- Build configuration is valid — gems added correctly to Gemfile
- Code follows existing codebase patterns (Rails 2-space indentation, controller structure)
- No unnecessary modifications — all changes are PostHog-related
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-ruby and posthog-rails gems in Gemfile, plus posthog-js browser snippet in layout |
| PostHog client initialized | Yes | PostHog.init with env vars in config/initializers/posthog.rb, posthog-js snippet with posthog.init() in _head.html.erb |
| capture() | Yes | 10 meaningful capture calls across controllers covering core user flows |
| identify() | N/A | Server-only app (posthog-rails handles user context via capture_user_context). Frontend identify is a bonus. |
| Error tracking | Yes | auto_capture_exceptions: true, report_rescued_exceptions: true, auto_instrument_active_job: true — comprehensive automatic error tracking |
| Reverse proxy | N/A | Server-only app; frontend snippet is a bonus addition |
Issues
- Email address used as distinct_id everywhere:
posthog_distinct_idreturnsidentity&.email_address. AllPostHog.captureandPostHog.identifycalls use the email as the distinct ID. The PostHog docs explicitly warn against using raw email addresses as distinct IDs — they are PII and if the user changes their email, their identity fragments. Should use a stable identifier likeidentity&.idor"user_#{id}". [CRITICAL] - Inconsistent distinct_id sources: In
magic_links_controller.rbandcompletions_controller.rb, the distinct_id ismagic_link.identity.email_address/Current.identity.email_addressrespectively, while other controllers useCurrent.user.posthog_distinct_id(which also resolves to email). While consistent in value, the code paths differ — ifposthog_distinct_idwere fixed to return a proper ID, these two controllers would still send the email. [MEDIUM]
Other completed criteria
- API key loaded from environment variable (
ENV.fetch("POSTHOG_PROJECT_TOKEN", nil)) - Host correctly configured from environment variable (
ENV.fetch("POSTHOG_HOST", nil)) - Uses correct
PostHog.capture/PostHog.identifyclass-level methods (not instance methods) - posthog-rails initializer follows the documented pattern exactly
posthog_distinct_iddefined on User model for automatic user association in error reportscurrent_userhelper added to ApplicationController for posthog-rails user context- Frontend snippet uses CSP nonce for security compliance
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
sessions/magic_links_controller.rb |
user_signed_in |
Tracks magic link sign-in with login_method property |
signups/completions_controller.rb |
account_created |
Tracks new account creation after signup completion |
boards_controller.rb |
board_created |
Tracks board creation with board_id and all_access flag |
cards_controller.rb |
card_created |
Tracks card creation with card_id and board_id |
cards/closures_controller.rb |
card_closed, card_reopened |
Tracks card lifecycle with card_id and board_id |
cards/comments_controller.rb |
comment_added |
Tracks comment activity with card and board context |
cards/not_nows_controller.rb |
card_postponed |
Tracks card postponement with card and board context |
cards/triages_controller.rb |
card_triaged |
Tracks card triage with column_id for workflow position |
account/cancellations_controller.rb |
account_cancelled |
Tracks account churn with account_id |
config/initializers/posthog.rb |
capturedException (automatic) |
Auto-captures unhandled and rescued exceptions, ActiveJob failures |
Issues
- Email as distinct_id is PII leaking into events: Every
capture()call uses the email address asdistinct_id, which means the email is embedded in every event record. Whiledistinct_idis technically a person-level field, using email directly means PII is spread across all event data rather than being confined to person properties. [CRITICAL] account_createdevent lacks properties: Theaccount_createdcapture has no properties at all — no account ID, plan type, or referral source. Other events consistently include contextual properties. [LOW]
Other completed criteria
- Events represent real user actions — all 10 events map to actual product flows (auth, board management, card lifecycle, collaboration, churn)
- Events enable product insights — can build signup funnel (
account_created→board_created→card_created), engagement trends, and churn monitoring - Most events include relevant contextual properties (board_id, card_id, column_id, etc.)
- Event names are descriptive and use consistent snake_case convention
Reviewed by wizard workbench PR evaluator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated wizard CI run
Source: wizard-pr
Trigger ID:
0ae2102App:
rails/fizzyApp directory:
apps/rails/fizzyWorkbench branch:
wizard-ci-0ae2102-rails-fizzyWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-04-15T19:30:54.067Z
Duration: 499.7s