From f0c83ad0408a243870a61095d83a8561c55f6796 Mon Sep 17 00:00:00 2001 From: Owen W. Taylor Date: Jan 11 2019 01:26:58 +0000 Subject: Add support for a 'flatpaks' namespace flatpaks/ will be added as a separate namespace in Fedora distgit - see: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/LOLYI2FHGCVJ7EKC6NB3CZ3ACBRKQFCK/ The handling will be like modules/ - where flatpaks are currently: - No bugzilla bug is required for repository creation - Branch names must be valid module stream names --- diff --git a/fedscm_admin/utils.py b/fedscm_admin/utils.py index d1c75d6..f714a94 100644 --- a/fedscm_admin/utils.py +++ b/fedscm_admin/utils.py @@ -247,11 +247,14 @@ def process_ticket(issue, force=False, auto_approve=False): except ValidationError: # pragma: no cover pass - if 'branch' in issue_body and 'namespace' in issue_body \ - and issue_body['namespace'] in ['modules', 'test-modules'] \ - and not valid_module_stream_name(issue_body['branch']): - error_msg = ('Only characters, numbers, periods, dashes, underscores, ' - 'and pluses are allowed in module branch names') + if 'branch' in issue_body and 'namespace' in issue_body: + branch = issue_body['branch'] + ns = issue_body['namespace'] + if ns in ['modules', 'test-modules', 'flatpaks'] \ + and not valid_module_stream_name(branch): + error_msg = ('Only characters, numbers, periods, dashes, underscores, ' + 'and pluses are allowed in {} branch names' + .format('flatpak' if ns == 'flatpaks' else 'module')) prompt_to_close_bad_ticket(issue_body, error_msg) return @@ -312,7 +315,7 @@ def prompt_for_new_repo(issue_json, issue_body_json, force=False, prompt_to_close_bad_ticket(issue_json, error) return - if force or exception is True or namespace == 'modules': + if force or exception is True or namespace in ('modules', 'flatpaks'): skip_msg = '- Skipping verification of RHBZ' if bug_id: skip_msg = '{0} #{1}'.format(skip_msg, bug_id)