Skip to content

Commit b752d60

Browse files
jonfroehlichclaude
andcommitted
chore(people): wire one-shot prod merge of duplicate Person records (#1275)
Add the reviewed dedup_decisions.csv (13 merges + 2 jasminezhang keeps; ids only) and a PROD-gated one-shot in docker-entrypoint.sh that runs merge_duplicate_people --apply before recompute_url_names. Gated to DJANGO_ENV=PROD (the decisions file is keyed by production ids) with the command's name-mismatch guard as a backstop. Validated end-to-end against a copy of the prod dump: 589->576 people, url_name collisions 10->0, duplicate clusters reduced to the two intended namesakes. Remove this one-shot in a follow-up once the first prod deploy confirms the merge in /logs (the command is idempotent, so a lingering run is a no-op). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6d81b57 commit b752d60

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

dedup_decisions.csv

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
source_id,action,target_id,note
2+
328,merge,564,jennifermankoff: keep 564 (UW email + more refs)
3+
624,merge,498,jasonyip: keep 498 (7 refs vs 1)
4+
649,merge,652,hangdo: keep 652 (richer; 649 has 1 ref)
5+
719,merge,718,qingshen: 719 is a 0-ref shell
6+
709,merge,710,claudinadegyves: 709 is a 0-ref shell
7+
626,merge,625,jiahaoli: 626 is a 0-ref shell
8+
627,merge,625,jiahaoli: 627 is a 0-ref shell
9+
643,merge,644,mikesinclair: 643 is a 0-ref shell
10+
645,merge,644,mikesinclair: 645 is a 0-ref shell
11+
723,merge,670,erictokuda: keep 670 (older; both refs=1)
12+
724,merge,707,heatherfeldner: keep 707 (older; both refs=1)
13+
581,merge,623,wendyroldan: keep 623 (real headshot; scalar fields backfill from 581)
14+
720,merge,669,claudiosilva: revealed by the NFKD accent fix; keep 669 (correct spelling)
15+
840,keep,,jasminezhang: genuine namesake - leave separate (#1206)
16+
869,keep,,jasminezhang: genuine namesake - leave separate (#1206)

docker-entrypoint.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,18 @@ echo "******************************************"
116116
python manage.py backfill_project_visibility
117117

118118
echo "****************** STEP 4.8/5: docker-entrypoint.sh ************************"
119-
echo "4.8 Running 'python manage.py recompute_url_names' to de-collide historical url_names (#1206)"
119+
echo "4.8 Running 'python manage.py merge_duplicate_people' (PROD only) to consolidate duplicate Person records (#1275)"
120+
echo "******************************************"
121+
# ONE-SHOT (remove after the first prod run confirms in /logs). Gated to PROD
122+
# because dedup_decisions.csv is keyed by production ids; the merge command also
123+
# refuses name-mismatched pairs as a backstop. Idempotent, so a lingering run is
124+
# a harmless no-op once the duplicates are already merged.
125+
if [ "$DJANGO_ENV" = "PROD" ]; then
126+
python manage.py merge_duplicate_people --decisions dedup_decisions.csv --apply
127+
fi
128+
129+
echo "****************** STEP 4.9/5: docker-entrypoint.sh ************************"
130+
echo "4.9 Running 'python manage.py recompute_url_names' to de-collide historical url_names (#1206)"
120131
echo "******************************************"
121132
python manage.py recompute_url_names
122133

0 commit comments

Comments
 (0)