From eabb5ae7dd0495f67b73d76137df78b84e2792ec Mon Sep 17 00:00:00 2001 From: Mohan Boddu Date: Jul 16 2019 15:41:29 +0000 Subject: Support for epel*-playground branch requests Fixes: #334 JIRA: COMPOSE-3677 Merges: https://pagure.io/fedpkg/pull-request/336 Signed-off-by: Mohan Boddu --- diff --git a/fedpkg/cli.py b/fedpkg/cli.py index d7b0872..1732a22 100644 --- a/fedpkg/cli.py +++ b/fedpkg/cli.py @@ -904,10 +904,26 @@ 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 + epel_version = None if branch: + # Check if the requested branch is an epel branch + match = re.match(r'^epel(?P\d+)$', branch) + if match: + epel_playground = True + epel_version = int(match.groupdict()["epel_version"]) + 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 directly 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: @@ -941,6 +957,11 @@ targets to build the package for a particular stream. *list(get_release_branches(pdc_url).values()))) branches = [b for b in release_branches if re.match(r'^(f\d+)$', b)] + # If the requested branch is epel branch then also add epel\d+-playground branch + # to the request list. + # TODO: Remove the check for epel version >= 7 when we enable playground for epel7 + elif epel_playground and epel_version >= 7: + branches = [branch, branch+"-playground"] else: branches = [branch] @@ -968,6 +989,7 @@ targets to build the package for a particular stream. auto_module = ( ns == 'rpms' and not re.match(RELEASE_BRANCH_REGEX, b) + and not epel_playground # Dont run auto_module on epel requests and not no_auto_module ) if auto_module: