linters: enforce ATC membership after January 2020

In the past, we did not have any enforcement for extra ATCs in
terms of foundation membership.  This has resulted in entries
being added which are not foundation members that cannot be
ATCs.

This patch adds a check to ignore our old records (until they
expire out in January 2020) and enforce it on any newly added
ATCs.

Change-Id: Id1f6d5b0bffb41c952e140372a3594669359fbdb
This commit is contained in:
Mohammed Naser 2019-08-12 10:04:19 -04:00
parent d4d3fc81e4
commit 346d3d2f06
1 changed files with 17 additions and 3 deletions

View File

@ -12,6 +12,7 @@
# under the License. # under the License.
import argparse import argparse
from datetime import datetime
import json import json
import logging import logging
@ -110,6 +111,8 @@ def main():
with open(args.projects, 'r', encoding='utf-8') as f: with open(args.projects, 'r', encoding='utf-8') as f:
projects = yaml.safe_load(f.read()) projects = yaml.safe_load(f.read())
exit_code = 0
for project_name, project_data in sorted(projects.items()): for project_name, project_data in sorted(projects.items()):
atcs = project_data.get('extra-atcs', []) atcs = project_data.get('extra-atcs', [])
for atc in atcs: for atc in atcs:
@ -120,9 +123,20 @@ def main():
project_name, atc, e)) project_name, atc, e))
else: else:
if not member: if not member:
print(('ERROR: {}: Did not find {} associated ' # NOTE(mnaser): The ATC membership checks were not
'with a member for {}').format( # enforced for all ATCs expiring before
project_name, atc['email'], atc)) # January 2020. This should be removed
# after January 2020.
expires = datetime.strptime(atc['expires-in'], "%B %Y")
if expires <= datetime(2020, 1, 1):
msg = 'Skipping {} from validation'.format(atc)
else:
msg = 'Unable to find membership: {}'.format(atc)
exit_code = 1
print('{}: {}'.format(project_name, msg))
return exit_code
if __name__ == '__main__': if __name__ == '__main__':