feat(users): add staff avatar_url backfill command#72092
Conversation
|
Hey @adboio! 👋 It looks like your git author email on this PR isn't your
You can fix it for this repo with: git config user.email "you@posthog.com"Or set it globally with |
ec9706d to
fffc818
Compare
c5d388d to
23decca
Compare
🤖 CI report✅ Bundle size — no changeUncompressed size of every built Total: 64.22 MiB · no change No file changed by more than 1000 B. Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report ✅ Eager graph — within budgetHow much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy
🟢 Largest files eagerly shipped from
|
| Size | File |
|---|---|
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 24.6 KiB | ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js |
| 6.3 KiB | ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js |
| 4.5 KiB | ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js |
| 3.9 KiB | ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js |
| 1.4 KiB | ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js |
| 1.3 KiB | src/RootErrorBoundary.tsx |
| 912 B | ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js |
| 789 B | src/scenes/ChunkLoadErrorBoundary.tsx |
| 762 B | src/index.tsx |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 281.3 KiB | ../node_modules/.pnpm/posthog-js@1.404.0/node_modules/posthog-js/dist/rrweb.js |
| 267.7 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 235.5 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 223.2 KiB | ../node_modules/.pnpm/posthog-js@1.404.0/node_modules/posthog-js/dist/module.js |
| 164.0 KiB | src/queries/validators.js |
| 154.3 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 105.8 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
| 93.2 KiB | ../packages/quill/packages/quill/dist/index.js |
Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479
✅ Dist folder size — 🔺 +1.1 KiB (+0.0%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 1341.50 MiB · 🔺 +1.1 KiB (+0.0%)
✅ Django migration risk — migration analysis complete
We've analyzed your migrations for potential risks.
Summary: 0 Safe | 2 Needs Review | 0 Blocked
⚠️ Needs Review
May have performance impact
posthog.1259_userpersonalization
└─ #1 ✅ CreateModel
Creating new table is safe
model: UserPersonalization
└─ #2 ⚠️ AddForeignKeyNotValid: Unknown operation type: AddForeignKeyNotValid
│
└──> ℹ️ INFO:
ℹ️ Skipped operations on newly created tables (empty tables
don't cause lock contention).
posthog.1260_validate_userpersonalization_fk
└─ #1 ⚠️ ValidateForeignKey: Unknown operation type: ValidateForeignKey
Last updated: 2026-07-17 23:37 UTC (273d089)
991bbcb to
b05f8b5
Compare
f592fe7 to
39fe807
Compare
b05f8b5 to
508fd98
Compare
39fe807 to
c7c0ecc
Compare
508fd98 to
5fc3466
Compare
c7c0ecc to
d5c62a9
Compare
5fc3466 to
f243b69
Compare
d5c62a9 to
cdb8f15
Compare
f243b69 to
921f928
Compare
8ff71ae to
8768442
Compare
2373786 to
cc35034
Compare
8768442 to
bf55fff
Compare
One-shot management command that backfills UserPersonalization rows for active @posthog.com accounts from the public posthog.com/people roster, matched by normalized full name. Ambiguous names are skipped so nobody gets a namesake's photo; supports --dry-run and --overwrite and is idempotent otherwise. Stacked on the personalization-table PR.
722649d to
4627cf2
Compare
Problem
#72086 adds a
UserPersonalizationside table withavatar_url, but existing PostHog staff accounts have no value in it even though everyone already has a headshot on posthog.com/people. Populating those is a one-shot data task that shouldn't be tangled into the schema/serializer review.Stacked on #72086 — merge that first.
Changes
backfill_staff_avatar_urlsmanagement command: fetches the public posthog.com/people roster (a Gatsby page-data artifact — there is no team API; falls back to rescanning the page manifest's static-query hashes if the known content hash drifts) and upsertsUserPersonalizationrows for active@posthog.comaccounts matched by normalized full name.--overwrite.--dry-runreports without writing; idempotent otherwise.Intended rollout: run with
--dry-runfirst, review the printed matches, then run live — per region.How did you test this code?
Automated tests added (not run locally — no dev stack in this environment, CI is the arbiter):
posthog/management/commands/test/test_backfill_staff_avatar_urls.pycovers name matching (including accounts holding the full name infirst_name), ambiguous-name and non-staff skipping,--dry-runwriting nothing, and--overwritesemantics, with the roster fetch mocked.Automatic notifications
Docs update
N/A — internal ops command.
🤖 Agent context
Human-driven (agent-assisted) — requested by Adam Bowker in the project-bluebird channel (PostHog Code); split out of #72086 at his request.
Created with PostHog Code