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
diff --git a/qabro/bug_assistant.py b/qabro/bug_assistant.py
index 824dc5f..dd5fb87 100644
--- a/qabro/bug_assistant.py
+++ b/qabro/bug_assistant.py
@@ -143,21 +143,24 @@ class BugAssistant:
143 print('Updating project...')143 print('Updating project...')
144 task.target = project144 task.target = project
145 task.lp_save()145 task.lp_save()
146
147 if series:
148 print('Setting series...')
149 nomination = self.bug.addNomination(target=series)
150 nomination.approve()
151
152 # We update bug info only for the latest created series
153 task = self.bug.bug_tasks[len(self.bug.bug_tasks)-1]
154 if assignee:
155 print('Setting assignee for series {}...').format(task.bug_target_name)
156 task.assignee = assignee
146 print('Setting status...')157 print('Setting status...')
147 task.status = self.lp_status158 task.status = self.lp_status
148 print('Setting importance...')159 print('Setting importance...')
149 task.importance = self.lp_importance160 task.importance = self.lp_importance
150 if assignee:
151 print('Setting assignee...')
152 task.assignee = assignee
153161
154 task.lp_save()162 task.lp_save()
155163
156 if series:
157 print('Setting series...')
158 nomination = self.bug.addNomination(target=series)
159 nomination.approve()
160
161 service_root = os.environ.get('APPORT_LAUNCHPAD_INSTANCE', 'production')164 service_root = os.environ.get('APPORT_LAUNCHPAD_INSTANCE', 'production')
162 if service_root == 'qastaging':165 if service_root == 'qastaging':
163 bug_url = QASTAGING_WEB_ROOT+'bugs/{}'.format(self.bug.id)166 bug_url = QASTAGING_WEB_ROOT+'bugs/{}'.format(self.bug.id)

Subscribers

People subscribed via source and target branches

to all changes: