[CI] (97c6d9f) rails/fizzy#2035
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into a Ruby on Rails app ("Fizzy") by adding
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | Valid Ruby syntax throughout, gems are correctly specified |
| Preserves existing env vars & configs | Yes | Only additions, no existing code modified destructively |
| No syntax or type errors | Yes | All Ruby and ERB syntax is valid |
| Correct imports/exports | Yes | gem 'posthog-ruby', require: 'posthog' and gem 'posthog-rails' are correct per docs |
| Minimal, focused changes | Yes | All changes relate to PostHog integration |
| Pre-existing issues | None | No pre-existing issues noted |
Issues
- No
.env.examplefile:POSTHOG_PROJECT_TOKENandPOSTHOG_HOSTare required env vars but no.env.exampleor similar committed file documents them. The.envfile itself is gitignored. The setup report mentions this as a TODO but it should have been created. [MEDIUM] - XSS risk with
html_safe:Current.user.posthog_properties.to_json.html_safein the layout template could allow XSS if any user property contains</script>. Should usejson_escapeor thejhelper instead. [LOW]
Other completed criteria
- All changes are relevant to PostHog integration
- Correct files modified for Rails framework (Gemfile, initializer, controllers, model, layout)
- Code follows existing codebase patterns (indentation, naming, structure)
- No unnecessary modifications or reformatting
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-ruby and posthog-rails gems in Gemfile, plus posthog-js snippet in layout |
| PostHog client initialized | Yes | PostHog.init block in initializer with PostHog::Rails.configure for Rails-specific options; posthog-js initialized in _head.html.erb with posthog.init() |
| capture() | Yes | 15 meaningful PostHog.capture calls across controllers using class-level methods as documented |
| identify() | No | Uses raw email address (identity.email_address) as distinct_id in auth controllers, and posthog_distinct_id model method also returns email as primary value. Per rubric, raw email addresses as distinct IDs cause fragmented data |
| Error tracking | Yes | auto_capture_exceptions: true, report_rescued_exceptions: true, auto_instrument_active_job: true correctly configured |
| Reverse proxy | No | posthog-js frontend snippet sends requests directly to PostHog host with no reverse proxy configured |
Issues
- Raw email as distinct_id: The
posthog_distinct_idmethod returnsidentity&.email_address || id. In auth controllers (magic_links_controller,sessions_controller,signups/completions_controller),identity.email_addressis used directly as distinct_id. Email addresses are mutable PII — if a user changes their email, they become a different person in PostHog. Should use a stable identifier likeid(database primary key) consistently. [CRITICAL] - Inconsistent distinct_id resolution: Auth controllers use
identity.email_addressdirectly while other controllers useCurrent.user.posthog_distinct_id. While these resolve to the same value currently, this inconsistency is fragile and would break if theposthog_distinct_idmethod were updated to useidinstead. [MEDIUM] - No reverse proxy for posthog-js: The frontend snippet loads from PostHog's CDN and sends events directly to the PostHog host. Ad blockers will block these requests. Should configure a reverse proxy in the Rails app (e.g., via
config/routes.rbproxy or nginx). [MEDIUM]
Other completed criteria
- API key loaded from environment variable via
ENV.fetch("POSTHOG_PROJECT_TOKEN", nil) - Host correctly loaded from environment variable via
ENV.fetch("POSTHOG_HOST", nil) - Uses
PostHog.capture()andPostHog.identify()class-level methods as documented for Rails PostHog.initblock pattern used correctly (not manualPostHog::Client.new)capture_user_context: truewithcurrent_user_method: :current_userproperly configureduser_id_method: :posthog_distinct_idconfigured on the Rails config- Test mode enabled for test environment
- Error callback configured with
Rails.logger.error - Frontend posthog-js correctly identifies current user on page load
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
sessions/magic_links_controller.rb |
user_signed_in |
Tracks magic link authentication with sign_in_method property |
sessions_controller.rb |
user_signed_out |
Tracks explicit logout |
signups/completions_controller.rb |
signup_completed |
Tracks signup completion with account_id |
boards_controller.rb |
board_created, board_deleted |
Tracks board lifecycle with board metadata |
boards/publications_controller.rb |
board_published, board_unpublished |
Tracks board visibility changes |
boards/columns_controller.rb |
column_created |
Tracks workflow stage creation |
cards_controller.rb, cards/publishes_controller.rb |
card_created |
Tracks card creation from two paths |
cards/closures_controller.rb |
card_closed, card_reopened |
Tracks card resolution lifecycle |
cards/not_nows_controller.rb |
card_postponed |
Tracks card postponement |
cards/comments_controller.rb |
comment_created |
Tracks collaboration activity |
cards/goldnesses_controller.rb |
card_gilded |
Tracks card prioritization |
account/cancellations_controller.rb |
account_cancelled |
Tracks account churn |
config/initializers/posthog.rb |
capturedException (automatic) |
Auto-captures unhandled and rescued exceptions, plus ActiveJob failures |
Issues
No issues — event quality is strong.
Other completed criteria
- Events represent real user actions (authentication, content creation, board management, account lifecycle)
- Events enable product insights: signup funnel (
user_signed_in→signup_completed), card completion funnel (card_created→card_closed), engagement trends, churn monitoring - Events include contextual properties (board_id, card_id, board_name, sign_in_method, etc.)
- No PII in event properties — email and name are only set via
PostHog.identifyperson properties and frontendposthog.identify() - Event names are descriptive, consistent snake_case, and follow
[object]_[verb]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:
97c6d9fApp:
rails/fizzyApp directory:
apps/rails/fizzyWorkbench branch:
wizard-ci-97c6d9f-rails-fizzyWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-06-23T16:16:16.413Z
Duration: 886.4s