Skip to content

[CI] (9f92c68) react-native/expo-react-native-hacker-news - #2558

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-9f92c68-react-native-expo-react-native-hacker-news
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-9f92c68-react-native-expo-react-native-hacker-news

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 9f92c68
App: react-native/expo-react-native-hacker-news
App directory: apps/react-native/expo-react-native-hacker-news
Workbench branch: wizard-ci-9f92c68-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-07-08T17:19:26.964Z
Duration: 849.1s

YARA Scanner

✓ 60 tool calls scanned, 0 violations detected

No violations: ✓ 60 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into an Expo React Native Hacker News reader app using the posthog-react-native SDK. It adds a PostHog config singleton, wraps the app in PostHogProvider, implements manual screen tracking, and adds 13 custom capture calls across stories, comments, and user profile views. No error tracking or user identification is implemented.

Files changed Lines added Lines removed
12 +269 -25

Confidence score: 4/5 👍

  • No error tracking: No captureException, error boundary, or exception autocapture is configured. This is a recommended feature that is missing entirely. [CRITICAL]
  • No user identification: No posthog.identify() call exists anywhere. While the app appears to have no authentication flow, the integration should at minimum document this limitation or provide a placeholder. [MEDIUM]
  • No .env.example file: Environment variables POSTHOG_PROJECT_TOKEN and POSTHOG_HOST are not documented in a .env.example file. The setup report itself acknowledges this as a TODO. [MEDIUM]

File changes

Filename Score Description
src/config/posthog.ts 4/5 New PostHog singleton config with env-based API key, disabled state when unconfigured, and sensible defaults
app/_layout.tsx 4/5 Wraps app in PostHogProvider with manual screen tracking via useEffect/usePathname
app/[itemId].tsx 4/5 Adds story_viewed, story_upvoted, story_external_link_opened, parent_story_tapped events with properties
app/index.tsx 5/5 Adds story_type_changed event in handler function — clean pattern
app/users/[userId].tsx 4/5 Adds user_profile_viewed event tracking
components/posts/Post.tsx 5/5 Adds post_opened, post_external_link_opened, post_upvoted, post_comments_tapped events
components/comments/comment.tsx 5/5 Adds comment_author_tapped, comment_upvoted, comment_thread_tapped events
app.config.js 4/5 Exposes PostHog env vars via expo-constants extra field
package.json 5/5 Adds posthog-react-native and required Expo peer dependencies
posthog-setup-report.md 3/5 Documentation file with event table and next steps
.gitignore 5/5 Adds .env to gitignore
app.json 4/5 Adds expo-localization plugin (peer dep)

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Dependencies are correct, imports resolve, syntax is valid
Preserves existing env vars & configs Yes Existing layout, routing, and query client setup preserved; Stack config moved to inner component but unchanged
No syntax or type errors Yes All TypeScript usage appears correct
Correct imports/exports Yes posthog-react-native imports (PostHogProvider, usePostHog, PostHog) are correct
Minimal, focused changes Yes All changes directly support PostHog integration; peer deps are required
Pre-existing issues None No pre-existing issues observed

Issues

  • Missing .env.example: POSTHOG_PROJECT_TOKEN and POSTHOG_HOST env vars are used in app.config.js but no .env.example file was created. The setup report acknowledges this as a TODO. [MEDIUM]

Other completed criteria

  • Build configuration is valid — package.json has correct dependency entries and app.config.js is properly structured
  • .env correctly added to .gitignore
  • app.config.js properly exposes env vars through expo-constants extra field

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native ^4.54.4 added along with peer deps (expo-application, expo-device, expo-file-system, expo-localization)
PostHog client initialized Yes Singleton new PostHog() in src/config/posthog.ts with API key from Constants.expoConfig.extra, passed to PostHogProvider in _layout.tsx
capture() Yes 13 distinct custom events across 5 files covering stories, comments, and user profiles
identify() No No posthog.identify() call anywhere. The app has no visible auth flow, but the integration provides no guidance or placeholder
Error tracking No No captureException, error boundary, or exception autocapture configured
Reverse proxy N/A Mobile (React Native) app — reverse proxy is for browser-based posthog-js only

Issues

  • No error tracking configured: The integration doesn't set up any error tracking — no captureException(), no error boundary, no capture_exceptions option. For a React Native app, wrapping the app with error handling and calling posthog.captureException(error) would catch crashes and unhandled errors. [CRITICAL]
  • No user identification: No identify() call exists. While the HN reader app may lack authentication, the integration should either implement identify where possible or document why it's omitted. [MEDIUM]

Other completed criteria

  • API key correctly loaded from environment variable via expo-constants — not hardcoded
  • Host correctly configured with env var and fallback to https://us.i.posthog.com
  • PostHogProvider correctly wraps the app with client={posthog} prop
  • Manual screen tracking implemented via posthog.screen() with pathname change detection
  • Autocapture configured: touch capture enabled, screen capture disabled (manual tracking used instead)
  • App lifecycle events enabled via captureAppLifecycleEvents: true

PostHog insights and events ✅

Filename PostHog events Description
app/index.tsx story_type_changed Tracks when user switches between story feed types (top, best, ask, show) with previous/new type
app/[itemId].tsx story_viewed, story_upvoted, story_external_link_opened, parent_story_tapped Tracks story detail engagement: viewing, voting, opening external links, navigating to parent stories
app/users/[userId].tsx user_profile_viewed Tracks when a user views an HN profile page
components/posts/Post.tsx post_opened, post_external_link_opened, post_upvoted, post_comments_tapped Tracks feed-level post interactions: opening posts, external links, voting, viewing comments
components/comments/comment.tsx comment_author_tapped, comment_upvoted, comment_thread_tapped Tracks comment interactions: viewing author profiles, voting, opening threads
app/_layout.tsx `` (via posthog.screen()) Manual screen tracking on every pathname change with previous screen context

Issues

No issues — events are well-structured and enable meaningful product insights.

Other completed criteria

  • Events represent real user actions mapped to actual product flows (reading stories, engaging with content, navigating)
  • Events enable product insights: story reading funnel (viewed → upvoted), engagement trends, content type popularity
  • Events include relevant enriched properties (story_id, title, score, url, comment_count, author, etc.)
  • No PII in event properties — HN usernames are public identifiers, not personal data
  • Event names follow consistent snake_case convention with descriptive action names

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