From 9341118edd8dcf4d3a5bee658f5c2890ad84c40b Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Fri, 28 Jul 2017 17:54:03 +0000 Subject: [PATCH] Use foundation member IDs in invitations list Since the foundation sometimes needs to deduplicate subsequent invitations for the same foundation member against invitations sent by another system, use the member ID as the first field of the invite instead of using the Gerrit username now that we have that information available. Use a default member ID of 0 to indicate non-member invitees who may require additional manual deduplication or vetting. Also log the member ID in the output of the invite mass mailer script. Change-Id: I86d879a5f06144a0889eb852f2cf3d555a12a7aa --- tools/invite2summit/send.py | 4 ++-- tools/owners.py | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tools/invite2summit/send.py b/tools/invite2summit/send.py index ccaf25c2af..85e8c53d26 100644 --- a/tools/invite2summit/send.py +++ b/tools/invite2summit/send.py @@ -27,7 +27,7 @@ from string import Template class ATC(object): def __init__(self, row): - self.lpid = row[0] + self.osfid = row[0] self.name = unicode(row[1], 'utf8') self.emails = row[2:] @@ -79,6 +79,6 @@ if __name__ == '__main__': session.sendmail(settings.EMAIL_FROM, committer.emails, msg.as_string()) - print "%s,ATC,%s" % (code, committer.name) + print "%s,%s,%s" % (code, committer.osfid, committer.name) session.quit() time.sleep(settings.EMAIL_PAUSE) diff --git a/tools/owners.py b/tools/owners.py index f9c1e77276..a5c908a2c3 100644 --- a/tools/owners.py +++ b/tools/owners.py @@ -630,19 +630,11 @@ def main(argv=sys.argv): owners[owner]['extra'].sort() # Build the data used for an invite - invite = [] - if 'username' not in owners[owner] or not owners[owner]['username']: - print( - 'SKIPPING MALFORMED OWNER: no username found for account %s' % - owner, file=sys.stderr) - continue - invite.append(owners[owner]['username']) if 'name' not in owners[owner] or not owners[owner]['name']: print( 'SKIPPING MALFORMED OWNER: no fullname found for account %s' % owner, file=sys.stderr) continue - invite.append(owners[owner]['name'].encode('utf-8')) if 'preferred' not in owners[owner]: if 'extra' in owners[owner] and owners[owner]['extra']: owners[owner]['preferred'] = owners[owner]['extra'][0] @@ -660,6 +652,8 @@ def main(argv=sys.argv): if member['data']: owners[owner]['member'] = member['data'][0]['id'] continue + invite = [owners[owner].get('member','0')] + invite.append(owners[owner]['name'].encode('utf-8')) invite.append(owners[owner]['preferred']) invite += owners[owner]['extra'] invites.append(invite)