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

  • From: Mitchell Joblin <joblin.m@xxxxxxxxx>
  • To: Wolfgang Mauerer <wm@xxxxxxxxxxxxxxxx>
  • Date: Mon, 17 Feb 2014 11:09:58 +0100

Hi Wolfgang,

On Mon, Feb 17, 2014 at 10:47 AM, Wolfgang Mauerer <wm@xxxxxxxxxxxxxxxx> wrote:
> Hi Mitchell,
>
> On 14/02/2014 22:49, Mitchell Joblin wrote:
>> 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
>
> do we have any advantage by inventing a new SQL encoding for
> "missing/unknown value" instead of using NULL? The data model would
> have to be adapted to allow for NULL values, naturally.

Yes I think it would be better to insert NULL instead of the "NA"
string. Since I was told in the past not to edit the data model this
was the solution that I proposed. If the appropriate person makes the
change to the data model then we can insert NULL values.

At this point, I am not entirely sure what other implications there
might be for having NULL values for the email. Based on the VCS
analysis passes I don't imagine any problems with NULL, for the
mailing list and bug tracking analysis I am not sure.

How should we proceed with the changes to the data model?

Kind regards,

Mitchell


>
> Thanks, Wolfgang
>>
>> 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"}));
>>
>

Other related posts: