posthog icon indicating copy to clipboard operation
posthog copied to clipboard

feat: read-only impersonation and impersonation opt-out

Open Piccirello opened this issue 1 month ago â€ĸ 4 comments

Problem

Changes

How did you test this code?

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Changelog: (features only) Is this feature complete?

Piccirello avatar Dec 10 '25 06:12 Piccirello

Size Change: +10 B (0%)

Total Size: 3.7 MB

â„šī¸ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 3.7 MB +10 B (0%)

compressed-size-action

github-actions[bot] avatar Dec 10 '25 06:12 github-actions[bot]

Migration SQL Changes

Hey 👋, we've detected some migrations on this PR. Here's the SQL output for each migration, make sure they make sense:

posthog/migrations/0940_user_allow_impersonation.py

BEGIN;
--
-- Add field allow_impersonation to user
--
ALTER TABLE "posthog_user" ADD COLUMN "allow_impersonation" boolean DEFAULT true NULL;
ALTER TABLE "posthog_user" ALTER COLUMN "allow_impersonation" DROP DEFAULT;
COMMIT;

Last updated: 2025-12-11 23:40 UTC (2f7549a)

github-actions[bot] avatar Dec 10 '25 06:12 github-actions[bot]

🔍 Migration Risk Analysis

We've analyzed your migrations for potential risks.

Summary: 1 Safe | 0 Needs Review | 0 Blocked

✅ Safe

Brief or no lock, backwards compatible

posthog.0940_user_allow_impersonation
  └─ #1 ✅ AddField
     Adding nullable field requires brief lock
     model: user, field: allow_impersonation

📚 How to Deploy These Changes Safely

AddField:

This operation acquires a brief lock but doesn't rewrite the table.

Deployment uses lock timeouts with automatic retries, so lock contention will cause retries rather than connection pile-up.

Last updated: 2025-12-11 23:40 UTC (2f7549a)

github-actions[bot] avatar Dec 10 '25 06:12 github-actions[bot]

Visual regression: Storybook UI snapshots updated

Changes: 2 snapshots (2 modified, 0 added, 0 deleted)

What this means:

  • Snapshots have been automatically updated to match current rendering
  • Next CI run will switch to CHECK mode to verify stability
  • If snapshots change again, CHECK mode will fail (indicates flapping)

Next steps:

  • Review the changes to ensure they're intentional
  • Approve if changes match your expectations
  • If unexpected, investigate component rendering

Review snapshot changes →

posthog-bot avatar Dec 10 '25 06:12 posthog-bot

Visual regression: Storybook UI snapshots updated

Changes: 2 snapshots (2 modified, 0 added, 0 deleted)

What this means:

  • Snapshots have been automatically updated to match current rendering
  • Next CI run will switch to CHECK mode to verify stability
  • If snapshots change again, CHECK mode will fail (indicates flapping)

Next steps:

  • Review the changes to ensure they're intentional
  • Approve if changes match your expectations
  • If unexpected, investigate component rendering

Review snapshot changes →

posthog-bot avatar Dec 10 '25 22:12 posthog-bot

â­ī¸ Skipped snapshot commit because branch advanced to f41556d while workflow was testing 5a290ac.

The new commit will trigger its own snapshot update workflow.

If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:

  • Merge master into your branch, or
  • Push an empty commit: git commit --allow-empty -m 'trigger CI' && git push

posthog-bot avatar Dec 10 '25 22:12 posthog-bot

Visual regression: Storybook UI snapshots updated

Changes: 2 snapshots (2 modified, 0 added, 0 deleted)

What this means:

  • Snapshots have been automatically updated to match current rendering
  • Next CI run will switch to CHECK mode to verify stability
  • If snapshots change again, CHECK mode will fail (indicates flapping)

Next steps:

  • Review the changes to ensure they're intentional
  • Approve if changes match your expectations
  • If unexpected, investigate component rendering

Review snapshot changes →

posthog-bot avatar Dec 11 '25 01:12 posthog-bot