[CI] (6b2dc8b) swift/hackers-ios - #3747
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
|
Now I have all the context I need. Let me write the evaluation. PR Evaluation ReportSummaryThis PR integrates PostHog into a Swift/UIKit iOS app (Hackers for Hacker News) by adding the posthog-ios SDK via SPM, initializing it in
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | Valid Swift syntax, SPM dependency resolves, app should build (missing .env file produces a warning but doesn't block compilation) |
| Preserves existing env vars & configs | Yes | No existing code or configs modified destructively; configurePostHog() called before existing URL cache setup |
| No syntax or type errors | Yes | All Swift code is syntactically valid |
| Correct imports/exports | Yes | import PostHog used correctly in all files |
| Minimal, focused changes | Yes | Only PostHog-related additions; Foundation import reorder in ContentView is trivial alphabetical sort |
| Pre-existing issues | None | — |
Issues
.env.exampleuses invalid xcconfig comment syntax: The.envfile is set asbaseConfigurationReferencein the pbxproj (i.e., treated as an xcconfig file). The.env.exampletemplate uses# commentsyntax, but xcconfig files only support//comments. Copying.env.exampleto.envwill cause Xcode build warnings or preprocessor errors. The template should use// commentsyntax instead. [MEDIUM]INFOPLIST_KEY_for custom keys withoutGENERATE_INFOPLIST_FILE: The PR addsINFOPLIST_KEY_POSTHOG_HOSTandINFOPLIST_KEY_POSTHOG_PROJECT_TOKENbuild settings, expecting them to be injected into Info.plist at build time. However,GENERATE_INFOPLIST_FILEis not set in this project (it uses a traditionalINFOPLIST_FILE). While modern Xcode versions may merge these for custom keys, this is a non-standard pattern that may silently fail, causing PostHog to not initialize in production (the#else returnbranch). [MEDIUM]
Other completed criteria
- Environment variables documented in
.env.example - Build configuration valid — SPM dependency correctly declared with
PBXBuildFile,XCSwiftPackageProductDependency, andXCRemoteSwiftPackageReference - No XcodeGen
project.ymlfound, so direct pbxproj edits are appropriate
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-ios added via SPM (minimum 3.59.3, resolved to 3.71.0) with correct pbxproj objects |
| PostHog client initialized | Yes | PostHogConfig(projectToken:host:) with PostHogSDK.shared.setup(config) in AppDelegate.application(_:didFinishLaunchingWithOptions:) |
| capture() | Yes | Six meaningful capture calls: login_succeeded, logout_completed, post_opened, login_presented, settings_opened, onboarding_completed |
| identify() | No | No PostHogSDK.shared.identify() call after user authentication; no PostHogSDK.shared.reset() on logout |
| Error tracking | Yes | config.errorTrackingConfig.autoCapture = true enables automatic exception capture |
| Reverse proxy | N/A | iOS native app — reverse proxy only applies to posthog-js in browsers |
Issues
- Missing
identify()after login: The app has authentication (sessionService.authenticate()) but never callsPostHogSDK.shared.identify()with the user's ID. All events remain anonymous and cannot be attributed to specific users. Thelogin_succeededcapture should be followed by an identify call using the authenticated user's ID (e.g.,PostHogSDK.shared.identify(userId, userProperties: ["email": email])). [CRITICAL] - Missing
reset()on logout:sessionService.unauthenticate()is called butPostHogSDK.shared.reset()is never invoked. Without reset, the next user on the same device inherits the previous user's anonymous/distinct ID, causing data pollution. [CRITICAL] - API key not hardcoded per iOS best practice: Per PostHog iOS docs, the project token is a public client-side key safe to ship in the binary, and hardcoding is the recommended approach. The PR instead relies on
.envxcconfig →INFOPLIST_KEY_*→Bundle.main.object(forInfoDictionaryKey:), which is fragile (depends on proper.envsetup, andProcessInfo.processInfo.environmentprimary check only works in Xcode debug runs). [LOW]
Other completed criteria
- PostHog host correctly configurable via same env/Info.plist mechanism
- Screen views autocaptured by default (
captureScreenViewsdefaults totruein iOS SDK) - Error tracking properly enabled with
autoCapture - SDK installed with all three required pbxproj objects (PBXBuildFile, XCSwiftPackageProductDependency, XCRemoteSwiftPackageReference)
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
AppDelegate.swift |
errorTrackingConfig.autoCapture |
Automatic exception/crash capture enabled |
ContentView.swift |
login_succeeded, logout_completed |
Captures auth flow events (3 login + 3 logout locations for different UI layouts) |
NavigationStore.swift |
post_opened, login_presented, settings_opened |
Navigation events; post_opened includes post_id property |
OnboardingCoordinator.swift |
onboarding_completed |
Tracks when user finishes onboarding |
Issues
- Most events lack contextual properties: Only
post_openedincludes enriched properties (post_id). Events likelogin_succeeded(could include auth method),logout_completed(could include session duration),settings_opened(could include current tab), andonboarding_completed(could include step count or time spent) are bare captures with no properties, limiting analytical value. [MEDIUM]
Other completed criteria
- Events represent real user actions (login, logout, post viewing, settings, onboarding)
- Events enable product insights (login→post funnel, onboarding completion rate, settings engagement)
- No PII in event properties
- Event naming is consistent snake_case with descriptive
[object]_[verb]format
Reviewed by wizard workbench PR evaluator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated wizard CI run
Source: wizard-pr
Trigger ID:
6b2dc8bApp:
swift/hackers-iosApp directory:
apps/swift/hackers-iosWorkbench branch:
wizard-ci-6b2dc8b-swift-hackers-iosWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-09-01T16:10:15.227Z
Duration: 798.7s
YARA Scanner