#335 Try to make epel8 and epel-playground8 work in fedpkg
Closed by smooge. Opened by smooge.
Unknown source master

Download 335.patch

In trying to fix issue 334 I attempted to make changes which matched current code style maybe

@smooge I guess the easiest fix would be, this will consider epel8-playground as epel8

diff --git a/fedpkg/cli.py b/fedpkg/cli.py
index d7b0872..6336494 100644
--- a/fedpkg/cli.py
+++ b/fedpkg/cli.py
@@ -917,6 +917,9 @@ targets to build the package for a particular stream.
                         'names'.format('flatpak' if ns == 'flatpaks' else 'module'))
             release_branches = list(itertools.chain(
                 *list(get_release_branches(pdc_url).values())))
+            if 'epel' in branch and 'playground' in branch:
+                branch_playground = branch
+                branch = branch_testing.split("-")[0]
             if branch in release_branches:
                 if service_levels:
                     raise rpkgError(

And use branch_playground whenever needed.

I guess this should work

diff --git a/fedpkg/cli.py b/fedpkg/cli.py
index d7b0872..8c1d124 100644
--- a/fedpkg/cli.py
+++ b/fedpkg/cli.py
@@ -905,6 +905,9 @@ targets to build the package for a particular stream.
         pdc_url = config.get('{0}.pdc'.format(name), 'url')
         if branch:
+            if 'epel' in branch and 'playground' in branch:
+                branch_playground = branch
+                branch = branch.split("-")[0]
             if is_epel(branch):
                 assert_valid_epel_package(repo_name, branch)
@@ -942,7 +945,10 @@ 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 branch_playground:
+                branches = [branch_playground]
+            else:
+                branches = [branch]
         for b in sorted(list(branches), reverse=True):
             ticket_body = {

Okay, I tested in stage with my patch and it seems to be working - https://stg.pagure.io/releng/fedora-scm-requests/issue/202

diff --git a/fedpkg/cli.py b/fedpkg/cli.py
index d7b0872..c10f76b 100644
--- a/fedpkg/cli.py
+++ b/fedpkg/cli.py
@@ -905,6 +905,9 @@ targets to build the package for a particular stream.
         pdc_url = config.get('{0}.pdc'.format(name), 'url')
         if branch:
+            if 'epel' in branch and 'playground' in branch:
+                branch_playground = branch
+                branch = branch_testing.split("-")[0]
             if is_epel(branch):
                 assert_valid_epel_package(repo_name, branch)
@@ -942,7 +945,10 @@ 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 branch_playground:
+                branches = [branch_playground]
+            else
+                branches = [branch]
         for b in sorted(list(branches), reverse=True):
             ticket_body = {
@@ -965,11 +971,13 @@ 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
+            if not branch_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))

Created the PR with the above patch - https://pagure.io/fedpkg/pull-request/336

If its good, let me know and I will add some comments.

This failed jenkins and I think mohan's idea is better thought out.

Pull-Request has been closed by smooge

Metadata