From e1590dc0523793b8f3786d73aa649eb7a73bbf41 Mon Sep 17 00:00:00 2001 From: Ilya Shakhat Date: Thu, 19 Sep 2013 12:32:39 +0400 Subject: [PATCH] Extend user with gerrit_id attribute Some users' launchpad_id and gerrit_id do not match and need to be set properly. Closes bug #1224829 Change-Id: I6cf4eaca283558e625e90343813889f3397b82b9 --- etc/default_data.json | 12 ++++++++++++ etc/default_data.schema.json | 3 +++ stackalytics/processor/default_data_processor.py | 2 ++ 3 files changed, 17 insertions(+) diff --git a/etc/default_data.json b/etc/default_data.json index 4f246f08d..b4781fedb 100644 --- a/etc/default_data.json +++ b/etc/default_data.json @@ -1605,6 +1605,18 @@ "user_name": "Kevin Bringard", "emails": ["kbringard@attinteractive.com", "kbringard@att.com"] }, + { + "launchpad_id": "kc-wang", + "gerrit_id": "kcwang", + "companies": [ + { + "company_name": "Big Switch Networks", + "end_date": null + } + ], + "user_name": "Kuang-Ching Wang", + "emails": ["kuangching.wang@gmail.com", "kc.wang@bigswitch.com"] + }, { "launchpad_id": "ke-wu", "companies": [ diff --git a/etc/default_data.schema.json b/etc/default_data.schema.json index fdbba4fbc..f867c9b30 100644 --- a/etc/default_data.schema.json +++ b/etc/default_data.schema.json @@ -11,6 +11,9 @@ "launchpad_id": { "type": "string" }, + "gerrit_id": { + "type": "string" + }, "user_name": { "type": "string" }, diff --git a/stackalytics/processor/default_data_processor.py b/stackalytics/processor/default_data_processor.py index 3492d49e7..ec61cafea 100644 --- a/stackalytics/processor/default_data_processor.py +++ b/stackalytics/processor/default_data_processor.py @@ -91,6 +91,8 @@ def _process_users(runtime_storage_inst, users): users_index[user['user_id']] = user if 'launchpad_id' in user: users_index[user['launchpad_id']] = user + if 'gerrit_id' in user: + users_index[user['gerrit_id']] = user for email in user['emails']: users_index[email] = user runtime_storage_inst.set_by_key('users', users_index)