From cac52d57047512c49171e4f2a18a87dafdb9b107 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 8 Feb 2017 16:02:37 -0500 Subject: [PATCH] remove latest-deliverable-versions command This command was used to manually maintain the release dashboard, but we no longer need to do that. Change-Id: I1ac9457f44808d4bd1216e0dba125c8c19dbf23e Signed-off-by: Doug Hellmann --- README.rst | 9 -- .../cmds/latest_deliverable_versions.py | 129 ------------------ setup.cfg | 1 - 3 files changed, 139 deletions(-) delete mode 100644 releasetools/cmds/latest_deliverable_versions.py diff --git a/README.rst b/README.rst index 9895441..17cadfc 100644 --- a/README.rst +++ b/README.rst @@ -225,15 +225,6 @@ the change but leaving out the email message boilerplate. This mode is useful for examining the list of unreleased changes in a project to decide if a release is warranted and to pick a version number. -latest-deliverable-versions ---------------------------- - -Show each repository and the latest tag recorded in the deliverable -file associated with that repo. - -:: - - latest-deliverable-versions -r ~/repos/openstack/releases mitaka launchpad-login diff --git a/releasetools/cmds/latest_deliverable_versions.py b/releasetools/cmds/latest_deliverable_versions.py deleted file mode 100644 index cfe87f7..0000000 --- a/releasetools/cmds/latest_deliverable_versions.py +++ /dev/null @@ -1,129 +0,0 @@ -# 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. - -from __future__ import print_function - -import argparse -import csv -import glob -import os.path - -import yaml - - -def get_latest_deliverable_versions(deliverable_files, verbose): - for filename in deliverable_files: - if verbose: - print('\n{}'.format(filename)) - with open(filename, 'r') as f: - deliverable_data = yaml.safe_load(f) - deliverable_name = os.path.basename(filename)[:-5] # drop .yaml - releases = deliverable_data.get('releases') - if not releases: - if verbose: - print('# no releases') - continue - latest_release = releases[-1] - projects = latest_release.get('projects') - if not projects: - if verbose: - print('# no projects') - continue - yield( - (deliverable_data['team'].lower(), - deliverable_name, - latest_release['version'], - filename) - ) - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument( - '--releases-repo', '-r', - default='.', - help='path to the releases repository for automatic scanning', - ) - parser.add_argument( - '--dashboard', '-d', - default=None, - help='the name of a CSV file exported from the release dashboard', - ) - parser.add_argument( - '--verbose', '-v', - action='store_true', - default=False, - help='produce detailed output', - ) - parser.add_argument( - 'series', - help='the name of the release series to work on' - ) - args = parser.parse_args() - - deliverables_dir = os.path.join(args.releases_repo, 'deliverables') - if not os.path.exists(deliverables_dir): - parser.error('{} does not exist'.format(deliverables_dir)) - - pattern = os.path.join(deliverables_dir, - args.series, '*.yaml') - if args.verbose: - print('Scanning {}'.format(pattern)) - deliverable_files = sorted(glob.glob(pattern)) - - deliverables = sorted(get_latest_deliverable_versions( - deliverable_files, args.verbose) - ) - - if args.dashboard: - # Compare the latest version with what is known in the - # dashboard file and report on discrepancies. - with open(args.dashboard, 'r') as f: - reader = csv.DictReader(f) - dash = { - row['Deliverable Name'].lower(): row - for row in reader - } - for team, deliverable, version, filename in deliverables: - dash_info = dash.get(deliverable.lower(), {}) - if not dash_info: - print(deliverable, 'NOT IN DASHBOARD') - continue - # Search the version fields for the dashboard in order to - # find the version specified. - not_it = [] - for fn in ['Pre-RC1', 'RC1', 'Latest RC']: - if version == dash_info[fn]: - if args.verbose: - print(deliverable, version, fn) - break - not_it.append((fn, dash_info[fn])) - else: - # Report that we have a version later than the most - # recently known version from the dashboard. - for ni in not_it[::-1]: - if ni[1]: - print( - '{} version {} LATER THAN {} version {}'.format( - deliverable, - version, - ni[0], - ni[1], - ) - ) - break - else: - # Just dump the versions that are found. - for team, deliverable, version, filename in deliverables: - print('{:<25} {}'.format(deliverable, version)) diff --git a/setup.cfg b/setup.cfg index 374b578..bb29e1f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,4 +35,3 @@ console_scripts = launchpad-login = releasetools.cmds.launchpad_login:main send-mail = releasetools.cmds.mail:main update-reviews = releasetools.cmds.update_reviews:main - latest-deliverable-versions = releasetools.cmds.latest_deliverable_versions:main