Skip to content

[CI] (0e81558) swift/hackers-ios - #4264

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

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-0e81558-swift-hackers-ios

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 0e81558
App: swift/hackers-ios
App directory: apps/swift/hackers-ios
Workbench branch: wizard-ci-0e81558-swift-hackers-ios
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-29T08:49:14.652Z
Duration: 657.8s

YARA Scanner

✓ 206 tool calls scanned, 0 violations detected

No violations: ✓ 206 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown
Author

Now I have enough context. Let me produce the evaluation.


PR Evaluation Report

Summary

This PR integrates PostHog into a Swift iOS app ("Hackers") by adding the posthog-ios SDK via SPM, initializing it in AppDelegate, enabling error auto-capture, and adding custom event captures for sign-in, sign-out, onboarding, bookmarking, voting, and in-app purchases. The integration spans 10 files across the main app target and two local SPM packages (Shared, Settings).

Files changed Lines added Lines removed
10 +116 -17

Confidence score: 4/5 👍

  • Production-breaking initialization: PostHog is initialized exclusively from Xcode scheme environment variables (ProcessInfo.processInfo.environment). These variables are not available in Archive/Release builds (TestFlight, App Store), so PostHog silently does nothing in production. The SDK docs recommend hardcoding the project token directly in PostHogConfig. [CRITICAL]
  • No user identification: The app has sign-in/sign-out flows but never calls PostHogSDK.shared.identify() on login or PostHogSDK.shared.reset() on logout. All events remain anonymous and cannot be tied to users. [CRITICAL]
  • No reverse proxy configured: No reverse proxy or custom endpoint is set up to route client-side PostHog traffic, leaving it vulnerable to ad blockers. [MEDIUM]

File changes

Filename Score Description
.env.example 2/5 Documents env vars, but these are useless for iOS release builds
App/AppDelegate.swift 2/5 PostHog init depends solely on env vars that don't exist in production; captureLog usage is questionable
App/ContentView.swift 3/5 Good event captures for sign-in/sign-out/onboarding, but missing identify/reset calls
Features/Settings/Package.swift 4/5 Correctly adds posthog-ios SPM dependency
Features/Settings/Sources/Settings/SupportViewModel.swift 4/5 Good capture for purchases with properties
Hackers.xcodeproj/project.pbxproj 4/5 Correct 3-object SPM pattern (PBXBuildFile, product dep, remote ref)
Package.resolved 4/5 Resolved to v3.85.2, correct
Shared/Package.swift 4/5 Correctly adds posthog-ios SPM dependency
Shared/Sources/Shared/Services/BookmarksController.swift 4/5 Good conditional event naming for bookmark toggle with properties
Shared/Sources/Shared/ViewModels/VotingViewModel.swift 4/5 Good captures for vote/unvote with properties

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes SPM dependencies correctly wired in both local packages and xcodeproj; syntax is valid
Preserves existing env vars & configs Yes Existing code preserved; sign-in/sign-out logic refactored minimally to wrap with captures
No syntax or type errors Yes All Swift syntax appears valid; imports resolve correctly
Correct imports/exports Yes import PostHog added in all files that use the SDK
Minimal, focused changes Yes All changes relate to PostHog integration
Pre-existing issues None —

Issues

  • captureLog API validity: The PostHogAppLogger helper calls PostHogSDK.shared.captureLog(message, level: .info). This is part of the structured logs feature (documented in the SDK config as logs config). If the feature is available in v3.85.2 it's fine, but the docs reference it under a separate "Logs installation" page. This is a minor concern. [LOW]

Other completed criteria

  • All changes are relevant to PostHog integration
  • Correct files modified for this iOS framework
  • Code follows existing codebase patterns (naming, structure)
  • Build configuration valid (Package.swift files, pbxproj properly structured)

PostHog implementation ❌

Criteria Result Description
PostHog SDKs installed Yes posthog-ios v3.59.3+ added via SPM in xcodeproj, Shared/Package.swift, and Settings/Package.swift; resolved to v3.85.2
PostHog client initialized No Uses ProcessInfo.processInfo.environment exclusively — env vars are not injected in release builds, making PostHog non-functional in production
capture() Yes Multiple meaningful capture calls across the app
identify() No App has sign-in/sign-out but never calls identify() or reset()
Error tracking Yes config.errorTrackingConfig.autoCapture = true correctly enables automatic error capture
Reverse proxy No No reverse proxy configured for the PostHog host

Issues

  • Environment-variable-only initialization crashes or silently fails in production: ProcessInfo.processInfo.environment["POSTHOG_PROJECT_TOKEN"] and ["POSTHOG_HOST"] are only set when launching from Xcode (debug/simulator). In Archive/Release builds (TestFlight, App Store) these are empty, so the guard returns early and PostHog is never initialized. Fix: Hardcode the project token and host directly in PostHogConfig as the primary source (this is the documented iOS pattern — the token is a public client-side key). Optionally read env vars as a debug override. [CRITICAL]
  • No user identification on login/logout: signIn() captures sign_in_succeeded but never calls PostHogSDK.shared.identify(userId) with the authenticated user's ID. recordSignOut() captures signed_out but never calls PostHogSDK.shared.reset(). All events remain anonymous and cannot be attributed to users. Fix: Call PostHogSDK.shared.identify(username) after successful authentication and PostHogSDK.shared.reset() on logout. [CRITICAL]
  • No reverse proxy: Client-side PostHog traffic goes directly to posthog.com, which is commonly blocked by ad/content blockers. Fix: Configure a reverse proxy endpoint and point the host to it. [MEDIUM]

Other completed criteria

  • API host is configured (via the env var, when available)
  • Error tracking correctly enabled with autoCapture = true
  • SPM package references correctly structured in pbxproj (3 required objects present)
  • Screen views: autocapture is enabled by default (captureScreenViews defaults to true)

PostHog insights and events ✅

Filename PostHog events Description
AppDelegate.swift errorTrackingConfig.autoCapture, posthog_log_capture_configured Error auto-capture enabled; info log on setup
ContentView.swift sign_in_succeeded, signed_out, onboarding_completed Auth and onboarding lifecycle events
SupportViewModel.swift support_purchase_completed, purchases_restored IAP events with purchase_kind property
BookmarksController.swift bookmark_added, bookmark_removed Bookmark toggle with post_id property
VotingViewModel.swift post_upvoted, post_unvoted, comment_upvoted, comment_unvoted Voting events with post_id and comment_id properties

Issues

  • No issues with event quality — events are well-named, represent real user actions, and include relevant properties.

Other completed criteria

  • Events represent real user actions (sign in, sign out, bookmark, vote, purchase)
  • Events enable product insights (funnel from sign-in → onboarding → engagement)
  • Events include contextual properties (post_id, comment_id, purchase_kind)
  • No PII in event properties
  • Consistent snake_case naming convention

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