Skip to content

[CI] (9da603e) react-native/expo-react-native-hacker-news - #4402

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

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

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 9da603e
App: react-native/expo-react-native-hacker-news
App directory: apps/react-native/expo-react-native-hacker-news
Workbench branch: wizard-ci-9da603e-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-06T15:57:38.225Z
Duration: 401.7s

YARA Scanner

✓ 198 tool calls scanned, 1 violation detected

  [WARNED] prompt_injection_posthog_integration_attack (MEDIUM) — skill-install:installSkillById

No violations: ✓ 197 clean scans

⚠️ YARA violations detected — see report above

@wizard-ci-bot

wizard-ci-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown
Author

Now I have all the context needed. Let me write the evaluation.


PR Evaluation Report

Summary

This PR integrates PostHog into an Expo React Native Hacker News reader app. It adds the posthog-react-native SDK, initializes it with environment-variable-driven configuration, implements manual screen tracking via Expo Router's usePathname, adds error tracking with autocapture, and sprinkles meaningful capture() calls across user interaction points (opening items, external links, user profiles, and category selection).

Files changed Lines added Lines removed
10 +157 -31

Confidence score: 5/5 🧙

  • No identify() call present — the app is a read-only Hacker News client with no authentication, so there is no user to identify. This is the correct behavior per PostHog docs ("When no ID is available at all, skip the identify"), but it limits person-level analytics. [MEDIUM]
  • The app.config.js created by this PR may conflict with the existing app.json — Expo will use app.config.js over app.json and the spread ...appConfig.expo should merge correctly, but this introduces a new config file where the original app.json existed alone. [LOW]

File changes

Filename Score Description
lib/posthog.ts 5/5 Clean PostHog initialization with env-var-driven config, error tracking, lifecycle events, logging, and defensive checks for missing tokens
app/_layout.tsx 4/5 Adds PostHogProvider and ScreenTracker component; screen tracking correctly uses usePathname with posthog?.screen()
app/[itemId].tsx 5/5 Adds capture calls for user_profile_opened, external_link_opened, and item_opened with entry_point properties
components/posts/Post.tsx 5/5 Adds capture calls for item_opened and external_link_opened with entry_point context
components/comments/comment.tsx 5/5 Adds capture for user_profile_opened and item_opened from comment context
components/Select.tsx 5/5 Adds capture for story_category_selected with story_type property
app.config.js 4/5 Dynamic Expo config to pass env vars via expo-constants; correct pattern for Expo
.env.example 5/5 Documents both required environment variables
.gitignore 5/5 Adds .env to prevent secret leakage
package.json 5/5 Adds posthog-react-native ^4.79.0

App sanity check ✅

Criteria Result Description
App builds and runs Yes No syntax errors, all imports resolve, SDK version is valid
Preserves existing env vars & configs Yes Existing app.json is preserved; app.config.js extends it via spread
No syntax or type errors Yes All TypeScript is valid; optional chaining used consistently
Correct imports/exports Yes posthog-react-native imported correctly as both default and PostHogProvider
Minimal, focused changes Yes All changes directly serve PostHog integration
Pre-existing issues None Base app appears clean

Issues

No issues.

Other completed criteria

  • Environment variables documented in .env.example with EXPO_PUBLIC_POSTHOG_PROJECT_TOKEN and EXPO_PUBLIC_POSTHOG_HOST
  • .env added to .gitignore to prevent secret leakage
  • Build configuration valid — package.json adds dependency correctly

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native ^4.79.0 added to dependencies
PostHog client initialized Yes Correctly uses new PostHog(projectToken, { host, ... }) with lifecycle events, error tracking, and logging
capture() Yes Multiple meaningful capture calls across 5 files covering item opens, external links, user profiles, and category selection
identify() No No identify call — app has no authentication system (read-only HN client), so this is the correct behavior per PostHog docs, but limits person-level analytics
Error tracking Yes errorTracking: { autocapture: { uncaughtExceptions: true, unhandledRejections: true } } configured in init
Reverse proxy N/A Mobile app — reverse proxy only benefits browser-based posthog-js

Issues

  • No identify() implementation: The app is a read-only Hacker News reader with no user authentication, so there is no user identity to link. Per PostHog docs, skipping identify when no ID is available is correct. However, if authentication were ever added, identify should be called on login and reset on logout. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable via expo-constants and app.config.js extra — not hardcoded
  • Host correctly configured from environment variable, defaulting to https://us.i.posthog.com in .env.example
  • Screen views correctly implemented via ScreenTracker component using posthog?.screen(screenName) with Expo Router's usePathname
  • PostHogProvider wraps the app tree, enabling hooks and context access
  • captureAppLifecycleEvents: true enables automatic app foreground/background tracking
  • Logging configured with serviceName: "hacker-native" and environment-aware settings
  • All targets initialized — posthog-react-native supports iOS, Android, and web via React Native Web

PostHog insights and events ✅

Filename PostHog events Description
lib/posthog.ts captureAppLifecycleEvents, captureExceptions Automatic lifecycle events and error tracking configured at init
app/_layout.tsx screen() (home, user_details, item_details) Screen views tracked via pathname changes with semantic screen names
app/[itemId].tsx user_profile_opened, external_link_opened, item_opened Tracks author profile views, external story links, and parent item navigation with entry_point context
components/posts/Post.tsx item_opened, external_link_opened Tracks post card taps and external link opens with item_id and entry_point
components/comments/comment.tsx user_profile_opened, item_opened Tracks comment author profile and reply navigation with entry_point
components/Select.tsx story_category_selected Tracks story type filter changes with story_type property

Issues

No issues.

Other completed criteria

  • Events represent real user actions mapping to actual product flows (browse → open item → view external link → view author)
  • Events enable product insights: can build funnels (home → item_opened → external_link_opened), track category preferences, measure engagement depth
  • Events enriched with contextual properties: entry_point differentiates navigation sources, item_id links to content, story_type identifies category
  • No PII in event properties — only item IDs, entry points, and screen names
  • Event names use 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