public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/fedpkg] 1.48-1: Merge branch 'master' into epel8
Date: Mon, 10 Aug 2026 21:45:52 GMT [thread overview]
Message-ID: <178639835286.1.18369026177357662986.rpms-fedpkg-e65149be0400@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/fedpkg
Branch : 1.48-1
Commit : e65149be0400d9791c5e791a760edf26528da482
Author : Ondřej Nosek <onosek@redhat.com>
Date : 2020-05-12T00:39:01+00:00
Stats : +737/-142 in 12 file(s)
URL : https://src.fedoraproject.org/rpms/fedpkg/c/e65149be0400d9791c5e791a760edf26528da482?branch=1.48-1
Log:
Merge branch 'master' into epel8
---
diff --git a/.gitignore b/.gitignore
index 6bf0b86..e29498e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,3 +33,4 @@
/fedpkg-1.35.tar.bz2
/fedpkg-1.36.tar.bz2
/fedpkg-1.37.tar.bz2
+/fedpkg-1.38.tar.bz2
diff --git a/0001-Bump-check-for-bodhi-client.patch b/0001-Bump-check-for-bodhi-client.patch
deleted file mode 100644
index 9a77448..0000000
--- a/0001-Bump-check-for-bodhi-client.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From b78a5ee21f5bd9d07aa2ace7177ac0f49ee11c06 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com>
-Date: Fri, 31 May 2019 09:36:10 +0200
-Subject: [PATCH] Bump check for bodhi client
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-There should be no change on the client for what fedpkg is using.
-
-Fixes: https://pagure.io/fedpkg/issue/330
-Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
----
- fedpkg/cli.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/fedpkg/cli.py b/fedpkg/cli.py
-index e8ebe4a..d7b0872 100644
---- a/fedpkg/cli.py
-+++ b/fedpkg/cli.py
-@@ -84,7 +84,7 @@ def check_bodhi_version():
- except pkg_resources.DistributionNotFound:
- raise rpkgError('bodhi-client < 2.0 is not supported.')
- major = int(dist.version.split('.', 1)[0])
-- if major >= 4:
-+ if major >= 5:
- raise rpkgError(
- 'This system has bodhi v{0}, which is unsupported.'.format(major))
-
---
-2.20.1
-
diff --git a/0002-Support-for-epel-playground-branch-requests.patch b/0002-Support-for-epel-playground-branch-requests.patch
deleted file mode 100644
index 7f07f0c..0000000
--- a/0002-Support-for-epel-playground-branch-requests.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From eabb5ae7dd0495f67b73d76137df78b84e2792ec Mon Sep 17 00:00:00 2001
-From: Mohan Boddu <mboddu@bhujji.com>
-Date: Tue, 9 Jul 2019 22:07:06 -0400
-Subject: [PATCH 1/2] Support for epel*-playground branch requests
-
-Fixes: #334
-JIRA: COMPOSE-3677
-Merges: https://pagure.io/fedpkg/pull-request/336
-
-Signed-off-by: Mohan Boddu <mboddu@bhujji.com>
----
- fedpkg/cli.py | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
-
-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<epel_version>\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:
---
-2.20.1
-
diff --git a/0003-Allow-epel-playground-requests-for-epel8-and-newer.patch b/0003-Allow-epel-playground-requests-for-epel8-and-newer.patch
deleted file mode 100644
index 06c175d..0000000
--- a/0003-Allow-epel-playground-requests-for-epel8-and-newer.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From f97d06c785a837ed860a20660ac6344ec546802c Mon Sep 17 00:00:00 2001
-From: Ondrej Nosek <onosek@redhat.com>
-Date: Thu, 18 Jul 2019 10:01:27 +0200
-Subject: [PATCH 2/2] Allow epel*-playground requests for epel8 and newer
-
-Signed-off-by: Ondrej Nosek <onosek@redhat.com>
----
- fedpkg/cli.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/fedpkg/cli.py b/fedpkg/cli.py
-index 1732a22..8e73f0f 100644
---- a/fedpkg/cli.py
-+++ b/fedpkg/cli.py
-@@ -960,7 +960,7 @@ targets to build the package for a particular stream.
- # 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:
-+ elif epel_playground and epel_version >= 8:
- branches = [branch, branch+"-playground"]
- else:
- branches = [branch]
---
-2.20.1
-
diff --git a/0006-display_name-added-to-bodhi.template.patch b/0006-display_name-added-to-bodhi.template.patch
new file mode 100644
index 0000000..4262cad
--- /dev/null
+++ b/0006-display_name-added-to-bodhi.template.patch
@@ -0,0 +1,50 @@
+From 6797e34e97cd0636d4becd8e3d77e9b41b34685b Mon Sep 17 00:00:00 2001
+From: Ondrej Nosek <onosek@redhat.com>
+Date: Thu, 15 Aug 2019 14:42:31 +0200
+Subject: [PATCH] display_name added to bodhi.template
+
+User is able to set 'display_name' during bodhi update operation which
+allows the user to customize the name of the update.
+
+Signed-off-by: Ondrej Nosek <onosek@redhat.com>
+---
+ fedpkg/cli.py | 3 +++
+ test/test_cli.py | 1 +
+ 2 files changed, 4 insertions(+)
+
+diff --git a/fedpkg/cli.py b/fedpkg/cli.py
+index e584e51..b631c94 100644
+--- a/fedpkg/cli.py
++++ b/fedpkg/cli.py
+@@ -55,6 +55,8 @@ bugs=%(bugs)s
+ # This is required for security updates.
+ # severity=unspecified
+
++display_name=
++
+ %(changelog)s
+ # Here is where you give an explanation of your update.
+ # Content can span multiple lines, as long as they are indented deeper than
+@@ -630,6 +632,7 @@ targets to build the package for a particular stream.
+ bodhi_args = {
+ 'nvr': nvr,
+ 'bugs': six.u(''),
++ 'display_name': six.u(''),
+ 'descr': six.u(
+ 'Here is where you give an explanation of your update.'),
+ 'request': self.args.request,
+diff --git a/test/test_cli.py b/test/test_cli.py
+index 58dd0d9..3d6bade 100644
+--- a/test/test_cli.py
++++ b/test/test_cli.py
+@@ -180,6 +180,7 @@ class TestUpdate(CliTestCase):
+ expected_data = {
+ 'autokarma': 'True',
+ 'bugs': '1000,2000',
++ 'display_name': six.u(''),
+ 'builds': ' {0} '.format(self.mock_nvr.return_value),
+ 'close_bugs': True,
+ 'request': 'testing',
+--
+2.21.0
+
diff --git a/0007-Move-rpm-dependency-for-test-environment-only.patch b/0007-Move-rpm-dependency-for-test-environment-only.patch
new file mode 100644
index 0000000..62d3c98
--- /dev/null
+++ b/0007-Move-rpm-dependency-for-test-environment-only.patch
@@ -0,0 +1,32 @@
+From 4cc6eb8627b91af437fc18c9ed3f4d2c98e2ddb5 Mon Sep 17 00:00:00 2001
+From: Ondrej Nosek <onosek@redhat.com>
+Date: Fri, 6 Mar 2020 15:40:20 +0100
+Subject: [PATCH] Move rpm dependency for test environment only
+
+Signed-off-by: Ondrej Nosek <onosek@redhat.com>
+---
+ requirements.txt | 1 -
+ tests-requirements.txt | 1 +
+ 2 files changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/requirements.txt b/requirements.txt
+index f65771a..c8dd6bc 100644
+--- a/requirements.txt
++++ b/requirements.txt
+@@ -2,4 +2,3 @@ openidc-client
+ python-bugzilla
+ rpkg
+ six
+-rpm
+diff --git a/tests-requirements.txt b/tests-requirements.txt
+index f6f94a7..766f8d9 100644
+--- a/tests-requirements.txt
++++ b/tests-requirements.txt
+@@ -5,3 +5,4 @@ nose-cov
+ cccolutils
+ gitpython
+ freezegun
++rpm
+--
+2.21.1
+
diff --git a/0008-Repair-test-of-retire-command-after-rpkg-update.patch b/0008-Repair-test-of-retire-command-after-rpkg-update.patch
new file mode 100644
index 0000000..fdeade4
--- /dev/null
+++ b/0008-Repair-test-of-retire-command-after-rpkg-update.patch
@@ -0,0 +1,26 @@
+From 58533b8fb6e1eb7daa938ef2bc2b8a3d778469de Mon Sep 17 00:00:00 2001
+From: Ondrej Nosek <onosek@redhat.com>
+Date: Wed, 25 Mar 2020 23:27:39 +0100
+Subject: [PATCH 1/3] Repair test of "retire" command after rpkg update
+
+Signed-off-by: Ondrej Nosek <onosek@redhat.com>
+---
+ test/test_retire.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/test_retire.py b/test/test_retire.py
+index 153dbc9..f6b40cc 100644
+--- a/test/test_retire.py
++++ b/test/test_retire.py
+@@ -105,7 +105,7 @@ class RetireTestCase(unittest.TestCase):
+ client.log = mock.Mock()
+ client.retire()
+ args, kwargs = client.log.warn.call_args
+- self.assertIn('dead.package found, package probably already retired',
++ self.assertIn('dead.package found, package or module is already retired',
+ args[0])
+
+ @mock.patch(
+--
+2.21.1
+
diff --git a/0009-Body-changes-for-requesting-new-test-repo.patch b/0009-Body-changes-for-requesting-new-test-repo.patch
new file mode 100644
index 0000000..83971b0
--- /dev/null
+++ b/0009-Body-changes-for-requesting-new-test-repo.patch
@@ -0,0 +1,74 @@
+From 5672d905e430dc599c4e1a9b2a3c447c225f63ab Mon Sep 17 00:00:00 2001
+From: Ondrej Nosek <onosek@redhat.com>
+Date: Wed, 25 Mar 2020 18:08:03 +0100
+Subject: [PATCH 1/2] Body changes for requesting new test repo
+
+Adds new fields 'bug_id' (optional) and 'monitor' (fixed)
+
+Relates: https://pagure.io/fedscm-admin/issue/22
+
+Signed-off-by: Ondrej Nosek <onosek@redhat.com>
+---
+ fedpkg/cli.py | 8 +++++++-
+ test/test_cli.py | 4 +++-
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/fedpkg/cli.py b/fedpkg/cli.py
+index e2291ff..c43fcff 100644
+--- a/fedpkg/cli.py
++++ b/fedpkg/cli.py
+@@ -359,6 +359,9 @@ class fedpkgClient(cliClient):
+ request_tests_repo_parser.add_argument(
+ 'description',
+ help='Description of the tests repository')
++ request_tests_repo_parser.add_argument(
++ '--bug', type=int,
++ help='Bugzilla bug ID of the package review request.')
+ request_tests_repo_parser.set_defaults(command=self.request_tests_repo)
+
+ def register_request_branch(self):
+@@ -801,6 +804,7 @@ class fedpkgClient(cliClient):
+ repo_name=self.args.name,
+ ns='tests',
+ description=self.args.description,
++ bug=self.args.bug,
+ name=self.name,
+ config=self.config,
+ anongiturl=self.cmd.anongiturl
+@@ -862,7 +866,7 @@ class fedpkgClient(cliClient):
+ .format(repo_name))
+
+ summary_from_bug = ''
+- if bug and ns not in ['tests', 'modules', 'flatpaks']:
++ if bug and ns not in ['modules', 'flatpaks']:
+ bz_url = config.get('{0}.bugzilla'.format(name), 'url')
+ bz_client = BugzillaClient(bz_url)
+ bug_obj = bz_client.get_review_bug(bug, ns, repo_name)
+@@ -875,6 +879,8 @@ class fedpkgClient(cliClient):
+ ticket_body = {
+ 'action': 'new_repo',
+ 'branch': 'master',
++ 'bug_id': bug or '',
++ 'monitor': 'no-monitoring',
+ 'namespace': 'tests',
+ 'repo': repo_name,
+ 'description': description,
+diff --git a/test/test_cli.py b/test/test_cli.py
+index e78edc7..c25f6bb 100644
+--- a/test/test_cli.py
++++ b/test/test_cli.py
+@@ -1452,8 +1452,10 @@ class TestRequestTestsRepo(CliTestCase):
+ expected_issue_content = {
+ 'action': 'new_repo',
+ 'branch': 'master',
+- 'repo': 'foo',
++ 'bug_id': '',
++ 'monitor': 'no-monitoring',
+ 'namespace': 'tests',
++ 'repo': 'foo',
+ 'description': 'Some description'
+ }
+
+--
+2.21.1
+
diff --git a/0010-Check-missing-config-options-more-reliably.patch b/0010-Check-missing-config-options-more-reliably.patch
new file mode 100644
index 0000000..ca85f3a
--- /dev/null
+++ b/0010-Check-missing-config-options-more-reliably.patch
@@ -0,0 +1,284 @@
+From dcfdb9f532be3a05971982726d70d357bd2b7760 Mon Sep 17 00:00:00 2001
+From: Ondrej Nosek <onosek@redhat.com>
+Date: Mon, 30 Mar 2020 04:01:52 +0200
+Subject: [PATCH] Check missing config options more reliably
+
+User's config file is not always updated with freshly added config
+options in fedpkg release. The reason could be the user's own changes
+in the config file prior to the upgrade. It needs user's action
+and this fix provides a hint when this problem is detected.
+
+Resolves: rhbz#1813338
+JIRA: COMPOSE-4228
+
+Signed-off-by: Ondrej Nosek <onosek@redhat.com>
+---
+ conf/etc/rpkg/fedpkg.conf | 1 +
+ fedpkg/cli.py | 42 +++++++++++++----------
+ fedpkg/utils.py | 72 ++++++++++++++++++++++-----------------
+ test/test_utils.py | 15 ++++----
+ 4 files changed, 74 insertions(+), 56 deletions(-)
+
+diff --git a/conf/etc/rpkg/fedpkg.conf b/conf/etc/rpkg/fedpkg.conf
+index 0809aef..e3089bc 100644
+--- a/conf/etc/rpkg/fedpkg.conf
++++ b/conf/etc/rpkg/fedpkg.conf
+@@ -69,6 +69,7 @@ url = https://bugzilla.redhat.com/
+
+ [fedpkg.pagure]
+ url = https://pagure.io/
++token =
+
+ [fedpkg.pdc]
+ url = https://pdc.fedoraproject.org/
+diff --git a/fedpkg/cli.py b/fedpkg/cli.py
+index c43fcff..452026b 100644
+--- a/fedpkg/cli.py
++++ b/fedpkg/cli.py
+@@ -30,11 +30,10 @@ from six.moves.urllib_parse import urlparse
+
+ from fedpkg.bugzilla import BugzillaClient
+ from fedpkg.utils import (assert_new_tests_repo, assert_valid_epel_package,
+- do_fork, expand_release, get_dist_git_url,
+- get_distgit_token, get_fedora_release_state,
+- get_pagure_token, get_release_branches,
+- get_stream_branches, is_epel, new_pagure_issue,
+- sl_list_to_dict, verify_sls)
++ config_get_safely, do_fork, expand_release,
++ get_dist_git_url, get_fedora_release_state,
++ get_release_branches, get_stream_branches, is_epel,
++ new_pagure_issue, sl_list_to_dict, verify_sls)
+ from pyrpkg import rpkgError
+ from pyrpkg.cli import cliClient
+
+@@ -256,6 +255,9 @@ class fedpkgClient(cliClient):
+
+ def register_request_repo(self):
+ help_msg = 'Request a new dist-git repository'
++ pagure_section = '{0}.pagure'.format(self.name)
++ pagure_url = config_get_safely(self.config, pagure_section, 'url')
++ pagure_url_parsed = urlparse(pagure_url).netloc
+ description = textwrap.dedent('''
+ Request a new dist-git repository
+
+@@ -275,8 +277,7 @@ class fedpkgClient(cliClient):
+ Another example to request a module foo:
+
+ fedpkg request-repo --namespace modules foo
+- '''.format(self.name, urlparse(self.config.get(
+- '{0}.pagure'.format(self.name), 'url')).netloc))
++ '''.format(self.name, pagure_url_parsed))
+
+ request_repo_parser = self.subparsers.add_parser(
+ 'request-repo',
+@@ -322,8 +323,9 @@ class fedpkgClient(cliClient):
+
+ def register_request_tests_repo(self):
+ help_msg = 'Request a new tests dist-git repository'
+- pagure_url = urlparse(self.config.get(
+- '{0}.pagure'.format(self.name), 'url')).netloc
++ pagure_section = '{0}.pagure'.format(self.name)
++ pagure_url = config_get_safely(self.config, pagure_section, 'url')
++ pagure_url_parsed = urlparse(pagure_url).netloc
+ anongiturl = self.config.get(
+ self.name, 'anongiturl', vars={'repo': 'any', 'module': 'any'}
+ )
+@@ -346,7 +348,7 @@ class fedpkgClient(cliClient):
+
+ Note that the space name needs to reflect the intent of the tests and will
+ undergo a manual review.
+- '''.format(self.name, pagure_url, get_dist_git_url(anongiturl)))
++ '''.format(self.name, pagure_url_parsed, get_dist_git_url(anongiturl)))
+
+ request_tests_repo_parser = self.subparsers.add_parser(
+ 'request-tests-repo',
+@@ -441,6 +443,8 @@ class fedpkgClient(cliClient):
+
+ def register_do_fork(self):
+ help_msg = 'Create a new fork of the current repository'
++ distgit_section = '{0}.distgit'.format(self.name)
++ distgit_api_base_url = config_get_safely(self.config, distgit_section, "apibaseurl")
+ description = textwrap.dedent('''
+ Create a new fork of the current repository
+
+@@ -460,8 +464,7 @@ class fedpkgClient(cliClient):
+ username is taken. It could be overridden by reusing an argument:
+
+ {0} --user FAS_ID fork
+- '''.format(self.name, urlparse(self.config.get(
+- '{0}.distgit'.format(self.name), 'apibaseurl')).netloc))
++ '''.format(self.name, urlparse(distgit_api_base_url).netloc))
+
+ fork_parser = self.subparsers.add_parser(
+ 'fork',
+@@ -905,8 +908,9 @@ class fedpkgClient(cliClient):
+ ticket_body = '```\n{0}\n```'.format(ticket_body)
+ ticket_title = 'New Repo for "{0}/{1}"'.format(ns, repo_name)
+
+- pagure_url = config.get('{0}.pagure'.format(name), 'url')
+- pagure_token = get_pagure_token(config, name)
++ pagure_section = '{0}.pagure'.format(name)
++ pagure_url = config_get_safely(config, pagure_section, 'url')
++ pagure_token = config_get_safely(config, pagure_section, 'token')
+ print(new_pagure_issue(
+ pagure_url, pagure_token, ticket_title, ticket_body, name))
+
+@@ -1024,8 +1028,9 @@ class fedpkgClient(cliClient):
+ sl_dict = sl_list_to_dict(service_levels)
+ verify_sls(pdc_url, sl_dict)
+
+- pagure_url = config.get('{0}.pagure'.format(name), 'url')
+- pagure_token = get_pagure_token(config, name)
++ pagure_section = '{0}.pagure'.format(name)
++ pagure_url = config_get_safely(config, pagure_section, 'url')
++ pagure_token = config_get_safely(config, pagure_section, 'token')
+ if all_releases:
+ release_branches = list(itertools.chain(
+ *list(get_release_branches(pdc_url).values())))
+@@ -1097,13 +1102,14 @@ class fedpkgClient(cliClient):
+
+ def do_distgit_fork(self):
+ """create fork of the distgit repository"""
+- distgit_api_base_url = self.config.get('{0}.distgit'.format(self.name), "apibaseurl")
++ distgit_section = '{0}.distgit'.format(self.name)
++ distgit_api_base_url = config_get_safely(self.config, distgit_section, "apibaseurl")
+ distgit_remote_base_url = self.config.get(
+ '{0}'.format(self.name),
+ "gitbaseurl",
+ vars={'user': 'any', 'repo': 'any'},
+ )
+- distgit_token = get_distgit_token(self.config, self.name)
++ distgit_token = config_get_safely(self.config, distgit_section, 'token')
+
+ fork_url = do_fork(
+ base_url=distgit_api_base_url,
+diff --git a/fedpkg/utils.py b/fedpkg/utils.py
+index 3a1c04d..b639c4f 100644
+--- a/fedpkg/utils.py
++++ b/fedpkg/utils.py
+@@ -292,38 +292,6 @@ def verify_sls(pdc_url, sl_dict):
+ raise rpkgError('The SL "{0}" is not in PDC'.format(sl))
+
+
+-def get_pagure_token(config, cli_name):
+- """
+- Gets the Pagure token configured in the user's configuration file
+- :param config: ConfigParser object
+- :param cli_name: string of the CLI's name (e.g. fedpkg)
+- :return: string of the Pagure token
+- """
+- conf_section = '{0}.pagure'.format(cli_name)
+- try:
+- return config.get(conf_section, 'token')
+- except (NoSectionError, NoOptionError):
+- raise rpkgError(
+- 'Missing a Pagure token. Refer to the help of the current command '
+- '(-h/--help)" to set a token in your user configuration.')
+-
+-
+-def get_distgit_token(config, cli_name):
+- """
+- Gets the distgit token configured in the user's configuration file
+- :param config: ConfigParser object
+- :param cli_name: string of the CLI's name (e.g. fedpkg)
+- :return: string of the distgit token
+- """
+- conf_section = '{0}.distgit'.format(cli_name)
+- try:
+- return config.get(conf_section, 'token')
+- except (NoSectionError, NoOptionError):
+- raise rpkgError(
+- 'Missing a distgit token. Refer to the help of the current command '
+- '(-h/--help)" to set a token in your user configuration.')
+-
+-
+ def is_epel(branch):
+ """
+ Determines if this is or will be an epel branch
+@@ -524,3 +492,43 @@ def get_fedora_release_state(config, cli_name, release):
+ raise rpkgError(base_error_msg.format(rv.text))
+
+ return rv.json().get('state')
++
++
++def config_get_safely(config, section, option):
++ """
++ Returns option from the user's configuration file. In case of missing
++ section or option method throws an exception with a human-readable
++ warning and a possible hint.
++ The method should be used especially in situations when there are newly
++ added sections/options into the config. In this case, there is a risk that
++ the user's config wasn't properly upgraded.
++
++ :param config: ConfigParser object
++ :param section: section name in the config
++ :param option: name of the option
++ :return: option value from the right section
++ :rtype: str
++ """
++
++ hint = (
++ "First (if possible), refer to the help of the current command "
++ "(-h/--help).\n"
++ "There also might be a new version of the config after upgrade.\n"
++ "Hint: you can check if you have 'fedpkg.conf.rpmnew' or "
++ "'fedpkg.conf.rpmsave' in the config directory. If yes, try to merge "
++ "your changes to the config with the maintainer provided version "
++ "(or replace fedpkg.conf file with 'fedpkg.conf.rpmnew')."
++ )
++
++ try:
++ return config.get(section, option)
++ except NoSectionError:
++ msg = "Missing section '{0}' in the config file.".format(section)
++ raise rpkgError("{0}\n{1}".format(msg, hint))
++ except NoOptionError:
++ msg = "Missing option '{0}' in the section '{1}' of the config file.".format(
++ option, section
++ )
++ raise rpkgError("{0}\n{1}".format(msg, hint))
++ except Exception:
++ raise
+diff --git a/test/test_utils.py b/test/test_utils.py
+index f7db2e4..904b3cb 100644
+--- a/test/test_utils.py
++++ b/test/test_utils.py
+@@ -177,13 +177,13 @@ class TestAssertNewTestsRepo(unittest.TestCase):
+
+
+ class TestGetPagureToken(unittest.TestCase):
+- """Test get_pagure_token"""
++ """Test obtaining of Pagure token"""
+
+ def test_return_token(self):
+ config = Mock()
+ config.get.return_value = '123456'
+
+- token = utils.get_pagure_token(config, 'fedpkg')
++ token = utils.config_get_safely(config, 'fedpkg.pagure', 'token')
+
+ self.assertEqual('123456', token)
+ config.get.assert_called_once_with('fedpkg.pagure', 'token')
+@@ -192,12 +192,15 @@ class TestGetPagureToken(unittest.TestCase):
+ config = Mock()
+
+ config.get.side_effect = NoOptionError('token', 'fedpkg.pagure')
+- six.assertRaisesRegex(self, rpkgError, 'Missing a Pagure token',
+- utils.get_pagure_token, config, 'fedpkg')
++ six.assertRaisesRegex(self,
++ rpkgError, "Missing option 'token' in the section 'fedpkg.pagure'",
++ utils.config_get_safely,
++ config,
++ 'fedpkg.pagure', 'token')
+
+ config.get.side_effect = NoSectionError('fedpkg.pagure')
+- six.assertRaisesRegex(self, rpkgError, 'Missing a Pagure token',
+- utils.get_pagure_token, config, 'fedpkg')
++ six.assertRaisesRegex(self, rpkgError, "Missing section 'fedpkg.pagure'",
++ utils.config_get_safely, config, 'fedpkg.pagure', 'token')
+
+
+ @patch('requests.get')
+--
+2.21.1
+
diff --git a/fedpkg.spec b/fedpkg.spec
index ce861b8..6cf42d9 100644
--- a/fedpkg.spec
+++ b/fedpkg.spec
@@ -4,8 +4,8 @@
%endif
Name: fedpkg
-Version: 1.37
-Release: 5%{?dist}.1
+Version: 1.38
+Release: 3%{?dist}
Summary: Fedora utility for working with dist-git
License: GPLv2+
@@ -13,12 +13,14 @@ URL: https://pagure.io/fedpkg
Source0: https://pagure.io/releases/fedpkg/%{name}-%{version}.tar.bz2
BuildArch: noarch
-Patch0: 0001-Bump-check-for-bodhi-client.patch
-Patch1: 0002-Support-for-epel-playground-branch-requests.patch
-Patch2: 0003-Allow-epel-playground-requests-for-epel8-and-newer.patch
+Patch1: 0006-display_name-added-to-bodhi.template.patch
+Patch2: 0007-Move-rpm-dependency-for-test-environment-only.patch
+Patch3: 0008-Repair-test-of-retire-command-after-rpkg-update.patch
+Patch4: 0009-Body-changes-for-requesting-new-test-repo.patch
+Patch5: 0010-Check-missing-config-options-more-reliably.patch
# fedpkg command switched to python3 on Fedora 29 and RHEL > 7:
-%if 0%{?fedora} > 28 || 0%{?rhel} > 7
+%if 0%{?fedora} || 0%{?rhel} > 7
%bcond_with python2
%else
%bcond_without python2
@@ -38,7 +40,7 @@ Requires: redhat-rpm-config
BuildRequires: python2-devel
# We br these things for man page generation due to imports
-BuildRequires: python2-rpkg >= 1.58-5
+BuildRequires: python2-rpkg >= 1.59-5
BuildRequires: python2-distro
# This until fedora-cert gets fixed
BuildRequires: python2-fedora
@@ -71,23 +73,23 @@ BuildRequires: python2-bugzilla
Requires: python2-bugzilla
%endif
-Requires: python2-rpkg >= 1.58-5
+Requires: python2-rpkg >= 1.59-5
Requires: python2-distro
Requires: python2-fedora
Requires: python2-openidc-client >= 0.6.0
-%else # python3
+# python3
+%else
# This package redefines __python and can use the python_ macros
%global __python %{__python3}
BuildRequires: python3-devel
-BuildRequires: python3-rpkg >= 1.58-5
+BuildRequires: python3-rpkg >= 1.59-5
BuildRequires: python3-distro
# This until fedora-cert gets fixed
BuildRequires: python3-fedora
# For testing
BuildRequires: python3-mock
-BuildRequires: python3-unittest2
BuildRequires: python3-nose
BuildRequires: python3-setuptools
BuildRequires: python3-bugzilla
@@ -96,7 +98,7 @@ BuildRequires: python3-bodhi-client
Requires: python3-bugzilla
-Requires: python3-rpkg >= 1.58-5
+Requires: python3-rpkg >= 1.59-5
Requires: python3-distro
Requires: python3-fedora
Requires: python3-openidc-client >= 0.6.0
@@ -166,9 +168,72 @@ nosetests
%changelog
-* Thu Jul 25 2019 Stephen Smoogen <smooge@fedoraproject.org> - 1.37-5.1
-- Merge with master. Update to work with RHEL8
-
+* Mon Mar 30 2020 Ondřej Nosek <onosek@redhat.com> - 1.38-3
+ Patches:
+ - Repair test of "retire" command after rpkg update
+ - Body changes for requesting new test repo
+ - Check missing config options more reliably
+
+* Fri Mar 06 2020 Ondřej Nosek <onosek@redhat.com> - 1.38-2
+- Patch: Move rpm dependency for test environment only
+
+* Mon Mar 02 2020 Ondřej Nosek <onosek@redhat.com> - 1.38-1
+- Removes check of bodhi-client version - rhbz#1796972 (onosek)
+- Clone config customization for namespaces (onosek)
+- Repair Jenkins tests (onosek)
+- Update bash completion with side tag commands (lsedlar)
+- add --fail-fast to bash-completion (cheese)
+- Improve coding style by sorting imports (onosek)
+- Repair tests for previous commits (onosek)
+- Create fork of the active repository - #276 (onosek)
+- request-tests-repo: add branch into ticket body - #359 (onosek)
+- verrel command on master asks Koji first - #357 (onosek)
+- Check nvr before build - #356 (onosek)
+- Change dist tag for epel8-playground (onosek)
+- Add test for retiring on archived release (lsedlar)
+- Mock requests in all tests (lsedlar)
+- Line up descriptions for better code readability (onosek)
+- Clarify request-branch 'service levels' argument - #283 (onosek)
+- Resolve Jenkins unittests failing (onosek)
+- utils: fix whitespace in Pagure error message (kdreyer)
+- New options for bodhi template - 459 (onosek)
+- Block retiring in released branches - #337 (onosek)
+- Use package.cfg for epel8+ branches (mboddu)
+- Add epel*-playground into rpmdefines (smooge)
+- linux_distribution import moved (onosek)
+- Unittests for epel*-playground branch requests (onosek)
+- Allow epel*-playground requests for epel8 and newer (onosek)
+- Support for epel*-playground branch requests - #334 (mboddu)
+- git-changelog: Fix running on Python 3 (onosek)
+- Avoid warning about invalid escape with python3.8 (zbyszek)
+- Tests for update stable karma - #321 (cqi)
+- Bump check for bodhi client - 330 (lsedlar)
+- Ignore files in a cloned repository - patterns update (onosek)
+
+* Mon Feb 03 2020 Ondřej Nosek <onosek@redhat.com> - 1.37-13
+- Patch: Removes check of bodhi-client version
+
+* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.37-12
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
+
+* Fri Nov 08 2019 Miro Hrončok <mhroncok@redhat.com> - 1.37-11
+- Drop unneeded build dependency on python3-unittest2
+
+* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.37-10
+- Rebuilt for Python 3.8.0rc1 (#1748018)
+
+* Wed Aug 21 2019 Ondřej Nosek <onosek@redhat.com> - 1.37-9
+- Backport: display_name added to bodhi.template
+
+* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.37-8
+- Rebuilt for Python 3.8
+
+* Fri Aug 02 2019 Ondřej Nosek <onosek@redhat.com> - 1.37-7
+- Require python*-rpkg-1.58-8 as minimum version
+
+* Thu Aug 01 2019 Ondřej Nosek <onosek@redhat.com> - 1.37-6
+- Backport: Add epel*-playground into rpmdefines
+- Backport: Use package.cfg for epel8+ branches
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.37-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
diff --git a/sources b/sources
index 6e185d8..d78c737 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (fedpkg-1.37.tar.bz2) = 74dbd810a4d192a91ace8caec5e662437a26d0a24440b61a950273543525d13552f8acacd5ed8eced6df642ea7cd75a80a80d39d7ac9648f028438f0f1663479
+SHA512 (fedpkg-1.38.tar.bz2) = 07b6cd28dc4a44cca5b16b1b2016175f61a617cbba5677a41ba2c50fa8d7c86199d60a3092b3566a9bf4dda3313cf367fcda58fe0db7ff1a2867210df8ab35d3
diff --git a/0001-fedpkg-request-use-pdc-active-releases.patch b/0001-fedpkg-request-use-pdc-active-releases.patch
new file mode 100644
index 0000000..39b6efb
--- /dev/null
+++ b/0001-fedpkg-request-use-pdc-active-releases.patch
@@ -0,0 +1,189 @@
+From 00aed529cf22796fdae0d23f844221df640cc7c2 Mon Sep 17 00:00:00 2001
+From: mprahl <mprahl@redhat.com>
+Date: Feb 23 2018 03:01:35 +0000
+Subject: Use PDC instead of Bodhi to get the active release branches
+
+
+Fixes #187
+
+Signed-off-by: mprahl <mprahl@redhat.com>
+
+---
+
+diff --git a/fedpkg/cli.py b/fedpkg/cli.py
+index a203b91..e8ff6be 100644
+--- a/fedpkg/cli.py
++++ b/fedpkg/cli.py
+@@ -462,7 +462,7 @@ suggest_reboot=False
+ raise rpkgError('You must specify a branch if you are not in '
+ 'a git repository')
+
+- bodhi_url = config.get('{0}.bodhi'.format(name), 'url')
++ pdc_url = config.get('{0}.pdc'.format(name), 'url')
+ if branch:
+ if is_epel(branch):
+ assert_valid_epel_package(module_name, branch)
+@@ -474,7 +474,7 @@ suggest_reboot=False
+ 'Only characters, numbers, periods, dashes, '
+ 'underscores, and pluses are allowed in module branch '
+ 'names')
+- release_branches = get_release_branches(bodhi_url)
++ release_branches = get_release_branches(pdc_url)
+ if branch in release_branches:
+ if service_levels:
+ raise rpkgError(
+@@ -489,14 +489,13 @@ suggest_reboot=False
+
+ # If service levels were provided, verify them
+ if service_levels:
+- pdc_url = config.get('{0}.pdc'.format(name), 'url')
+ sl_dict = sl_list_to_dict(service_levels)
+ verify_sls(pdc_url, sl_dict)
+
+ pagure_url = config.get('{0}.pagure'.format(name), 'url')
+ pagure_token = get_pagure_token(config, name)
+ if all_releases:
+- release_branches = get_release_branches(bodhi_url)
++ release_branches = get_release_branches(pdc_url)
+ branches = [b for b in release_branches
+ if re.match(r'^(f\d+)$', b)]
+ else:
+diff --git a/fedpkg/utils.py b/fedpkg/utils.py
+index d241308..b3d704c 100644
+--- a/fedpkg/utils.py
++++ b/fedpkg/utils.py
+@@ -18,7 +18,6 @@ from six.moves.urllib.parse import urlencode
+ from six.moves.configparser import NoSectionError, NoOptionError
+ import requests
+ from requests.exceptions import ConnectionError
+-from fedora.client.bodhi import Bodhi2Client
+ from pyrpkg import rpkgError
+
+
+@@ -97,26 +96,55 @@ def new_pagure_issue(url, token, title, body):
+ url.rstrip('/'), rv.json()['issue']['id'])
+
+
+-def get_release_branches(bodhi_url):
++def get_release_branches(url):
+ """
+- Get the active Fedora release branches from Bodhi
+- :param bodhi_url: a string of the URL to Bodhi
++ Get the active Fedora release branches from PDC
++ :param url: a string of the URL to PDC
+ :return: a set containing the active Fedora release branches
+ """
+- bodhi = Bodhi2Client(bodhi_url)
+ branches = set()
+- page = 1
++ api_url = '{0}/rest_api/v1/product-versions/'.format(url.rstrip('/'))
++ query_args = {
++ 'fields': ['short', 'version'],
++ 'active': True
++ }
+ while True:
+- rv = bodhi.send_request('releases', auth=False, params={'page': page})
+- for release in rv['releases']:
+- if release['state'] == 'current':
+- branches.add(release['branch'])
+- if page < rv['pages']:
+- page += 1
+- else:
+- break
++ try:
++ rv = requests.get(api_url, params=query_args, timeout=60)
++ except ConnectionError as error:
++ error_msg = ('The connection to PDC failed while trying to get '
++ 'the active release branches. The error was: {0}'
++ .format(str(error)))
++ raise rpkgError(error_msg)
+
+- return branches
++ if not rv.ok:
++ base_error_msg = ('The following error occurred while trying to '
++ 'get the active release branches in PDC: {0}')
++ raise rpkgError(base_error_msg.format(rv.text))
++
++ rv_json = rv.json()
++ for product_version in rv_json['results']:
++ # If the version is not a digit we can ignore it (e.g. rawhide)
++ if not product_version['version'].isdigit():
++ continue
++
++ if product_version['short'] == 'epel':
++ prefix = 'epel'
++ if product_version['version'] == '6':
++ prefix = 'el'
++ branches.add('{0}{1}'.format(
++ prefix, product_version['version']))
++ elif product_version['short'] == 'fedora':
++ branches.add('f{0}'.format(product_version['version']))
++
++ if rv_json['next']:
++ # Clear the query_args because they are baked into the "next" URL
++ query_args = {}
++ api_url = rv_json['next']
++ else:
++ # We've gone through every page, so we can return the found
++ # branches
++ return branches
+
+
+ def sl_list_to_dict(sls):
+diff --git a/test/test_utils.py b/test/test_utils.py
+index cff22bd..7ca395f 100644
+--- a/test/test_utils.py
++++ b/test/test_utils.py
+@@ -115,29 +115,29 @@ class TestUtils(CliTestCase):
+ assert str(e) == ('The SL "{0}" must expire on June 1st or '
+ 'December 1st'.format(eol))
+
+- @patch('fedpkg.utils.Bodhi2Client')
+- def test_get_release_branches(self, mock_bodhi):
++ @patch('requests.get')
++ def test_get_release_branches(self, mock_request_get):
+ """Test that get_release_branches returns all the active Fedora release
+ branches.
+ """
+- mock_bodhi_client = Mock()
+- mock_bodhi_client.send_request.return_value = {
+- u'page': 1,
+- u'pages': 1,
+- u'releases': [
+- {'state': 'current', 'branch': 'el6'},
+- {'state': 'archived', 'branch': 'f24'},
+- {'state': 'current', 'branch': 'epel7'},
+- {'state': 'current', 'branch': 'f25'},
+- {'state': 'archived', 'branch': 'el5'},
+- {'state': 'archived', 'branch': 'f23'},
+- {'state': 'current', 'branch': 'f26'},
+- {'state': 'pending', 'branch': 'f27m'},
+- {'state': 'current', 'branch': 'f27'}
+- ],
+- u'rows_per_page': 20,
+- u'total': 11}
+- mock_bodhi.return_value = mock_bodhi_client
+- expected = set(['el6', 'epel7', 'f25', 'f26', 'f27'])
+- actual = utils.get_release_branches('http://bodhi.local')
++ mock_rv = Mock()
++ mock_rv.ok = True
++ # This abbreviated data returned from the product-versions PDC API
++ mock_rv.json.return_value = {
++ 'count': 7,
++ 'next': None,
++ 'previous': None,
++ 'results': [
++ {'short': 'epel', 'version': '6'},
++ {'short': 'epel', 'version': '7'},
++ {'short': 'fedora', 'version': '25'},
++ {'short': 'fedora', 'version': '26'},
++ {'short': 'fedora', 'version': '27'},
++ {'short': 'fedora', 'version': '28'},
++ {'short': 'fedora', 'version': 'rawhide'}
++ ]
++ }
++ mock_request_get.return_value = mock_rv
++ expected = set(['el6', 'epel7', 'f25', 'f26', 'f27', 'f28'])
++ actual = utils.get_release_branches('http://pdc.local')
+ self.assertEqual(expected, actual)
+
reply other threads:[~2026-08-10 21:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178639835286.1.18369026177357662986.rpms-fedpkg-e65149be0400@fedoraproject.org \
--to=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox