Skip to content

[CI] (624abe2) react-native/expo-react-native-hacker-news - #4469

Closed
wizard-ci-bot[bot] wants to merge 3 commits into
mainfrom
wizard-ci-624abe2-react-native-expo-react-native-hacker-news
Closed

wizard-ci-bot[bot] wants to merge 3 commits into
mainfrom
wizard-ci-624abe2-react-native-expo-react-native-hacker-news

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 624abe2
App: react-native/expo-react-native-hacker-news
App directory: apps/react-native/expo-react-native-hacker-news
Workbench branch: wizard-ci-624abe2-react-native-expo-react-native-hacker-news
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-10-08T09:27:33.706Z
Duration: 393.1s

YARA Scanner

✓ 187 tool calls scanned, 0 violations detected

No violations: ✓ 187 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into an Expo React Native Hacker News reader app. It adds posthog-react-native SDK initialization via a dedicated lib/posthog.ts module, wraps the app with PostHogProvider, and adds well-placed capture() calls across story and comment components. Error tracking autocapture and structured logging are also configured.

Files changed Lines added Lines removed
11 +148 -27

Confidence score: 5/5 🧙

  • Missing screen view tracking: React Native requires explicit screen view registration (e.g., autocapture config on PostHogProvider). Without it, no screen view events will be sent. [CRITICAL]
  • No user identification: No identify() call is present. While this Hacker News reader has no auth system, the integration could still benefit from anonymous identification documentation or a placeholder pattern. [MEDIUM]

File changes

Filename Score Description
lib/posthog.ts 4/5 PostHog initialization with error tracking, logging, and lifecycle events. Missing screen capture config.
app/_layout.tsx 4/5 PostHogProvider wrapping navigator with graceful fallback when PostHog is undefined.
app/[itemId].tsx 5/5 Adds capture calls for author profile and external story link interactions.
components/posts/Post.tsx 5/5 Multiple well-placed capture calls with entry_point properties.
components/posts/Posts.tsx 4/5 Structured logging for story feed lifecycle events.
components/Select.tsx 5/5 Captures story feed type changes with from/to properties.
components/comments/comment.tsx 5/5 Captures author profile navigation from comments.
app.config.js 5/5 Properly exposes env vars through Expo constants.
.env.example 5/5 Documents required environment variables.
package.json 5/5 Adds posthog-react-native dependency.
.gitignore 5/5 Excludes .env from version control.

App sanity check ✅

Criteria Result Description
App builds and runs Yes No syntax errors; SDK and config additions are well-formed
Preserves existing env vars & configs Yes Existing layout structure preserved; only wraps with PostHogProvider
No syntax or type errors Yes All TypeScript types and JSX are correct
Correct imports/exports Yes posthog-react-native imports (PostHog, PostHogProvider, usePostHog) are correct
Minimal, focused changes Yes All changes directly serve the PostHog integration
Pre-existing issues None —

Issues

No issues.

Other completed criteria

  • Environment variables documented in .env.example
  • .gitignore updated to exclude .env
  • app.config.js properly passes env vars through Expo constants
  • Build configuration valid — package.json dependency addition is correct

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native ^4.79.2 added to package.json
PostHog client initialized Yes Initialized via new PostHog() in lib/posthog.ts, wrapped with PostHogProvider in layout
capture() Yes 7 meaningful capture calls across story, comment, and feed components
identify() No No identify call — app has no auth system, but no identification pattern is present
Error tracking Yes errorTracking.autocapture configured with uncaughtExceptions and unhandledRejections
Reverse proxy N/A Mobile app — reverse proxy only benefits browser-based posthog-js
Screen views No No screen view tracking configured — missing autocapture option on PostHogProvider or navigation observer

Issues

  • No screen view tracking: The PostHogProvider wraps the Stack navigator but does not configure screen view autocapture. For Expo Router with posthog-react-native, screen views require explicit configuration. Without this, the app sends zero screen view events, making navigation analytics impossible. [CRITICAL]
  • No identify call: While this Hacker News reader is a read-only app with no authentication, the integration does not implement any user identification pattern. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable via Expo constants (not hardcoded)
  • API host correctly configured from environment variable
  • Graceful fallback when PostHog credentials are missing (app still renders)
  • captureAppLifecycleEvents: true enables app open/close tracking
  • Structured logging configured with logs.serviceName: "hacker-native"
  • Dev-only error thrown when env vars are missing — good developer experience

PostHog insights and events ✅

Filename PostHog events Description
components/posts/Post.tsx external_story_opened, story_opened, comments_opened Tracks story interactions with entry_point context (story_title, story_card, story_card_link)
app/[itemId].tsx author_profile_opened, external_story_opened Tracks author profile navigation and external link clicks from story detail
components/comments/comment.tsx author_profile_opened Tracks author profile navigation from comment metadata
components/Select.tsx story_feed_changed Tracks feed type switching with from/to story type properties
components/posts/Posts.tsx posthogLog.info (3 calls) Structured logs for feed request lifecycle (started, completed, page loaded)
lib/posthog.ts capturedExceptions (autocapture) Uncaught exceptions and unhandled rejections automatically captured

Issues

No issues with event quality.

Other completed criteria

  • Events represent real user actions (opening stories, viewing profiles, switching feeds)
  • Events enable product insights — can build funnels (feed → story → external link), retention on story engagement
  • Events include relevant properties — entry_point, story_type, from_story_type/to_story_type, page_offset, page_size
  • No PII in event properties
  • Event names are descriptive and use consistent 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