Skip to content

[CI] (e2f7ab0) angular/angular-saas#2422

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-e2f7ab0-angular-angular-saas
Closed

[CI] (e2f7ab0) angular/angular-saas#2422
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-e2f7ab0-angular-angular-saas

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: e2f7ab0
App: angular/angular-saas
App directory: apps/angular/angular-saas
Workbench branch: wizard-ci-e2f7ab0-angular-angular-saas
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-06T22:03:07.416Z
Duration: 654.2s

YARA Scanner

✓ 84 tool calls scanned, 0 violations detected

No violations: ✓ 84 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Author

Now I have all the information needed for the evaluation. Let me produce the report.


PR Evaluation Report

Summary

This PR integrates PostHog into an Angular SaaS application by creating a PosthogService singleton, initializing it in AppComponent, adding user identification on login and for returning users, calling reset() on logout, and instrumenting 10 business-critical events across authentication, billing, settings, and project management flows. Exception autocapture is enabled via capture_exceptions: true.

Files changed Lines added Lines removed
17 +172 -2

Confidence score: 4/5 👍

  • Incorrect PostHog host URL: Both environment files default to https://us.posthog.com instead of the correct https://us.i.posthog.com. This will cause event ingestion to fail if the env var is not explicitly set. [CRITICAL]
  • Missing defaults config option: The posthog.init() call omits the defaults parameter (e.g., defaults: '2026-05-30'), which the Angular docs recommend for proper SDK defaults. [MEDIUM]
  • Missing NgZone.runOutsideAngular: The Angular PostHog documentation explicitly recommends initializing PostHog outside Angular's change detection zone to avoid performance issues, especially with session replay. The PosthogService does not use NgZone. [MEDIUM]

File changes

Filename Score Description
src/app/@core/services/posthog.service.ts 3/5 New PosthogService with platform check and proxy fallback — missing NgZone
src/app/app.component.ts 3/5 Initializes PostHog with identify for returning users — wrong host default, no defaults option
src/app/auth/login/login.component.ts 4/5 Identify + capture on login with person properties
src/app/auth/logout/logout.component.ts 5/5 Capture logout event and reset — correct order
src/environments/environment.ts 2/5 Wrong default host URL
src/environments/environment.prod.ts 2/5 Wrong default host URL
src/env.d.ts 5/5 TypeScript declarations for NG_APP env vars
package.json 5/5 posthog-js dependency added
src/app/pages/billing/billing.component.ts 5/5 billing_plan_selected with enriched properties
src/app/pages/profile/profile.component.ts 4/5 profile_updated event, no properties
src/app/pages/settings/components/* 5/5 Settings events with relevant properties
src/app/shared/components/* 5/5 project_created and team_member_added with properties

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes No syntax errors, valid Angular patterns used throughout
Preserves existing env vars & configs Yes Existing environment variables and configs untouched; PostHog additions are additive
No syntax or type errors Yes TypeScript is valid, env.d.ts provides proper type declarations
Correct imports/exports Yes All imports use correct path aliases (@core/, @app/) and reference valid packages
Minimal, focused changes Yes All changes directly relate to PostHog integration
Pre-existing issues None

Issues

  • Wrong default host URL in environment files: Both environment.ts and environment.prod.ts default to https://us.posthog.com instead of https://us.i.posthog.com. While this won't cause a build error, PostHog will not receive events correctly if the environment variable is not explicitly set. Fix: Change default to 'https://us.i.posthog.com'. [CRITICAL]

Other completed criteria

  • .gitignore updated to exclude .env files
  • env.d.ts provides proper TypeScript declarations for NG_APP_* env vars
  • posthog-js added to package.json dependencies
  • All changed files follow existing codebase patterns (inject-based DI, signal patterns, ChangeDetectionStrategy.OnPush)

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js ^1.398.0 added to package.json
PostHog client initialized No Initialized in AppComponent via PosthogService but uses wrong host URL, missing defaults config, and missing NgZone.runOutsideAngular per Angular docs
capture() Yes 10 meaningful business events captured across auth, billing, settings, and project flows
identify() Yes Called on login (with res.id) and on app startup for returning users; reset() on logout
Error tracking Yes capture_exceptions: true enabled in init config
Reverse proxy No Not configured — client-only Angular app benefits from a reverse proxy to circumvent ad blockers

Issues

  • Incorrect PostHog host URL: Default fallback https://us.posthog.com should be https://us.i.posthog.com. The us.posthog.com domain is for the PostHog dashboard, not the ingestion API. [CRITICAL]
  • Missing defaults config option: The posthog.init() call should include defaults: '2026-05-30' as recommended in the Angular documentation for proper SDK default configuration. [MEDIUM]
  • Missing NgZone.runOutsideAngular: The Angular PostHog documentation explicitly states PostHog should be initialized outside Angular's zone (ngZone.runOutsideAngular(...)) to prevent performance issues from change detection cycles, particularly with session replay. The PosthogService does not inject or use NgZone. [MEDIUM]
  • No reverse proxy: A reverse proxy is recommended for client-only apps to avoid ad-blocker interference with PostHog event ingestion. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable (NG_APP_POSTHOG_PROJECT_TOKEN), not hardcoded
  • posthog.identify() uses real user IDs (user.id / res.id) from auth context — not fabricated values
  • posthog.reset() correctly called on logout before credential clearing
  • Returning user identification handled in AppComponent.ngOnInit
  • PosthogService includes platform browser check to prevent server-side execution

PostHog insights and events ✅

Filename PostHog events Description
login.component.ts user_logged_in Tracks successful login with user roles
logout.component.ts user_logged_out Tracks logout before session reset
billing.component.ts billing_plan_selected Captures plan selection with plan details and previous plan
profile.component.ts profile_updated Tracks profile save action
account-settings.component.ts account_settings_saved Tracks account settings save
notification-settings.component.ts notification_preferences_saved Captures all notification preference values
security-settings.component.ts two_factor_authentication_toggled, session_revoked Tracks 2FA toggle state and session revocation (single/all)
create-project-modal.component.ts project_created Tracks project creation with status
add-member-modal.component.ts team_member_added Tracks member addition with role
app.component.ts captureException (auto) Global exception autocapture via capture_exceptions: true

Issues

  • No critical or medium issues with event quality.

Other completed criteria

  • Events represent real user actions across authentication, billing, settings, and team management flows
  • Events enable product insights — login-to-project-creation funnel, billing plan analysis, settings engagement trends
  • Events include relevant contextual properties (plan_id, plan_price, previous_plan, member_role, enabled state, revoke_all flag)
  • No PII in event properties — email, name, and username only appear in identify() person properties
  • Event names use consistent snake_case convention with descriptive action names

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