fix(tasks): temporary tool to detect and merge codebar auth duplicate members - #2809
Draft
mroderick wants to merge 5 commits into
Draft
fix(tasks): temporary tool to detect and merge codebar auth duplicate members#2809mroderick wants to merge 5 commits into
mroderick wants to merge 5 commits into
Conversation
… duplicate members
… detection output
mroderick
force-pushed
the
fix/codebar-auth-duplicate-members
branch
from
August 21, 2026 08:36
ed7ce8f to
0569092
Compare
Collaborator
Author
|
Applied to production. 12 duplicate members merged successfully. All verified clean afterwards — no duplicates remain. Log: {
"timestamp": "2026-08-21T10:44:25+02:00",
"dry_run": false,
"environment": "development",
"merges": [
{ "dup_id": 31262, "orig_id": 553, "strategies": "name+surname", "status": "success" },
{ "dup_id": 31263, "orig_id": 655, "strategies": "first-name+uid-surname", "status": "success" },
{ "dup_id": 31230, "orig_id": 5583, "strategies": "name+surname", "status": "success" },
{ "dup_id": 31224, "orig_id": 17284, "strategies": "name+surname", "status": "success" },
{ "dup_id": 31243, "orig_id": 22921, "strategies": "name+surname", "status": "success" },
{ "dup_id": 31233, "orig_id": 24686, "strategies": "name+surname", "status": "success" },
{ "dup_id": 31232, "orig_id": 25640, "strategies": "name+surname", "status": "success" },
{ "dup_id": 31258, "orig_id": 27714, "strategies": "domain+local-part", "status": "success" },
{ "dup_id": 31257, "orig_id": 27714, "strategies": "manual", "status": "success" },
{ "dup_id": 31261, "orig_id": 29893, "strategies": "email", "status": "success" },
{ "dup_id": 31229, "orig_id": 30581, "strategies": "name+surname", "status": "success" },
{ "dup_id": 31218, "orig_id": 31192, "strategies": "email", "status": "success" }
],
"errors": [],
"total_merges": 12
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the codebar auth flow was merged on 2026-08-06, members with an existing GitHub account whose email differed from their stored email could not be matched automatically. The codebar auth flow created new member accounts instead of linking to existing ones (#2805).
Solution
Add a temporary rake task and Makefile targets to detect and safely merge duplicate members.
Detection strategies
name+surname— exact case-insensitive matchemail— exact case-insensitive matchfirst-name+uid-surname— first name matches; duplicate has no surname, but the codebar auth UID contains the original's surnamedomain+local-part— non-generic domain with overlapping local partsPlus hard-coded manual overrides for edge cases the heuristics cannot detect.
Safety
APPLY=1to change data.duplicate.<id>.merged-into.<id>@codebar.io, auth services and roles are removed, and aMemberNotepreserves audit history.log/merge_duplicate_members/run_YYYYMMDDTHHMMSSZ.json.Usage
Production:
Files
lib/tasks/merge_duplicate_members.rake— detection and merge logicMakefile— convenience targets for local and Heroku operationdocs/merge_duplicate_members.md— operator documentationTesting
make dump_production).This is a temporary tool. Once the existing duplicates are resolved, it can be removed.