| |
@@ -453,6 +453,10 @@
|
| |
'branch argument has to be placed before --sl.')
|
| |
)
|
| |
request_branch_parser.add_argument(
|
| |
+ '--dry-run', default=False, action='store_true',
|
| |
+ help='Don\'t create Pagure issue, just perform eligibility checks'
|
| |
+ )
|
| |
+ request_branch_parser.add_argument(
|
| |
'--no-git-branch', default=False, action='store_true',
|
| |
help='Don\'t create the branch in git but still create it in PDC'
|
| |
)
|
| |
@@ -1043,6 +1047,7 @@
|
| |
active_branch=active_branch,
|
| |
repo_name=self.cmd.repo_name,
|
| |
ns=self.cmd.ns,
|
| |
+ dry_run=self.args.dry_run,
|
| |
no_git_branch=self.args.no_git_branch,
|
| |
no_auto_module=self.args.no_auto_module,
|
| |
name=self.name,
|
| |
@@ -1051,7 +1056,7 @@
|
| |
|
| |
@staticmethod
|
| |
def _request_branch(logger, service_levels, all_releases, branch,
|
| |
- active_branch, repo_name, ns, no_git_branch,
|
| |
+ active_branch, repo_name, ns, dry_run, no_git_branch,
|
| |
no_auto_module, name, config):
|
| |
""" Implementation of `request_branch`.
|
| |
|
| |
@@ -1069,6 +1074,8 @@
|
| |
value of `self.cmd.repo_name`.
|
| |
:param ns: The repository namespace string, i.e. 'rpms' or 'modules'.
|
| |
Typically takes the value of `self.cmd.ns`.
|
| |
+ :param dry_run: A boolean flag. If True, no branch is actually created,
|
| |
+ but all eligibility checks are performed.
|
| |
:param no_git_branch: A boolean flag. If True, the SCM admins should
|
| |
create the git branch in PDC, but not in pagure.io.
|
| |
:param no_auto_module: A boolean flag. If True, requests for
|
| |
@@ -1163,9 +1170,14 @@
|
| |
ticket_title = 'New Branch "{0}" for "{1}/{2}"'.format(
|
| |
b, ns, repo_name)
|
| |
|
| |
- print(new_pagure_issue(
|
| |
- logger, pagure_url, pagure_token, ticket_title, ticket_body,
|
| |
- name))
|
| |
+ if dry_run:
|
| |
+ print('Would have filed: {0}'.format(ticket_title))
|
| |
+ print(ticket_body)
|
| |
+ print()
|
| |
+ else:
|
| |
+ print(new_pagure_issue(
|
| |
+ logger, pagure_url, pagure_token, ticket_title, ticket_body,
|
| |
+ name))
|
| |
|
| |
# For non-standard rpm branch requests, also request a matching new
|
| |
# module repo with a matching branch.
|
| |
@@ -1179,33 +1191,38 @@
|
| |
if auto_module:
|
| |
summary = ('Automatically requested module for '
|
| |
'rpms/%s:%s.' % (repo_name, b))
|
| |
- fedpkgClient._request_repo(
|
| |
- logger=logger,
|
| |
- repo_name=repo_name,
|
| |
- ns='modules',
|
| |
- branch='rawhide',
|
| |
- summary=summary,
|
| |
- description=summary,
|
| |
- upstreamurl=None,
|
| |
- monitor='no-monitoring',
|
| |
- bug=None,
|
| |
- exception=True,
|
| |
- name=name,
|
| |
- config=config,
|
| |
- )
|
| |
- fedpkgClient._request_branch(
|
| |
- logger=logger,
|
| |
- service_levels=service_levels,
|
| |
- all_releases=all_releases,
|
| |
- branch=b,
|
| |
- active_branch=active_branch,
|
| |
- repo_name=repo_name,
|
| |
- ns='modules',
|
| |
- no_git_branch=no_git_branch,
|
| |
- no_auto_module=True, # Avoid infinite recursion.
|
| |
- name=name,
|
| |
- config=config,
|
| |
- )
|
| |
+
|
| |
+ if dry_run:
|
| |
+ print(summary)
|
| |
+ else:
|
| |
+ fedpkgClient._request_repo(
|
| |
+ logger=logger,
|
| |
+ repo_name=repo_name,
|
| |
+ ns='modules',
|
| |
+ branch='rawhide',
|
| |
+ summary=summary,
|
| |
+ description=summary,
|
| |
+ upstreamurl=None,
|
| |
+ monitor='no-monitoring',
|
| |
+ bug=None,
|
| |
+ exception=True,
|
| |
+ name=name,
|
| |
+ config=config,
|
| |
+ )
|
| |
+ fedpkgClient._request_branch(
|
| |
+ logger=logger,
|
| |
+ service_levels=service_levels,
|
| |
+ all_releases=all_releases,
|
| |
+ branch=b,
|
| |
+ active_branch=active_branch,
|
| |
+ repo_name=repo_name,
|
| |
+ ns='modules',
|
| |
+ dry_run=dry_run,
|
| |
+ no_git_branch=no_git_branch,
|
| |
+ no_auto_module=True, # Avoid infinite recursion.
|
| |
+ name=name,
|
| |
+ config=config,
|
| |
+ )
|
| |
|
| |
def do_distgit_fork(self):
|
| |
"""create fork of the distgit repository
|
| |
Hello,
You don't have to create a new parameter
--dry-run
for argumentrequest-branch
, instead we prefer using the top-level optional argument--dry-run
which is inherited from rpkg. This will give you access toself.args.dry_run
(since fedpkgClient inherits from cliClient) too.The only difference will be that instead of calling
fedpkg request-branch --dry-run ...
you would call it likefedpkg --dry-run request-branch ...
.