Merge lp:~apw/britney/britney1-ubuntu--fix-bug-blocks into lp:~ubuntu-release/britney/britney1-ubuntu

Proposed by Andy Whitcroft
Status: Merged
Merged at revision: 329
Proposed branch: lp:~apw/britney/britney1-ubuntu--fix-bug-blocks
Merge into: lp:~ubuntu-release/britney/britney1-ubuntu
Diff against target: 58 lines (+25/-16)
1 file modified
britney (+25/-16)
To merge this branch: bzr merge lp:~apw/britney/britney1-ubuntu--fix-bug-blocks
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
Review via email: mp+380633@code.launchpad.net

Commit message

When searching against a distribution we only actually will find tasks on
bugs open against development. This leads us to miss bugs which either
have a closed development task or have no development task at all. This
affects bugs in then development series which have no general development
task, and those nominated to older series and have a closed development
task. In particular these forms are seen with kernel tracking bugs.

Enhance the blocking bug search to search in both the distribution and
the associated series.

This has been run in unit-test against development and produces the same
block list there. It has been tested against the current live stable
releases and seems to produce believeable block lists, and significantly
longer ones in those releases.

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Ok, this is actually looking good. First I was a bit worried that this might be a bit slow, but then I saw it was slow from the start, and this can potentially make it faster (due to better handling of duplicate bugs from tasks).

One thing only to consider is what I wrote in my inline-comment - placement of the script. But I guess this is more cosmetics?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'britney'
2--- britney 2019-10-18 12:54:51 +0000
3+++ britney 2020-03-12 15:19:26 +0000
4@@ -217,29 +217,38 @@
5 launchpad = Launchpad.login_with("proposed-migration", sys.argv[1])
6 distro = launchpad.distributions[sys.argv[2]]
7 tags = sys.argv[3].split()
8-for task in distro.searchTasks(omit_targeted=False, tags=tags):
9+series = distro.getSeries(name_or_version=sys.argv[4])
10+blocks = set()
11+tasks = list(series.searchTasks(omit_targeted=False, tags=tags))
12+tasks += list(distro.searchTasks(omit_targeted=False, tags=tags))
13+block_detail = {}
14+for task in tasks:
15 target = task.target
16 bug = task.bug
17 if urlsplit(target.resource_type_link).fragment in (
18 "distribution_source_package", "source_package"):
19- for action in reversed(
20- [a for a in bug.activity if a.whatchanged == "tags"]):
21- oldtags = action.oldvalue.split()
22- newtags = action.newvalue.split()
23- gained_block = False
24- for tag in tags:
25- if tag not in oldtags and tag in newtags:
26- gained_block = True
27+ date = block_detail.get(bug.id)
28+ if date is None:
29+ for action in reversed(
30+ [a for a in bug.activity if a.whatchanged == "tags"]):
31+ oldtags = action.oldvalue.split()
32+ newtags = action.newvalue.split()
33+ gained_block = False
34+ for tag in tags:
35+ if tag not in oldtags and tag in newtags:
36+ gained_block = True
37+ break
38+ if gained_block:
39+ date = action.datechanged
40 break
41- if gained_block:
42- date = action.datechanged
43- break
44- else:
45- date = bug.date_created
46- print("%s %d %d" %
47+ else:
48+ date = bug.date_created
49+ block_detail[bug.id] = date
50+ blocks.add("%s %d %d" %
51 (os.path.basename(target.self_link), bug.id,
52 calendar.timegm(date.timetuple())))
53-' "$LP_SERVICE" "$DISTRIBUTION" "$tags" >"$1/$SERIES-proposed/$output_file.new"
54+print("\n".join(sorted(blocks)))
55+' "$LP_SERVICE" "$DISTRIBUTION" "$tags" "$SERIES" >"$1/$SERIES-proposed/$output_file.new"
56 mv "$1/$SERIES-proposed/$output_file.new" "$1/$SERIES-proposed/$output_file"
57 }
58 if option blocks; then

Subscribers

People subscribed via source and target branches