mirror of
https://github.com/corda/corda.git
synced 2024-12-20 13:33:12 +00:00
CORDA-3017 - Fix release tooling when product name != jira project (#5229)
This commit is contained in:
parent
dd98461d87
commit
a855fc6690
@ -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
|
# {{{ JIRA queries
|
||||||
QUERY_LIST_TEST_CASES = \
|
QUERY_LIST_TEST_CASES = \
|
||||||
u'project = R3T AND type = "Platform Test Template" AND status = Active AND labels = "{}" ORDER BY key'
|
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)
|
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)
|
if not user or not password: sys.exit(1)
|
||||||
jira = Jira().login(user, password)
|
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
|
candidate = '{} {}'.format(version, format_candidate(args.CANDIDATE)) if args.CANDIDATE else version
|
||||||
if args.CANDIDATE:
|
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))))
|
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)
|
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)
|
if not user or not password: sys.exit(1)
|
||||||
jira = Jira().login(user, password)
|
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
|
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)
|
confirm(u'Create new version {}?'.format(yellow(version)), auto_yes=args.yes or args.dry_run)
|
||||||
print()
|
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)
|
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)
|
if not user or not password: sys.exit(1)
|
||||||
jira = Jira().login(user, password)
|
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)
|
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:
|
if args.verbose:
|
||||||
print(faint('[{}]'.format(QUERY_LIST_TEST_CASES.format(args.PRODUCT))))
|
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)
|
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)
|
if not user or not password: sys.exit(1)
|
||||||
jira = Jira().login(user, password)
|
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 = args.CANDIDATE[0]
|
||||||
candidate = '{} {}'.format(version, format_candidate(CANDIDATE))
|
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)
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user