[codeface] [PATCH] Id service will not insert any developers without email

  • From: Mitchell Joblin <joblin.m@xxxxxxxxx>
  • To: codeface@xxxxxxxxxxxxx
  • Date: Fri, 14 Feb 2014 22:49:34 +0100

From: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx>

- there is the possibility that a developer did not enter an
  email address in a sign-off tag or in the committer/author
  sections of a commit

- the id service in this case would just say that the person
  is not in the database and will also not add people of this
  type and ends up breaking the analysis completely

- instead we deal with the missing email address by inserting
  an "NA" string

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx>
---
 id_service/id_service.js | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/id_service/id_service.js b/id_service/id_service.js
index 2bb5afe..9a5676c 100644
--- a/id_service/id_service.js
+++ b/id_service/id_service.js
@@ -372,11 +372,10 @@ app.getUserFromDB = function(name, email, projectID, 
response) {
                     response.end(JSON.stringify(id));
                 } else if (rows.length == 0) {
                     if (!email) {
-                        logger.log('error', 'name ' + name + ' (no email ' + 
email + ') not found in database!');
-                        response.end(JSON.stringify({"error": "name not 
found"}));
-                    } else {
-                        app.getOrUpdateUserInDB(name, email, projectID, 
response)
-                    }
+                      email = "NA";
+                    } 
+                    app.getOrUpdateUserInDB(name, email, projectID, response)
+                  
                 } else {
                     logger.log('error', 'database error: duplicate entries!');
                     response.end(JSON.stringify({"error": "duplicate 
entries"}));
-- 
1.8.1.2


Other related posts: