Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/plugins/org/e2e/raw_tables/accounts.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"a1","2022-07-10 14:27:43.813","2022-07-10 14:27:43.813","","",0,"","e1","","n1","n1","","2022-07-10 14:27:43.813",0
"a10","2022-07-10 14:27:43.813","2022-07-10 14:27:43.813","","",0,"","e15","","pq","n10","","2022-07-10 14:27:43.813",0
"a11","2022-07-10 14:27:43.813","2022-07-10 14:27:43.813","","",0,"","E6","","zz","zz","","2022-07-10 14:27:43.813",0
"a12","2022-07-10 14:27:43.813","2022-07-10 14:27:43.813","","",0,"","","","","N7","","2022-07-10 14:27:43.813",0
"a2","2022-07-10 14:27:43.813","2022-07-10 14:27:43.813","","",0,"","e1","","n2","n2","","2022-07-10 14:27:43.813",0
"a3","2022-07-10 14:27:43.813","2022-07-10 14:27:43.813","","",0,"","e2","","xyz","n3","","2022-07-10 14:27:43.813",0
"a4","2022-07-10 14:27:43.813","2022-07-10 14:27:43.813","","",0,"","e4","","n4","n4","","2022-07-10 14:27:43.813",0
Expand Down
1 change: 1 addition & 0 deletions backend/plugins/org/e2e/snapshot_tables/user_accounts.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ account_id,user_id,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remar
a1,U111,,,,
a10,U010,,,0,
a11,U006,,,0,
a12,U007,,,0,
a2,U112,,,,
a3,U113,,,,
a4,U004,,,0,
Expand Down
13 changes: 7 additions & 6 deletions backend/plugins/org/tasks/user_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@ func ConnectUserAccountsExact(taskCtx plugin.SubTaskContext) errors.Error {
if err != nil {
return err
}
// Email addresses are compared case-insensitively: a corporate git config and a provider
// profile routinely record the same address with different capitalisation, and matching them
// exactly silently drops links that should be made.
// Email addresses, display names and provider logins are all compared case-insensitively: a
// corporate git config and a provider profile routinely record the same address or name with
// different capitalisation, and provider logins are themselves case-insensitive, so matching
// them exactly silently drops links that should be made.
emails := make(map[string]string)
names := make(map[string]string)
for _, user := range users {
if user.Email != "" {
emails[strings.ToLower(user.Email)] = user.Id
}
if user.Name != "" {
names[user.Name] = user.Id
names[strings.ToLower(user.Name)] = user.Id
}
}
clauses := []dal.Clause{
Expand Down Expand Up @@ -88,15 +89,15 @@ func ConnectUserAccountsExact(taskCtx plugin.SubTaskContext) errors.Error {
},
}, nil
}
if userId, ok := names[account.FullName]; account.FullName != "" && ok {
if userId, ok := names[strings.ToLower(account.FullName)]; account.FullName != "" && ok {
return []interface{}{
&crossdomain.UserAccount{
UserId: userId,
AccountId: account.Id,
},
}, nil
}
if userId, ok := names[account.UserName]; account.UserName != "" && ok {
if userId, ok := names[strings.ToLower(account.UserName)]; account.UserName != "" && ok {
return []interface{}{
&crossdomain.UserAccount{
UserId: userId,
Expand Down
Loading