Merge lp:~brian-murray/arsenal/length-in-state into lp:~bryce/arsenal/2.x

Proposed by Brian Murray
Status: Merged
Approved by: Bryce Harrington
Approved revision: 1069
Merged at revision: 1073
Proposed branch: lp:~brian-murray/arsenal/length-in-state
Merge into: lp:~bryce/arsenal/2.x
Diff against target: 101 lines (+30/-7)
1 file modified
scripts/collect-bug-data (+30/-7)
To merge this branch: bzr merge lp:~brian-murray/arsenal/length-in-state
Reviewer Review Type Date Requested Status
Bryce Harrington Approve
Review via email: mp+114227@code.launchpad.net

Description of the change

This branch adds in a days-in-state search criteria which uses the filter_status_length from lpltk bzr revno 160. This allows you to do something like search for bugs assigned to the Canonical Foundations team with a status of In Progress and in that state for more than 30 days - kinda neat.

Additionally, when testing this I noticed that I was only getting tasks assigned to one team member because I was returning after the first participant was done. I've fixed this by creating a list of assigned tasks and returning that once all the participants have been iterated through.

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'scripts/collect-bug-data'
--- scripts/collect-bug-data 2012-07-03 20:07:11 +0000
+++ scripts/collect-bug-data 2012-07-10 16:21:25 +0000
@@ -338,7 +338,12 @@
338 reopened = search_criteria['reopened']338 reopened = search_criteria['reopened']
339 except KeyError:339 except KeyError:
340 reopened = False340 reopened = False
341 341
342 try:
343 statuslength = search_criteria['days-in-state']
344 except KeyError:
345 statuslength = False
346
342 # ensure that only one of these are selected347 # ensure that only one of these are selected
343 count = 0348 count = 0
344 if search_assignees != '':349 if search_assignees != '':
@@ -361,7 +366,7 @@
361 'order_by': search_order}366 'order_by': search_order}
362367
363 if search_reporters != '':368 if search_reporters != '':
364 tasks = []369 reported_tasks = []
365 for reporter in search_reporters:370 for reporter in search_reporters:
366 search_reporter = self.lp.launchpad.people[reporter]371 search_reporter = self.lp.launchpad.people[reporter]
367 if search_reporter.is_team is False:372 if search_reporter.is_team is False:
@@ -369,6 +374,9 @@
369 tasks = distro.search_tasks(**search_args)374 tasks = distro.search_tasks(**search_args)
370 if reopened:375 if reopened:
371 tasks.set_filter_reopened()376 tasks.set_filter_reopened()
377 if statuslength:
378 tasks.set_filter_status_length(statuslength)
379 reported_tasks.append(tasks)
372 else:380 else:
373 for participant in search_reporter.participants:381 for participant in search_reporter.participants:
374 if participant.is_team:382 if participant.is_team:
@@ -377,12 +385,16 @@
377 tasks = distro.search_tasks(**search_args)385 tasks = distro.search_tasks(**search_args)
378 if reopened:386 if reopened:
379 tasks.set_filter_reopened()387 tasks.set_filter_reopened()
388 if statuslength:
389 tasks.set_filter_status_length(statuslength)
390 for task in tasks:
391 reported_tasks.append(task)
380 if search_limit:392 if search_limit:
381 return tasks[:search_limit]393 return reported_tasks[:search_limit]
382 else:394 else:
383 return tasks395 return reported_tasks
384 if search_assignees != '':396 if search_assignees != '':
385 tasks = []397 assigned_tasks = []
386 for assignee in search_assignees:398 for assignee in search_assignees:
387 search_assignee = self.lp.launchpad.people[assignee]399 search_assignee = self.lp.launchpad.people[assignee]
388 if search_assignee.is_team is False:400 if search_assignee.is_team is False:
@@ -390,6 +402,9 @@
390 tasks = distro.search_tasks(**search_args)402 tasks = distro.search_tasks(**search_args)
391 if reopened:403 if reopened:
392 tasks.set_filter_reopened()404 tasks.set_filter_reopened()
405 if statuslength:
406 tasks.set_filter_status_length(statuslength)
407 assigned_tasks.append(tasks)
393 search_assignee_names.append(search_assignee.name)408 search_assignee_names.append(search_assignee.name)
394 else:409 else:
395 for participant in search_assignee.participants:410 for participant in search_assignee.participants:
@@ -399,10 +414,14 @@
399 tasks = distro.search_tasks(**search_args)414 tasks = distro.search_tasks(**search_args)
400 if reopened:415 if reopened:
401 tasks.set_filter_reopened()416 tasks.set_filter_reopened()
417 if statuslength:
418 tasks.set_filter_status_length(statuslength)
419 for task in tasks:
420 assigned_tasks.append(task)
402 if search_limit:421 if search_limit:
403 return tasks[:search_limit]422 return assigned_tasks[:search_limit]
404 else:423 else:
405 return tasks424 return assigned_tasks
406 # Subscribers searches differently than assignee, participant.425 # Subscribers searches differently than assignee, participant.
407 # TODO: consolidate searching by these fields and make the splitting team426 # TODO: consolidate searching by these fields and make the splitting team
408 # into participants a configurable feature.427 # into participants a configurable feature.
@@ -413,6 +432,8 @@
413 tasks = distro.search_tasks(**search_args)432 tasks = distro.search_tasks(**search_args)
414 if reopened:433 if reopened:
415 tasks.set_filter_reopened()434 tasks.set_filter_reopened()
435 if statuslength:
436 tasks.set_filter_status_length(statuslength)
416 if search_limit:437 if search_limit:
417 return tasks[:search_limit]438 return tasks[:search_limit]
418 else:439 else:
@@ -421,6 +442,8 @@
421 tasks = distro.search_tasks(**search_args)442 tasks = distro.search_tasks(**search_args)
422 if reopened:443 if reopened:
423 tasks.set_filter_reopened()444 tasks.set_filter_reopened()
445 if statuslength:
446 tasks.set_filter_status_length(statuslength)
424 if search_limit:447 if search_limit:
425 return tasks[:search_limit]448 return tasks[:search_limit]
426 else:449 else:

Subscribers

People subscribed via source and target branches

to all changes: