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

Proposed by Andy Whitcroft
Status: Needs review
Proposed branch: lp:~apw/britney/britney1-ubuntu--fix-stable-blocks
Merge into: lp:~ubuntu-release/britney/britney1-ubuntu
Diff against target: 46 lines (+11/-3)
1 file modified
britney (+11/-3)
To merge this branch: bzr merge lp:~apw/britney/britney1-ubuntu--fix-stable-blocks
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Ubuntu Release Team Pending
Review via email: mp+332353@code.launchpad.net

Description of the change

Fix launchpad bug block searches for stable series.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

You could do rather less work by having `blocks` be a dict mapping bug IDs to the rest of the information, checking early in the loop whether task.bug.id is in the dict already, and handling the formatting at the end. But this looks fine even without that.

review: Approve

Unmerged revisions

310. By Andy Whitcroft

britney: identify bug blocks against the nominated series as well as devel

When searching against the development series bugs which are closed in
the development series but open in a specific older series the bugs are
not listed. This leads us to miss blocks in stable releases in particular
this form is seen with kernel tracking bugs.

Enhance the blocking bug search to search in both development and in
the nominated 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.

Signed-off-by: Andy Whitcroft <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'britney'
2--- britney 2017-04-21 21:25:08 +0000
3+++ britney 2017-10-17 14:06:06 +0000
4@@ -172,12 +172,15 @@
5
6 blocks () {
7 local tags
8+ local series
9 [ "$DISTRIBUTION" = ubuntu ] || return 0
10 mkdir -p "$1/$SERIES-proposed"
11 if [ "$SERIES" = "$DEFAULT_SERIES" ]; then
12 tags="block-proposed block-proposed-$SERIES"
13+ series="devel"
14 else
15 tags="block-proposed-$SERIES"
16+ series="$SERIES"
17 fi
18 python -c '
19 from __future__ import print_function
20@@ -207,7 +210,11 @@
21 launchpad = Launchpad.login_with("proposed-migration", sys.argv[1])
22 distro = launchpad.distributions[sys.argv[2]]
23 tags = sys.argv[3].split()
24-for task in distro.searchTasks(omit_targeted=False, tags=tags):
25+series = distro.getSeries(name_or_version=sys.argv[4])
26+blocks = set()
27+tasks = list(series.searchTasks(omit_targeted=False, tags=tags))
28+tasks += list(distro.searchTasks(omit_targeted=False, tags=tags))
29+for task in tasks:
30 target = task.target
31 bug = task.bug
32 if urlsplit(target.resource_type_link).fragment in (
33@@ -226,10 +233,11 @@
34 break
35 else:
36 date = bug.date_created
37- print("%s %d %d" %
38+ blocks.add("%s %d %d" %
39 (os.path.basename(target.self_link), bug.id,
40 calendar.timegm(date.timetuple())))
41-' "$LP_SERVICE" "$DISTRIBUTION" "$tags" >"$1/$SERIES-proposed/Blocks.new"
42+print("\n".join(sorted(blocks)))
43+' "$LP_SERVICE" "$DISTRIBUTION" "$tags" "$series" >"$1/$SERIES-proposed/Blocks.new"
44 mv "$1/$SERIES-proposed/Blocks.new" "$1/$SERIES-proposed/Blocks"
45 }
46 if option blocks; then

Subscribers

People subscribed via source and target branches