releases/tools/membership_freeze_test.py
Thierry Carrez 50258742c9 Add script to facilitate MembershipFreeze handling
This script will compute a list of deliverables present in
governance but unknown to release management, for manual
processing.

Change-Id: Ibebf777911416d978ecea5ba8d7b25b211e7ae52
2019-01-16 22:34:21 +01:00

77 lines
2.3 KiB
Python

#!/usr/bin/python
#
# List deliverables that appear in governance but not in releases
# in preparation for MemberShipFreeze
#
# Copyright 2019 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import argparse
import os.path
import sys
import yaml
# Infrastructure/OpenDev repositories escape OpenStack release management
TEAM_EXCEPTIONS = ['Infrastructure']
def deliverable_filename(deliverable, series):
return os.path.join('./deliverables', series, deliverable + '.yaml')
def in_governance_but_not_released(args):
missing = []
dirs = [args.series, '_independent']
with open(args.projects_yaml, 'r') as projects:
teams = yaml.load(projects)
for tname, team in teams.items():
if tname in TEAM_EXCEPTIONS:
continue
for dname, deliverable in team['deliverables'].items():
if 'release-management' in deliverable:
continue
for fname in [deliverable_filename(dname, s) for s in dirs]:
if os.path.isfile(fname):
break
else:
missing.append((tname, dname))
return missing
def main(args=sys.argv[1:]):
parser = argparse.ArgumentParser()
parser.add_argument(
'series',
help='name of the currently-developed series'
)
parser.add_argument(
'projects_yaml',
help='path to governance projects.yaml file'
)
args = parser.parse_args(args)
last_team = ''
for team, deliverable in in_governance_but_not_released(args):
if last_team != team:
print('\n' + team + ':')
last_team = team
print(deliverable)
if __name__ == '__main__':
main()