Merge ~pieq/bugit/+git/qabro:fix-1806832-bug-info-per-series into bugit:master

Proposed by Pierre Equoy
Status: Merged
Approved by: Pierre Equoy
Approved revision: 69511ab5a194737401e1579dd16f3e1da5618a4b
Merged at revision: 200d58bcb2e4ed7ba0ab807f93161cbf1e8e8ad6
Proposed branch: ~pieq/bugit/+git/qabro:fix-1806832-bug-info-per-series
Merge into: bugit:master
Diff against target: 37 lines (+11/-8)
1 file modified
qabro/bug_assistant.py (+11/-8)
Reviewer Review Type Date Requested Status
OEM Services QA Pending
Review via email: mp+362718@code.launchpad.net

Description of the change

See commit message for more information.

To test, you can create a snap, then run:

APPORT_LAUNCHPAD_INSTANCE=staging qabro --fwts -p lisbon -t toyota

This will create a bug report with an additional series "hwe-lisbon", assigned to Alex Hung. Both status and importance should be set in the "hwe-lisbon" series only.

You can also try the classic

APPORT_LAUNCHPAD_INSTANCE=staging qabro

and make sure things work as expected.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Just a minor pythonic advice, otherwise +1

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

Thanks Sylvain!

bug_tasks cannot use negative indexes unfortunately (I added a comment inline below). I'll mark this MR approved then.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/qabro/bug_assistant.py b/qabro/bug_assistant.py
2index 824dc5f..dd5fb87 100644
3--- a/qabro/bug_assistant.py
4+++ b/qabro/bug_assistant.py
5@@ -143,21 +143,24 @@ class BugAssistant:
6 print('Updating project...')
7 task.target = project
8 task.lp_save()
9+
10+ if series:
11+ print('Setting series...')
12+ nomination = self.bug.addNomination(target=series)
13+ nomination.approve()
14+
15+ # We update bug info only for the latest created series
16+ task = self.bug.bug_tasks[len(self.bug.bug_tasks)-1]
17+ if assignee:
18+ print('Setting assignee for series {}...').format(task.bug_target_name)
19+ task.assignee = assignee
20 print('Setting status...')
21 task.status = self.lp_status
22 print('Setting importance...')
23 task.importance = self.lp_importance
24- if assignee:
25- print('Setting assignee...')
26- task.assignee = assignee
27
28 task.lp_save()
29
30- if series:
31- print('Setting series...')
32- nomination = self.bug.addNomination(target=series)
33- nomination.approve()
34-
35 service_root = os.environ.get('APPORT_LAUNCHPAD_INSTANCE', 'production')
36 if service_root == 'qastaging':
37 bug_url = QASTAGING_WEB_ROOT+'bugs/{}'.format(self.bug.id)

Subscribers

People subscribed via source and target branches

to all changes: