Merge "Allow user to generate urls for the given results."

This commit is contained in:
Zuul 2019-02-07 10:29:40 +00:00 committed by Gerrit Code Review
commit 8262f18660
2 changed files with 36 additions and 6 deletions

View File

@ -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 <base-url>` to your command.
Example:
::
tox -e membership_freeze_test -- stein ~/branches/governance/reference/projects.yaml --url --distgit https://github.com/
propose-final-releases
----------------------

View File

@ -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__':