Skip to content

[CI] (6fb03e7) swift/hackers-ios#1493

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-6fb03e7-swift-hackers-ios
Closed

[CI] (6fb03e7) swift/hackers-ios#1493
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-6fb03e7-swift-hackers-ios

Conversation

@wizard-ci-bot
Copy link
Copy Markdown

@wizard-ci-bot wizard-ci-bot Bot commented May 13, 2026

Automated wizard CI run

Source: scheduled
Trigger ID: 6fb03e7
App: swift/hackers-ios
App directory: apps/swift/hackers-ios
Workbench branch: wizard-ci-6fb03e7-swift-hackers-ios
Wizard branch: main
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-05-13T17:56:03.186Z
Duration: 594.7s

@wizard-ci-bot
Copy link
Copy Markdown
Author

wizard-ci-bot Bot commented May 13, 2026

PR Evaluation Report

Summary

This PR integrates PostHog analytics into a Swift iOS Hacker News client app. It adds the PostHog iOS SDK via SPM, initializes it in the SwiftUI app entry point using environment variables, and instruments 13 events across authentication, feed, comments, onboarding, and in-app purchases.

Files changed Lines added Lines removed
14 +209 -8

Confidence score: 5/5 🧙

  • PII in event properties: username is passed as an event property in user_logged_in capture call — PII should only go in person properties (via identify), not in capture() event properties. [MEDIUM]
  • No error/exception tracking: No captureException or error tracking configuration is set up. [MEDIUM]
  • Stale minimum SDK version: minimumVersion is set to 3.0.0 across all Package.swift files and project.pbxproj, but the latest posthog-ios release is ~3.58.0. The resolved version is 3.40.0, still behind. [MEDIUM]

File changes

Filename Score Description
App/HackersApp.swift 5/5 Adds PostHogEnv enum and SDK initialization in init() with lifecycle events
App/OnboardingCoordinator.swift 5/5 Captures onboarding_completed event with app version
Features/Authentication/Package.swift 4/5 Adds posthog-ios SPM dependency (stale min version)
Features/Authentication/.../LoginViewModel.swift 4/5 Identify, login/logout events, reset on logout — but username in event properties
Features/Comments/Package.swift 4/5 Adds posthog-ios SPM dependency (stale min version)
Features/Comments/.../CommentsViewModel.swift 5/5 Captures upvote and bookmark events with context
Features/Feed/Package.swift 4/5 Adds posthog-ios SPM dependency (stale min version)
Features/Feed/.../FeedViewModel.swift 5/5 Captures feed category change, upvote, bookmark, search events
Features/Settings/Package.swift 4/5 Adds posthog-ios SPM dependency (stale min version)
Features/Settings/.../SupportViewModel.swift 5/5 Captures purchase success/failure with product details
Hackers.xcodeproj/project.pbxproj 5/5 Correct three-object SPM integration pattern
...swiftpm/Package.resolved 5/5 Pins posthog-ios at v3.40.0
...xcschemes/Hackers.xcscheme 5/5 Adds POSTHOG_PROJECT_TOKEN and POSTHOG_HOST env vars
posthog-setup-report.md 4/5 Comprehensive setup report

App sanity check ✅

Criteria Result Description
App builds and runs Yes SPM dependencies correctly added, imports valid, syntax correct
Preserves existing env vars & configs Yes SupportViewModel logic restructured but behavior preserved; no existing configs removed
No syntax or type errors Yes All Swift syntax valid, PostHog API calls match SDK signatures
Correct imports/exports Yes import PostHog added in all files using the SDK
Minimal, focused changes Yes All changes directly related to PostHog integration
Pre-existing issues None

Issues

No critical or medium issues with app sanity.

Other completed criteria

  • Environment variables documented via Xcode scheme environment variables
  • Build configuration valid — SPM Package.swift files and project.pbxproj correctly configured
  • SupportViewModel if-statement restructure preserves identical logic flow

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-ios added via SPM in project.pbxproj with PBXBuildFile, XCSwiftPackageProductDependency, and XCRemoteSwiftPackageReference; also added to 4 feature Package.swift files
PostHog client initialized Yes PostHogConfig(apiKey:host:) + PostHogSDK.shared.setup(config) in SwiftUI App.init() with captureApplicationLifecycleEvents = true
capture() Yes 13 meaningful capture calls across 5 view models
identify() Yes PostHogSDK.shared.identify(username) on login, PostHogSDK.shared.reset() on logout
Error tracking No No error/exception tracking configured
Reverse proxy N/A iOS mobile app — reverse proxy only applies to browser-based PostHog JS

Issues

  • No error tracking setup: The integration lacks any captureException or error tracking configuration. PostHog iOS SDK supports exception autocapture — this should be enabled via config. [MEDIUM]
  • Stale SDK minimum version: All Package.swift files and project.pbxproj specify from: "3.0.0" / minimumVersion = 3.0.0, but the latest posthog-ios release is ~3.58.0. Per framework rules, the minimum version should reflect a recent release to avoid pulling outdated SDK versions. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable via PostHogEnv enum with ProcessInfo.processInfo.environment — matches framework pattern
  • Host correctly configured via environment variable, set to https://us.i.posthog.com in scheme
  • PostHogEnv enum follows the prescribed pattern with projectToken and host cases, fatalError on missing values
  • Three distinct SPM objects in project.pbxproj with unique UUIDs (PBXBuildFile, XCSwiftPackageProductDependency, XCRemoteSwiftPackageReference)
  • PostHogSDK.shared.reset() called on logout before clearing state

PostHog insights and events ⚠️

Filename PostHog events Description
LoginViewModel.swift user_logged_in, login_failed, user_logged_out Auth flow tracking with identify on login, reset on logout
OnboardingCoordinator.swift onboarding_completed Tracks onboarding completion with app_version
FeedViewModel.swift post_upvoted, feed_category_changed, bookmark_toggled, search_performed Core feed engagement tracking with post details and search context
CommentsViewModel.swift post_upvoted, comment_upvoted, bookmark_toggled Comment-level engagement with source differentiation
SupportViewModel.swift purchase_completed, purchase_failed IAP tracking with product details and error context

Issues

  • PII in event properties: user_logged_in event includes "username": username as an event property. Username is PII and should only be set via person properties (which is already done correctly via identify()). Remove username from the capture() properties dict. [MEDIUM]

Other completed criteria

  • Events represent real user actions across all core app flows (auth, feed, comments, purchases, onboarding)
  • Events enable product insights — login funnel, engagement trends, search analysis, purchase conversion
  • Events enriched with contextual properties (post_id, post_title, category, source, result_count, product details)
  • Event names are descriptive and use consistent snake_case convention
  • login_failed correctly omits username to avoid leaking credentials on error paths
  • source property differentiates feed vs comments context for post_upvoted and bookmark_toggled

Reviewed by wizard workbench PR evaluator

@wizard-ci-bot wizard-ci-bot Bot added the CI/CD label May 13, 2026
@wizard-ci-bot wizard-ci-bot Bot closed this May 13, 2026
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