Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package list support #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions bugz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ def prompt_for_bug(settings):
else:
log_info('Enter alias (optional): %s' % settings.alias)

if not hasattr(settings, 'cf_stabilisation_atoms'):
package_list_msg = 'Enter the Package list for this bug (optional): '
line = input(package_list_msg)
if len(line):
settings.cf_stabilisation_atoms = line
Comment on lines +188 to +191
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My issue here is the fact that the package list can contain multiple lines. Maybe we should input in a loop until an empty line?

elif settings.component == "Stabilisation":
log_info('Enter a Package list (optional): %s' % settings.cf_stabilisation_atoms)

if not hasattr(settings, 'assigned_to'):
assign_msg = 'Enter assignee (eg. [email protected]) (optional): '
line = input(assign_msg)
Expand Down Expand Up @@ -248,6 +256,8 @@ def show_bug_info(bug, settings):
'last_change_time': 'Updated',
'cc': 'CC',
'see_also': 'See Also',
'cf_runtime_testing_required': 'Runtime testing required',
'cf_stabilisation_atoms': 'Package list',
}
SkipFields = ['assigned_to_detail', 'cc_detail', 'creator_detail', 'id',
'is_confirmed', 'is_creator_accessible', 'is_cc_accessible',
Expand Down Expand Up @@ -420,6 +430,8 @@ def modify(settings):
params['ids'] = [settings.bugid]
if hasattr(settings, 'alias'):
params['alias'] = settings.alias
if hasattr(settings, 'cf_stabilisation_atoms'):
params['cf_stabilisation_atoms'] = settings.cf_stabilisation_atoms
if hasattr(settings, 'assigned_to'):
params['assigned_to'] = settings.assigned_to
if hasattr(settings, 'blocks_add'):
Expand Down Expand Up @@ -584,6 +596,8 @@ def post(settings):
print('%-12s: %s' % ('Severity', settings.severity))
if hasattr(settings, 'alias'):
print('%-12s: %s' % ('Alias', settings.alias))
if hasattr(settings, 'cf_stabilisation_atoms'):
print ('%-12s: %s' % ('Package list', settings.cf_stabilisation_atoms))
if hasattr(settings, 'assigned_to'):
print('%-12s: %s' % ('Assigned to', settings.assigned_to))
if hasattr(settings, 'cc'):
Expand Down Expand Up @@ -630,6 +644,8 @@ def post(settings):
params['cc'] = settings.cc
if hasattr(settings, 'url'):
params['url'] = settings.url
if hasattr(settings, 'cf_stabilisation_atoms'):
params['cf_stabilisation_atoms'] = settings.cf_stabilisation_atoms

result = settings.call_bz(settings.bz.Bug.create, params)
log_info('Bug %d submitted' % result['id'])
Expand All @@ -639,10 +655,10 @@ def search(settings):
"""Performs a search on the bugzilla database with
the keywords given on the title (or the body if specified).
"""
valid_keys = ['alias', 'assigned_to', 'component', 'creator',
'limit', 'offset', 'op_sys', 'platform',
'priority', 'product', 'resolution', 'severity',
'version', 'whiteboard', 'cc']
valid_keys = ['alias', 'assigned_to', 'cc', 'component', 'creator',
'limit', 'offset', 'op_sys', 'platform', 'priority',
'product', 'resolution', 'severity', 'version',
'whiteboard', 'cf_stabilisation_atoms']

params = {}
d = vars(settings)
Expand Down
2 changes: 2 additions & 0 deletions bugz/cli_argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ def make_arg_parser():
help='load description from file')
post_parser.add_argument('--append-command',
help='append output from command to description')
post_parser.add_argument('--package-list',
help='stabilization package list')
Comment on lines +263 to +264
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some marking to show it is Gentoo support feature only (in the help). Other bugzilla instances don't support it.

post_parser.add_argument('--batch',
action="store_true",
help='do not prompt for any values')
Expand Down