Skip to content

[CI] (8dccaac) angular/angular-saas - #2344

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

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-8dccaac-angular-angular-saas

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 8dccaac
App: angular/angular-saas
App directory: apps/angular/angular-saas
Workbench branch: wizard-ci-8dccaac-angular-angular-saas
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-03T00:19:24.146Z
Duration: 523.6s

YARA Scanner

✓ 81 tool calls scanned, 0 violations detected

No violations: ✓ 81 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into an Angular 21 SaaS application by creating a PostHogService singleton, initializing PostHog in AppComponent, and instrumenting 10 events across authentication, billing, project management, team, profile, and security flows. User identification is handled on login with posthog.identify() and reset on logout. Error tracking is enabled via capture_exceptions: true.

Files changed Lines added Lines removed
18 +136 -6

Confidence score: 4/5 👍

  • No reverse proxy configured for this client-side Angular app, meaning PostHog requests can be blocked by ad blockers [CRITICAL]
  • username sent as PII in user_logged_in event properties — usernames should be set via person properties (identify), not in capture() event properties [MEDIUM]
  • No .env.example file — the two required env vars (NG_APP_POSTHOG_PROJECT_TOKEN, NG_APP_POSTHOG_HOST) are not documented for collaborators [MEDIUM]
  • No identify on returning users — only fresh login calls identify(), so returning authenticated sessions stay on anonymous distinct IDs [MEDIUM]
  • API host fallback uses us.posthog.com instead of the recommended us.i.posthog.com [MEDIUM]

File changes

Filename Score Description
src/app/@core/services/posthog.service.ts 4/5 New singleton service wrapping posthog-js with SSR-safe Proxy pattern
src/app/app.component.ts 4/5 Initializes PostHog in ngOnInit with env vars and capture_exceptions
src/app/auth/login/login.component.ts 3/5 Identifies user and captures login; username used as distinct_id and leaked to event props
src/app/auth/logout/logout.component.ts 5/5 Captures logout event and calls posthog.reset() correctly
src/app/pages/billing/billing.component.ts 4/5 Added billing_page_viewed and plan_upgrade_clicked with good properties
src/app/pages/billing/billing.component.html 4/5 Added (click) handler to wire up selectPlan
src/app/pages/profile/profile.component.ts 3/5 Captures profile_updated but with no properties
src/app/pages/settings/components/security-settings/security-settings.component.ts 5/5 Good 2FA toggle and session revoke events with relevant properties
src/app/pages/users/list/list.component.ts 3/5 Method signature changed to accept user param but HTML template not updated
src/app/shared/components/add-member-modal/add-member-modal.component.ts 5/5 member_added with role property
src/app/shared/components/create-project-modal/create-project-modal.component.ts 4/5 project_created with name and status
src/environments/environment.ts / environment.prod.ts 3/5 Env var loading via import.meta.env, but fallback host is wrong
src/env.d.ts 5/5 Proper TypeScript declarations for import.meta.env
package.json 5/5 posthog-js added as dependency

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes All Angular syntax, decorators, and imports are correct
Preserves existing env vars & configs Yes Existing environment configs extended, not replaced
No syntax or type errors Yes Valid TypeScript throughout; Proxy pattern is sound
Correct imports/exports Yes posthog-js imported correctly; PostHogService exported from barrel file
Minimal, focused changes Yes All changes relate to PostHog integration
Pre-existing issues None

Issues

  • userClicked signature mismatch: The method signature was changed to userClicked(user?: RandomUserEntity) but the HTML template still calls userClicked() without arguments. The param is optional so it won't break, but the user entity is never actually passed, making the parameter dead code. [LOW]

Other completed criteria

  • .gitignore updated to exclude .env file
  • PostHogService uses SSR-safe platform checks
  • Barrel export added correctly in index.ts

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js ^1.396.5 added to package.json
PostHog client initialized Yes Initialized in AppComponent.ngOnInit() via PostHogService with platform browser guard
capture() Yes 10 meaningful capture calls across 9 components
identify() No identify() called on login with username as distinct_id, but not on page refresh for returning users — sessions resume on anonymous IDs
Error tracking Yes capture_exceptions: true in init config enables automatic exception capture
Reverse proxy No No reverse proxy configured; client-side PostHog requests will be blocked by ad blockers

Issues

  • No reverse proxy: This is a client-side Angular app where posthog-js sends requests directly to us.posthog.com. A reverse proxy (e.g., via Angular CLI proxy or Nginx) should route /ingest/* to PostHog to avoid ad blocker interference. [CRITICAL]
  • Missing identify on returning users: posthog.identify() is only called in the login success handler. If a user is already authenticated and refreshes the page, their session remains anonymous. The app should check authentication state on init (e.g., in AppComponent) and call identify() if the user is logged in. [MEDIUM]
  • Incorrect API host fallback: The environment files fall back to https://us.posthog.com instead of the recommended https://us.i.posthog.com. The us.posthog.com domain works but is not the correct ingest endpoint per PostHog docs. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable (not hardcoded)
  • PostHog initialized before any capture calls (in AppComponent ngOnInit)
  • posthog.reset() correctly called on logout
  • SSR-safe implementation with platform checks and Proxy fallback
  • ui_host correctly set to https://us.posthog.com

PostHog insights and events ⚠️

Filename PostHog events Description
login.component.ts user_logged_in, identify() Captures login and identifies user with username + email
logout.component.ts user_logged_out, reset() Captures logout and resets identity
billing.component.ts billing_page_viewed, plan_upgrade_clicked Billing funnel: page view → upgrade click with plan details
profile.component.ts profile_updated Profile save (no properties)
security-settings.component.ts two_factor_authentication_toggled, session_revoked Security actions with enabled/device/revoke_all properties
list.component.ts user_profile_viewed Team member click (no properties)
add-member-modal.component.ts member_added Team growth with member role
create-project-modal.component.ts project_created Project creation with name and status
app.component.ts captureException (auto) Exception autocapture via capture_exceptions: true

Issues

  • PII in user_logged_in event: The username is passed as a property in posthog.capture('user_logged_in', { username }). Usernames are PII and should only appear in person properties (via identify()), not in event properties. Remove username from the capture call. [MEDIUM]
  • profile_updated has no properties: The event fires with no contextual properties, making it less useful for analysis. Consider adding what fields changed. [LOW]
  • user_profile_viewed has no properties: Despite the method accepting a user parameter, no user info is included in the event. [LOW]

Other completed criteria

  • Events represent real user actions (login, logout, billing, project creation, etc.)
  • Events enable product insights (billing upgrade funnel, team growth trends, security audit)
  • Event names are descriptive and use consistent snake_case convention
  • Most events include relevant contextual properties (plan details, role, 2FA state)
  • plan_upgrade_clicked has excellent properties (plan_id, name, price, current_plan)

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