From 98168291d53b91e379f29f17f65c8dd3c16935fd Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 13 Jul 2016 12:59:47 -0400 Subject: [PATCH] show the governance tags for a deliverable in list-changes Sometimes evaluating the changes requires knowing how the deliverables are set up in the governance repository. For example, releases from "stable" branches of projects that do not claim to follow the stable release process can be evaluated more leniently. Change-Id: I9337d5ab77bcfc302af65f755a801f8b20f839f9 Signed-off-by: Doug Hellmann --- openstack_releases/cmds/list_changes.py | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/openstack_releases/cmds/list_changes.py b/openstack_releases/cmds/list_changes.py index 1cd3cdd946..3d4f8d843c 100644 --- a/openstack_releases/cmds/list_changes.py +++ b/openstack_releases/cmds/list_changes.py @@ -30,6 +30,7 @@ import yaml from openstack_releases import defaults from openstack_releases import gitutils +from openstack_releases import governance def header(title): @@ -113,6 +114,8 @@ def main(): print('not cleaning up %s' % workdir) atexit.register(cleanup_workdir) + team_data = governance.get_team_data() + # Remove any inherited PAGER environment variable to avoid # blocking the output waiting for input. os.environ['PAGER'] = '' @@ -126,6 +129,31 @@ def main(): with open(filename, 'r') as f: deliverable_info = yaml.load(f.read()) + header('team info') + if 'team' in deliverable_info: + team_name = deliverable_info['team'] + team_dict = team_data.get(team_name) + if team_dict: + team = governance.Team(team_name, team_dict) + print('found team %s' % team_name) + deliverable_name = os.path.basename(filename)[:-5] # remove .yaml + deliverable = team.deliverables.get(deliverable_name) + if deliverable: + print('found deliverable %s' % deliverable_name) + for rn, repo in sorted(deliverable.repositories.items()): + print('\nrepo %s\ntags:' % repo.name) + for t in repo.tags: + print(' %s' % t) + else: + print(('no deliverable %r found for team %r, ' + 'cannot report on governance status') % + (deliverable_name, team_name)) + else: + print('no team %r found, cannot report on governance status' % + team_name) + else: + print('no team name given, cannot report on governance status') + series = os.path.basename( os.path.dirname( os.path.abspath(filename)