From e33b71e7acaa22bff61ee9575708ac4ee93ae3c3 Mon Sep 17 00:00:00 2001 From: Mohan Boddu Date: Jul 15 2019 22:32:26 +0000 Subject: Support for epel*-playground branch requests Signed-off-by: Mohan Boddu --- diff --git a/fedpkg/cli.py b/fedpkg/cli.py index d7b0872..c9a697f 100644 --- a/fedpkg/cli.py +++ b/fedpkg/cli.py @@ -904,10 +904,23 @@ targets to build the package for a particular stream. 'a git repository') pdc_url = config.get('{0}.pdc'.format(name), 'url') + # When a 'epel\d' branch is requested, it should automatically request + # 'epel\d+-playground' branch. + epel_playground = False if branch: + # Check if the requested branch is an epel branch + if bool(re.match(r'^(?:epel)\d+$', branch)): + epel_playground = True + if is_epel(branch): assert_valid_epel_package(repo_name, branch) + # Requesting epel\d-playground branches is not allowed + if bool(re.match(r'^(?:epel)\d+-playground$', branch)): + raise rpkgError( + 'You cannot request {0} branch, as they are ' + 'created as part of epel branch requests'.format(branch)) + if ns in ['modules', 'test-modules', 'flatpaks']: branch_valid = bool(re.match(r'^[a-zA-Z0-9.\-_+]+$', branch)) if not branch_valid: @@ -942,7 +955,13 @@ targets to build the package for a particular stream. branches = [b for b in release_branches if re.match(r'^(f\d+)$', b)] else: - branches = [branch] + # If the requested branch is epel branch then also add epel\d+-playground + # branch to the request list. + # Remove the check for epel version >= 7 when we enable playground for epel7 + if epel_playground and int(''.join([i for i in branch if re.match(r'\d', i)])) >= 7: + branches = [branch, branch+"-playground"] + else: + branches = [branch] for b in sorted(list(branches), reverse=True): ticket_body = { @@ -965,11 +984,14 @@ targets to build the package for a particular stream. # For non-standard rpm branch requests, also request a matching new # module repo with a matching branch. - auto_module = ( - ns == 'rpms' - and not re.match(RELEASE_BRANCH_REGEX, b) - and not no_auto_module - ) + auto_module = None + # Dont run auto_module on epel requests + if not epel_playground: + auto_module = ( + ns == 'rpms' + and not re.match(RELEASE_BRANCH_REGEX, b) + and not no_auto_module + ) if auto_module: summary = ('Automatically requested module for ' 'rpms/%s:%s.' % (repo_name, b))