From a2589473000a7617f92d1cd052c8ea188cb30d96 Mon Sep 17 00:00:00 2001 From: Rafael Santos Date: Apr 14 2018 19:09:09 +0000 Subject: Allow requesting modular repositories without bug ID Fixes #197 New modules won't require a formal review anymore. Signed-off-by: Rafael Santos --- diff --git a/fedpkg/cli.py b/fedpkg/cli.py index 23945ff..ff7f18d 100644 --- a/fedpkg/cli.py +++ b/fedpkg/cli.py @@ -111,7 +111,8 @@ the package foo: description=description) request_repo_parser.add_argument( 'bug', nargs='?', type=int, - help='Bugzilla bug ID of the package review request') + help='Bugzilla bug ID of the package review request. ' + 'Not required for requesting a module repository') request_repo_parser.add_argument( '--description', '-d', help='The repo\'s description in dist-git') monitoring_choices = [ @@ -407,7 +408,8 @@ suggest_reboot=False # bug is not a required parameter in the event the packager has an # exception, in which case, they may use the --exception flag - if not bug and not exception and ns != 'tests': + # neither in case of modules, which don't require a formal review + if not bug and not exception and ns not in ['tests', 'modules']: raise rpkgError( 'A Bugzilla bug is required on new repository requests') repo_regex = r'^[a-zA-Z0-9_][a-zA-Z0-9-_.+]*$' @@ -420,7 +422,7 @@ suggest_reboot=False .format(module_name)) summary_from_bug = '' - if bug and ns != 'tests': + if bug and ns not in ['tests', 'modules']: bz_url = config.get('{0}.bugzilla'.format(name), 'url') bz_client = BugzillaClient(bz_url) bug_obj = bz_client.get_review_bug(bug, ns, module_name) diff --git a/test/test_cli.py b/test/test_cli.py index b991dd4..e66be09 100644 --- a/test/test_cli.py +++ b/test/test_cli.py @@ -326,22 +326,20 @@ class TestRequestRepo(CliTestCase): mock_request_post.return_value = mock_rv cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path, - '--module-name', 'modules/nethack', 'request-repo', - '1441813'] + '--module-name', 'modules/nethack', 'request-repo'] cli = self.get_cli(cli_cmd) cli.request_repo() expected_issue_content = { 'action': 'new_repo', 'branch': 'master', - 'bug_id': 1441813, + 'bug_id': '', 'description': '', 'exception': False, 'monitor': 'monitoring', 'namespace': 'modules', 'repo': 'nethack', - 'summary': ('A rogue-like single player dungeon exploration ' - 'game'), + 'summary': (''), 'upstreamurl': '' } # Get the data that was submitted to Pagure