CORDA-3017 - Fix release tooling when product name != jira project (#5229)

This commit is contained in:
Katelyn Baker 2019-06-21 09:28:07 +01:00 committed by GitHub
parent dd98461d87
commit a855fc6690
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,6 +42,14 @@ product_map = {
}
# }}}
# {{{ Map product name to Jira project name
project_map = {
'Corda' : 'Corda',
'Corda Enterprise' : 'Corda Enterprise',
'ENM' : 'CENM'
}
# }}}
# {{{ JIRA queries
QUERY_LIST_TEST_CASES = \
u'project = R3T AND type = "Platform Test Template" AND status = Active AND labels = "{}" ORDER BY key'
@ -88,7 +96,7 @@ def show_status(args):
user, password = login('jira', args.user, use_keyring=not args.no_keyring, reset_keyring=args.reset_keyring)
if not user or not password: sys.exit(1)
jira = Jira().login(user, password)
version = '{} {}'.format(product_map[args.PRODUCT], args.VERSION).replace('.0', '')
version = '{} {}'.format(project_map[product_map[args.PRODUCT]], args.VERSION)
candidate = '{} {}'.format(version, format_candidate(args.CANDIDATE)) if args.CANDIDATE else version
if args.CANDIDATE:
print(u'Status of test runs for {} version {} release candidate {}:'.format(yellow(product_map[args.PRODUCT]), yellow(args.VERSION), yellow(format_candidate(args.CANDIDATE))))
@ -148,7 +156,7 @@ def create_version(args):
user, password = login('jira', args.user, use_keyring=not args.no_keyring, reset_keyring=args.reset_keyring)
if not user or not password: sys.exit(1)
jira = Jira().login(user, password)
version = '{} {}'.format(product_map[args.PRODUCT], args.VERSION).replace('.0', '')
version = '{} {}'.format(project_map[product_map[args.PRODUCT]], args.VERSION)
version = '{} {}'.format(version, format_candidate(args.CANDIDATE)) if args.CANDIDATE else version
confirm(u'Create new version {}?'.format(yellow(version)), auto_yes=args.yes or args.dry_run)
print()
@ -173,7 +181,7 @@ def create_release(args):
user, password = login('jira', args.user, use_keyring=not args.no_keyring, reset_keyring=args.reset_keyring)
if not user or not password: sys.exit(1)
jira = Jira().login(user, password)
version = '{} {}'.format(product_map[args.PRODUCT], args.VERSION).replace('.0', '')
version = '{} {}'.format(project_map[product_map[args.PRODUCT]], args.VERSION)
confirm(u'Create test cases for {} version {}?'.format(yellow(product_map[args.PRODUCT]), yellow(args.VERSION)), auto_yes=args.yes or args.dry_run)
if args.verbose:
print(faint('[{}]'.format(QUERY_LIST_TEST_CASES.format(args.PRODUCT))))
@ -238,7 +246,7 @@ def create_release_candidate(args):
user, password = login('jira', args.user, use_keyring=not args.no_keyring, reset_keyring=args.reset_keyring)
if not user or not password: sys.exit(1)
jira = Jira().login(user, password)
version = '{} {}'.format(product_map[args.PRODUCT], args.VERSION).replace('.0', '')
version = '{} {}'.format(project_map[product_map[args.PRODUCT]], args.VERSION)
CANDIDATE = args.CANDIDATE[0]
candidate = '{} {}'.format(version, format_candidate(CANDIDATE))
confirm(u'Create test run tickets for {} version {} release candidate {}?'.format(yellow(product_map[args.PRODUCT]), yellow(args.VERSION), yellow(format_candidate(CANDIDATE))), auto_yes=args.yes or args.dry_run)