Skip to content

[CI] (9da603e) swift/hackers-ios - #4414

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

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

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: swift/hackers-ios
App directory: apps/swift/hackers-ios
Workbench branch: wizard-ci-9da603e-swift-hackers-ios
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-10-06T16:15:13.197Z
Duration: 827.0s

YARA Scanner

✓ 168 tool calls scanned, 0 violations detected

No violations: ✓ 168 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into the Hackers iOS app (Swift/UIKit+SwiftUI). It adds the posthog-ios SDK via SPM, initializes PostHog in AppDelegate, captures three custom events (login, logout, what's new), enables error auto-capture, and loads configuration from an .env.xcconfig file via Info.plist.

Files changed Lines added Lines removed
7 +97 -25

Confidence score: 5/5 🧙

  • Missing identify() call: The app has a login flow but never calls PostHogSDK.shared.identify() after authentication. All events remain anonymous and unlinked to users. [CRITICAL]
  • Missing reset() on logout: PostHogSDK.shared.reset() is never called on logout, so a second user on the same device inherits the previous user's anonymous ID. [CRITICAL]
  • Events lack properties: All three capture() calls are bare — no contextual properties like login_type, username length, or source screen. [MEDIUM]

File changes

Filename Score Description
App/AppDelegate.swift 4/5 PostHog initialization with error tracking and structured logs; env fallback chain is well-guarded
App/ContentView.swift 2/5 Three capture calls but no identify() or reset(), no event properties
Hackers-Info.plist 4/5 Adds xcconfig variable references for PostHog token and host
project.pbxproj 5/5 Correct three-object SPM dependency setup (PBXBuildFile, ProductDependency, PackageReference)
Package.resolved 5/5 Locks posthog-ios at 3.90.1
.env.example 4/5 Documents required environment variables
.gitignore 5/5 Excludes .env.xcconfig

App sanity check ✅

Criteria Result Description
App builds and runs Yes Valid SPM dependency, correct imports, no syntax errors
Preserves existing env vars & configs Yes Existing closures extracted to named methods preserving identical behavior
No syntax or type errors Yes All Swift syntax is valid
Correct imports/exports Yes import PostHog is correct for the posthog-ios SDK
Minimal, focused changes Yes Only PostHog-related additions; closure extraction is necessary for the integration
Pre-existing issues None

Issues

No issues.

Other completed criteria

  • Environment variables documented in .env.example
  • Build configuration valid — .env.xcconfig properly referenced as baseConfigurationReference in both Debug and Release build configurations
  • The postHogValue(for:) helper gracefully handles missing/unresolved xcconfig vars (checks hasPrefix(") preventing crashes in builds without configuration

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-ios 3.90.1 added via SPM with correct three-object pbxproj setup
PostHog client initialized Yes PostHogConfig(projectToken:host:) + PostHogSDK.shared.setup(config) in AppDelegate.didFinishLaunchingWithOptions
capture() Yes Three calls: login_succeeded, logout_completed, whats_new_opened
identify() No Missing — see issues below
Error tracking Yes config.errorTrackingConfig.autoCapture = true
Reverse proxy N/A iOS native app; reverse proxy only benefits posthog-js in browsers

Issues

  • No identify() after login: The authenticate() function calls sessionService.authenticate() and captures a login_succeeded event, but never calls PostHogSDK.shared.identify() with the user's ID. All events remain anonymous and cannot be attributed to specific users. Fix: After successful authentication, call PostHogSDK.shared.identify(userId, userProperties: ["name": username]) using a stable user ID from the auth system. [CRITICAL]
  • No reset() on logout: The logout() function never calls PostHogSDK.shared.reset(). Per the docs: "We strongly recommend you call reset on logout even if you don't expect users to share a computer." Without this, subsequent sessions inherit the prior user's anonymous ID. Fix: Call PostHogSDK.shared.reset() after capturing the logout event. [CRITICAL]

Other completed criteria

  • API key and host loaded from environment via xcconfig → Info.plist fallback chain
  • Screen views captured automatically (captureScreenViews defaults to true in iOS SDK)
  • Error tracking auto-capture enabled
  • Structured logging configured with serviceName: "hackers-ios"
  • SPM package reference version 3.90.1 is current

PostHog insights and events ⚠️

Filename PostHog events Description
AppDelegate.swift errorTrackingConfig.autoCapture Automatic exception/crash capture enabled at initialization
ContentView.swift login_succeeded, logout_completed, whats_new_opened Core authentication and onboarding flow events; no enriching properties

Issues

  • Events lack contextual properties: All three capture() calls pass no properties. For example, login_succeeded could include login_type or is_first_login; whats_new_opened could include source_screen. Bare events limit filtering and breakdown capabilities. [MEDIUM]

Other completed criteria

  • Events represent real user actions (login, logout, viewing what's new)
  • Event names enable a basic login/logout funnel
  • No PII in event properties
  • Event names are descriptive and use consistent snake_case 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