Merge ~pieq/bugit/+git/qabro:fix-1883860-series-argument into bugit:master

Proposed by Pierre Equoy
Status: Merged
Approved by: Pierre Equoy
Approved revision: 5bc857020450190bd564235bfd0129d7b7f38735
Merged at revision: c4b8d23215f38fed2c0b3d66e43d2df741d074b7
Proposed branch: ~pieq/bugit/+git/qabro:fix-1883860-series-argument
Merge into: bugit:master
Diff against target: 69 lines (+17/-8)
2 files modified
qabro/__init__.py (+15/-6)
qabro/ui.py (+2/-2)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Review via email: mp+386801@code.launchpad.net

Description of the change

See commit message for more info.

To test, one can build the snap using `snapcraft` command, install it with `--devmode` argument, and test:

$ qabro -h
usage: test.py [-h] [--fwts] [-a ASSIGNEE] [-p PROJECT] [-s SERIES] [-t TAGS]

optional arguments:
  -h, --help show this help message and exit
  --fwts Automatically files an issue in Launchpad for the firmware team
  -a ASSIGNEE, --assignee ASSIGNEE
                        Assignee
  -p PROJECT, --project PROJECT
                        Project name
  -s SERIES, --series SERIES
                        Series
  -t TAGS, --tags TAGS Tags (such as Platform tag) separated by spaces

Examples: `qabro --fwts -p somerville -t platform-tag-3` will automatically open a Launchpad issue in the somerville project for the FWTS team.`qabro -p myproject -s myseries -t "a b c"` will start a bug report for the myproject project under the myseries series with tags a, b and c.

$ qabro -s my-series

should pre-fill the Series text field with `my-series`.

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

Very minor usability point not entirely related to this MR! Otherwise looks good to me.

review: Approve
Revision history for this message
Pierre Equoy (pieq) wrote :

Good point, joc, I updated the commit to reflect this.

Revision history for this message
Jonathan Cave (jocave) wrote :

Nice, still +1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/qabro/__init__.py b/qabro/__init__.py
index ce717ad..832e3a7 100644
--- a/qabro/__init__.py
+++ b/qabro/__init__.py
@@ -36,15 +36,19 @@ def main():
36 raise ValueError('Invalid log level: %s' % loglevel)36 raise ValueError('Invalid log level: %s' % loglevel)
37 logging.basicConfig(filename=logfile, format=logformat, level=numeric_level)37 logging.basicConfig(filename=logfile, format=logformat, level=numeric_level)
3838
39 epilog = ("Example: `qabro --fwts -p somerville -t platform-tag-3` will "39 epilog = ("Examples: `qabro --fwts -p somerville -t platform-tag-3` will "
40 "automatically open a Launchpad issue in the somerville project "40 "automatically open a Launchpad issue in the somerville project "
41 "for the FWTS team.")41 "for the FWTS team."
42 "`qabro -p myproject -s myseries -t \"a b c\"` will start a bug "
43 "report for the myproject project under the myseries series "
44 "with tags a, b and c.")
42 parser = argparse.ArgumentParser(epilog=epilog, argument_default='')45 parser = argparse.ArgumentParser(epilog=epilog, argument_default='')
43 parser.add_argument("--fwts", help=("Automatically files an issue in "46 parser.add_argument("--fwts", help=("Automatically files an issue in "
44 "Launchpad for the firmware team"),47 "Launchpad for the firmware team"),
45 action="store_true")48 action="store_true")
46 parser.add_argument("-a", "--assignee", help="Assignee")49 parser.add_argument("-a", "--assignee", help="Assignee e.g. your Launchpad ID")
47 parser.add_argument("-p", "--project", help="Project name")50 parser.add_argument("-p", "--project", help="Project name")
51 parser.add_argument("-s", "--series", help="Series e.g. focal")
48 parser.add_argument("-t", "--tags",52 parser.add_argument("-t", "--tags",
49 help="Tags (such as Platform tag) separated by spaces")53 help="Tags (such as Platform tag) separated by spaces")
50 args = parser.parse_args()54 args = parser.parse_args()
@@ -55,11 +59,16 @@ def main():
55 sys.exit("You must specify a platform tag, e.g. -t platform-tag-3")59 sys.exit("You must specify a platform tag, e.g. -t platform-tag-3")
56 auto_submit_fwts_report(args.project, args.tags)60 auto_submit_fwts_report(args.project, args.tags)
57 else:61 else:
58 start_ui(assignee=args.assignee, project=args.project, tags=args.tags)62 start_ui(assignee=args.assignee,
63 project=args.project,
64 series=args.series,
65 tags=args.tags)
5966
6067
61def start_ui(assignee='', project='', tags=''):68def start_ui(assignee='', project='', series='', tags=''):
62 ui = ReportScreen(assignee=assignee.lower(), project=project.lower(),69 ui = ReportScreen(assignee=assignee.lower(),
70 project=project.lower(),
71 series=series.lower(),
63 tags=tags.lower())72 tags=tags.lower())
64 ui.run()73 ui.run()
65 ba = BugAssistant(ui.report())74 ba = BugAssistant(ui.report())
diff --git a/qabro/ui.py b/qabro/ui.py
index 1a78c20..f83c516 100644
--- a/qabro/ui.py
+++ b/qabro/ui.py
@@ -44,7 +44,7 @@ class ReportScreen:
44 elif d["category"] == "vendors":44 elif d["category"] == "vendors":
45 tags["vendors"] = d["tags"]45 tags["vendors"] = d["tags"]
4646
47 def __init__(self, project='', tags='', assignee=''):47 def __init__(self, assignee='', project='', series='', tags=''):
48 # Adding standard info (CPU, BIOS, GPU, etc.) to the description48 # Adding standard info (CPU, BIOS, GPU, etc.) to the description
49 std_info = AttachmentAssistant.get_standard_info()49 std_info = AttachmentAssistant.get_standard_info()
50 std_info_str = '\n'.join(['{}: {}'.format(elt, std_info[elt]) for elt in std_info])50 std_info_str = '\n'.join(['{}: {}'.format(elt, std_info[elt]) for elt in std_info])
@@ -55,7 +55,7 @@ class ReportScreen:
55 multiline=True),55 multiline=True),
56 "Description (including steps to reproduce)")56 "Description (including steps to reproduce)")
57 self._project = urwid.LineBox(urwid.Edit(edit_text=project), 'Project')57 self._project = urwid.LineBox(urwid.Edit(edit_text=project), 'Project')
58 self._series = urwid.LineBox(urwid.Edit(), 'Series')58 self._series = urwid.LineBox(urwid.Edit(edit_text=series), 'Series')
59 self._status = []59 self._status = []
60 for s in self.statuses:60 for s in self.statuses:
61 rb = urwid.RadioButton(self._status, s, 'first True', None)61 rb = urwid.RadioButton(self._status, s, 'first True', None)

Subscribers

People subscribed via source and target branches

to all changes: