From 6b3259ee21e72fbed6c06519e7a86fa7d5e24030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Thu, 17 Jan 2019 18:22:23 +0100 Subject: [PATCH] Allow user to generate urls for the given results. Introduce the flag `--url` who allow user to generate urls for the given result. Introduce the option `--distgit` to allow user to specify the base url to use to generate urls. Change-Id: I10d4f92f64a68f283c70c2c880c27a069f123762 --- doc/source/reference/using.rst | 13 +++++++++++++ tools/membership_freeze_test.py | 29 +++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/doc/source/reference/using.rst b/doc/source/reference/using.rst index a98b5dc0e5..63bc0874f5 100644 --- a/doc/source/reference/using.rst +++ b/doc/source/reference/using.rst @@ -622,6 +622,19 @@ To check for Stein release: tox -e membership_freeze_test -- stein ~/branches/governance/reference/projects.yaml +This script generate can generate a project url and append it to each results found +simply by adding the flag `--url` to your command. + +By default the generated urls use the official git repository +(https://git.openstack.org) but you can use another one like github or your +specific dist git url by adding the option `--distgit ` to your command. + +Example: + +:: + + tox -e membership_freeze_test -- stein ~/branches/governance/reference/projects.yaml --url --distgit https://github.com/ + propose-final-releases ---------------------- diff --git a/tools/membership_freeze_test.py b/tools/membership_freeze_test.py index b059514c2d..383f9affa9 100644 --- a/tools/membership_freeze_test.py +++ b/tools/membership_freeze_test.py @@ -49,7 +49,10 @@ def in_governance_but_not_released(args): if os.path.isfile(fname): break else: - missing.append((tname, dname)) + url = '' + if len(deliverable['repos']) == 1: + url = deliverable['repos'][0] + missing.append((tname, dname, url)) return missing @@ -68,20 +71,34 @@ def main(args=sys.argv[1:]): action="store_true", help='display results to yaml format' ) + parser.add_argument( + '--url', + action='store_true', + help='generate url for the given results found' + ) + parser.add_argument( + '--distgit', + default='https://git.openstack.org/cgit/', + required=False, + help='deliverable git repository url to use' + ) args = parser.parse_args(args) last_team = '' missing = in_governance_but_not_released(args) - for team, deliverable in missing: + for team, deliverable, url in missing: if last_team != team: print('\n' + team + ':') last_team = team output_format = "- " if args.yaml else "" - print("{}{}".format(output_format, deliverable)) + output = "{}{}".format(output_format, deliverable) + if args.url: + output = "{} ({}{})".format(output, args.distgit, url) + print(output) if missing: - print('-' * 50) - print('{} project(s) missing'.format(len(missing))) - print('-' * 50) + print("-" * 50) + print("{} project(s) missing".format(len(missing))) + print("-" * 50) if __name__ == '__main__':