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
This commit is contained in:
Hervé Beraud 2019-01-17 18:22:23 +01:00
parent a806227734
commit 6b3259ee21
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 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 propose-final-releases
---------------------- ----------------------

View File

@ -49,7 +49,10 @@ def in_governance_but_not_released(args):
if os.path.isfile(fname): if os.path.isfile(fname):
break break
else: else:
missing.append((tname, dname)) url = ''
if len(deliverable['repos']) == 1:
url = deliverable['repos'][0]
missing.append((tname, dname, url))
return missing return missing
@ -68,20 +71,34 @@ def main(args=sys.argv[1:]):
action="store_true", action="store_true",
help='display results to yaml format' 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) args = parser.parse_args(args)
last_team = '' last_team = ''
missing = in_governance_but_not_released(args) missing = in_governance_but_not_released(args)
for team, deliverable in missing: for team, deliverable, url in missing:
if last_team != team: if last_team != team:
print('\n' + team + ':') print('\n' + team + ':')
last_team = team last_team = team
output_format = "- " if args.yaml else "" 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: if missing:
print('-' * 50) print("-" * 50)
print('{} project(s) missing'.format(len(missing))) print("{} project(s) missing".format(len(missing)))
print('-' * 50) print("-" * 50)
if __name__ == '__main__': if __name__ == '__main__':