PostHog email -> Keycloak sub migration: backfill $create_alias for all existing users#2804
PostHog email -> Keycloak sub migration: backfill $create_alias for all existing users#2804Will-Howard wants to merge 2 commits into
sub migration: backfill $create_alias for all existing users#2804Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds a one-off TypeScript runner for linking Keycloak 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I will leave this as a draft since it doesn't need to be merged, and close it once I've run this script locally. @coderabbitai review @greptileai review |
|
✅ Action performedReview finished.
|
sub migration: backfill$create_alias backfill script (#2713 …sub migration: backfill $create_alias for all existing users
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/website/scripts/posthog-alias-backfill/backfill-alias.ts`:
- Line 187: Update the validation condition in the alias backfill flow to handle
missing user.email or user.sub values before calling includes. Treat records
with null or undefined values as invalid and tally them through the existing
invalid-record path, while preserving the current checks for populated strings.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 32b84e72-4273-45e5-b693-6093c35868ff
📒 Files selected for processing (1)
apps/website/scripts/posthog-alias-backfill/backfill-alias.ts
…st-batch resume hint
e6e4157 to
b5c7e9c
Compare
|
I ran this, closing the PR now |
Description
Doesn't need to be merged, just needs to be run locally
#2767 added aliasing of email -> sub on login (meaning that after this alias is set up a user can be safely identified by either). This script will add this alias for all existing users in PostHog, meaning it will be safe to cut over to using
subonly, and existing users will have consistent histories.The full migration plan for PostHog is in this comment. This is "PR 3", which will unlock "PR 4":
Issue
#2713