From a1eea1fb3acc1f2ca4705f8e448721a240390e96 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Wed, 7 Aug 2024 15:49:15 +0200 Subject: [PATCH] Add email template for direct reminder about nomination deadline This new template can be generated for single project, it will have list of all contributors to the project as "TO" list. It is intended to be send before end of the nomination period to the contributors of the projects without PTL candidates proposed. Change-Id: Ie96281207c68852f4a6faea07317a400ad59dd93 --- README.rst | 6 +++ openstack_election/cmds/template_emails.py | 42 ++++++++++++++++++- .../combined_nominations_direct_reminder.j2 | 27 ++++++++++++ .../ptl_nominations_direct_reminder.j2 | 27 ++++++++++++ 4 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 openstack_election/templates/combined_nominations_direct_reminder.j2 create mode 100644 openstack_election/templates/ptl_nominations_direct_reminder.j2 diff --git a/README.rst b/README.rst index 04256240..cf724da7 100644 --- a/README.rst +++ b/README.rst @@ -97,6 +97,12 @@ A couple of days before the candidacy submission ends: * ``tox -e venv -- template-emails nominations_last_days`` +* Optionally send direct *PTL nominations Last Days* email to the members of the + teams with no PTL candidates proposed: + + * ``tox -evenv -- template-emails nominations_direct_reminder -p + -o `` + When PTL Candidacy submission ends: * Send *PTL Nominations End* email diff --git a/openstack_election/cmds/template_emails.py b/openstack_election/cmds/template_emails.py index 643a9f23..34581690 100644 --- a/openstack_election/cmds/template_emails.py +++ b/openstack_election/cmds/template_emails.py @@ -19,7 +19,8 @@ time_frame = "%(start_str)s - %(end_str)s" % (conf['timeframe']) start_release, _, end_release = conf['timeframe']['name'].partition('-') template_names = ['election_season', 'nominations_kickoff', - 'nominations_last_days', 'end_nominations', + 'nominations_last_days', 'nominations_direct_reminder', + 'end_nominations', 'voting_optin_civs', 'voting_kickoff', 'voting_last_days'] fmt_args = dict( email_deadline=conf['timeframe']['email_deadline'], @@ -68,10 +69,49 @@ if election_type in ['ptl', 'combined']: def main(): + timeframe_start_date = conf['timeframe']['start'].strftime('%Y-%m-%d') + timeframe_end_date = conf['timeframe']['end'].strftime('%Y-%m-%d') parser = argparse.ArgumentParser('Tool to generate form emails') parser.add_argument('template', choices=template_names) + parser.add_argument('-p', '--project-name', required=False, + help="Specify name of the project for which template " + "will be generated. Required only for the " + "'nominations_direct_reminder' template") + parser.add_argument('-o', '--owners-dir', required=False, + help="Path to the owners outdir. " + "It can be generated with: " + "'tox -e venv -- owners -a %s -b %s " + "-o '" % ( + timeframe_start_date, timeframe_end_date)) args = parser.parse_args() + + if args.template == 'nominations_direct_reminder': + if not args.project_name: + print("Project name is required for the " + "'nominations_direct_reminder' template to be generated", + file=sys.stderr) + return 1 + if not args.owners_dir: + print("Please provide path to the owners directory. " + "It can be generated with command: " + "tox -e venv -- owners -a %s -b %s " + "-o " % (timeframe_start_date, + timeframe_end_date), + file=sys.stderr) + return 1 + project_owners_file = "%s/%s.txt" % ( + args.owners_dir, args.project_name.lower()) + contributors = "" + with open(project_owners_file) as f: + contributors = ", ".join([ + email.strip() for email in f.readlines()]) + + fmt_args.update(dict( + project_name=args.project_name.title(), + contributors=contributors + )) + func_name = ('%(election_type)s_%(template)s' % (dict(election_type=conf['election_type'], template=args.template))) diff --git a/openstack_election/templates/combined_nominations_direct_reminder.j2 b/openstack_election/templates/combined_nominations_direct_reminder.j2 new file mode 100644 index 00000000..8b44d880 --- /dev/null +++ b/openstack_election/templates/combined_nominations_direct_reminder.j2 @@ -0,0 +1,27 @@ +BCC: {{ contributors }} +Subject: OpenStack {{ project_name }} PTL {{ release }} cycle Election Nominations Last Days + +You are OpenStack {{ project_name }} contributor. This project still does not +have any candidates for PTL. + +This is a reminder that we are in the last days for declaring PTL candidacies. +Nominations are open until {{ end_nominations }}. + +If you want to stand for election, don't delay, follow the instructions at [1] +to make sure the community knows your intentions. +If you don't want to stand for election, maybe you can remind other members of +the {{ project_name }} team about the nomination deadline. + +If you or someone from the {{ project_name }} team already proposed their +candidacy, please make sure that nomination(s) has been submitted to the +openstack/election repository and approved by election officials. + +If there will not be any candidate for the PTL for the +{{ project_name }}, when the nomination deadline ends, it will be deemed +leaderless. +In this case the TC will oversee PTL selection as described by [2]. + +Thank you, + +[1] https://governance.openstack.org/election/#how-to-submit-a-candidacy +[2] {{ leaderless_url }} diff --git a/openstack_election/templates/ptl_nominations_direct_reminder.j2 b/openstack_election/templates/ptl_nominations_direct_reminder.j2 new file mode 100644 index 00000000..25440a88 --- /dev/null +++ b/openstack_election/templates/ptl_nominations_direct_reminder.j2 @@ -0,0 +1,27 @@ +To: {{ contributors }} +Subject: OpenStack {{ project_name }} PTL {{ release }} cycle Election Nominations Last Days + +You are OpenStack {{ project_name }} contributor. This project still don't have +any candidates for PTL. + +This is a reminder that we are in the last hours for declaring PTL candidacies. +Nominations are open until {{ end_nominations }}. + +If you want to stand for election, don't delay, follow the instructions at [1] +to make sure the community knows your intentions. +If you don't want to stand for election, maybe You can remind other members of +the {{ project_name }} team about the nomination deadline. + +If you or someone from the {{ project_name }} team already proposed +candidacy, please make sure that nomination(s) has been submitted to the +openstack/election repository and approved by election officials. + +In case if there will be no any candidate for the PTL for the +{{ project_name }}, with approximately 2 days left, it will be deemed +leaderless. +In this case the TC will oversee PTL selection as described by [2]. + +Thank you, + +[1] https://governance.openstack.org/election/#how-to-submit-a-candidacy +[2] {{ leaderless_url }}