[CI] (0ae2102) swift/hackers-ios#1247
Conversation
|
I wasn't able to verify the exact latest version of posthog-ios from external sources, but version 3.50.0 appears to be a reasonable recent version. Let me now complete the full evaluation based on the diff. Let me also check a critical detail - whether the API key in the scheme file looks like a real key that should be flagged. Looking at the scheme file, the API key value is Now let me check a few more things about the identify call: Looking at PostHogSDK.shared.identify(username, userProperties: ["username": username])
PostHogSDK.shared.capture("user_logged_in", properties: ["username": username])The Also notable: Now let me assess error tracking - I don't see any explicit error tracking setup (like PR Evaluation ReportSummaryThis PR integrates the PostHog iOS SDK (v3.50.0) into a Hacker News reader iOS app built with SwiftUI and Swift Package Manager. The integration adds SDK initialization in the app entry point, user identification on login, reset on logout, and 11 custom analytics events across authentication, feed, comments, voting, settings/purchases, and onboarding modules.
Confidence score: 5/5 🧙
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | All changes are syntactically valid Swift, SPM dependencies correctly configured, pbxproj has proper UUIDs |
| Preserves existing env vars & configs | Yes | Existing scheme settings, build configs, and Package.swift dependencies preserved |
| No syntax or type errors | Yes | All Swift code follows correct PostHog iOS SDK API patterns |
| Correct imports/exports | Yes | import PostHog added in all files that use PostHogSDK.shared |
| Minimal, focused changes | Yes | All changes relate to PostHog integration; the SupportViewModel refactor is minimal and necessary |
| Pre-existing issues | None | No pre-existing issues noted |
Issues
- Duplicated SPM dependency: PostHog is added as a dependency in 5 separate Package.swift files. While functional, centralizing through the Shared module would be cleaner. [LOW]
Other completed criteria
- Environment variables documented in Xcode scheme
- Build configuration is valid (pbxproj properly structured with three SPM objects)
- All imports resolve correctly
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-ios v3.50.0 added via SPM in project.pbxproj and all Package.swift files |
| PostHog client initialized | Yes | PostHogSDK.shared.setup(config) in HackersApp.init() with captureApplicationLifecycleEvents = true |
| capture() | Yes | 11 meaningful capture calls across authentication, feed, comments, voting, settings, and onboarding |
| identify() | Yes | Called on login with username; reset() called on logout. However, raw username used as distinct_id |
| Error tracking | No | No PostHogSDK.shared.captureException() or equivalent error tracking setup. support_purchase_failed is a custom event, not formal exception tracking |
| Reverse proxy | N/A | iOS native app — reverse proxy is not applicable |
Issues
- No error/exception tracking: The PR does not implement PostHog's error/exception tracking feature (
captureExceptionor equivalent). Thesupport_purchase_failedcustom event captures one specific failure case but is not a substitute for SDK-level error tracking. [CRITICAL] - Username as distinct_id:
PostHogSDK.shared.identify(username, ...)uses the raw HN username as the distinct_id. While this is the app's authentication identifier and thus a "real" ID, usernames are PII. A hashed identifier or internal user ID would be more appropriate for analytics. [MEDIUM] - Username in event properties: The
user_logged_inevent passesusernamein event properties (properties: ["username": username]). The username is already set as a person property viaidentify()— it should not also be in event-level properties where it constitutes PII leakage. [MEDIUM]
Other completed criteria
- API key loaded from environment variable via
PostHogEnvenum withProcessInfo.processInfo.environment - Host correctly configured as
https://us.i.posthog.comvia environment variable - SDK initialization follows the documented SwiftUI pattern
reset()called on logout to unlink future events from the user
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
LoginViewModel.swift |
user_logged_in |
Captures successful login with username property; also calls identify() |
SessionService.swift |
user_logged_out |
Captures logout before calling reset() |
OnboardingCoordinator.swift |
onboarding_completed |
Captures onboarding dismissal with app_version |
FeedViewModel.swift |
feed_category_changed, post_bookmarked, post_unbookmarked, post_searched |
Feed interactions with category, post_id, post_title, search query, result_count |
CommentsViewModel.swift |
comments_viewed |
Captures post comment loading with post_id, title, comment_count |
VotingViewModel.swift |
post_upvoted, comment_upvoted |
Captures upvotes with post_id, post_title, comment_id |
SupportViewModel.swift |
support_purchase_completed, support_purchase_failed |
IAP success/failure with product_id, product_kind, error_message |
Issues
- PII in event properties:
user_logged_inincludesusernamein event properties. Username should only be set via person properties (already done throughidentify()), not duplicated in event-level properties. [MEDIUM]
Other completed criteria
- Events represent real user actions (login, logout, upvote, bookmark, search, purchase, onboarding)
- Events enable product insights (login→engagement funnel, purchase funnel, search analysis, voting trends)
- Events include relevant contextual properties (post_id, post_title, category, result_count, product_kind)
- Event names are descriptive and follow consistent snake_case convention
Reviewed by wizard workbench PR evaluator
Automated wizard CI run
Source: wizard-pr
Trigger ID:
0ae2102App:
swift/hackers-iosApp directory:
apps/swift/hackers-iosWorkbench branch:
wizard-ci-0ae2102-swift-hackers-iosWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-04-15T19:50:23.354Z
Duration: 504.7s