Merge lp:~vorlon/ubuntu-cdimage/match-series-for-current-triggers into lp:ubuntu-cdimage

Proposed by Steve Langasek on 2017-05-16
Status: Merged
Merged at revision: 1667
Proposed branch: lp:~vorlon/ubuntu-cdimage/match-series-for-current-triggers
Merge into: lp:ubuntu-cdimage
Diff against target: 34 lines (+4/-2)
2 files modified
lib/cdimage/tests/test_tree.py (+3/-1)
lib/cdimage/tree.py (+1/-1)
To merge this branch: bzr merge lp:~vorlon/ubuntu-cdimage/match-series-for-current-triggers
Reviewer Review Type Date Requested Status
Adam Conrad 2017-05-16 Approve on 2017-05-16
Ubuntu CD Image Team 2017-05-16 Pending
Review via email: mp+324123@code.launchpad.net
To post a comment you must log in.
Adam Conrad (adconrad) wrote :

Instead of adding the prev_series logic to the test, you could just hardcode, say, "precise-" in the series field of the triggers file, guaranteeing that we're testing that all new series are satisfied by that constraint.

Not a huge difference, but testing that "series" is contained in the set of "series - 1; continuing" is using the same set of methods to test in both directions, which means a bug in ordering would go unnoticed, as series-1+1 will always be series, even if the actual sort order is wrong.

Change or don't, but it also saves you a line of code. +1 with or without the above consideration.

(I assume merging this and pulling it on nusakan will come hand-in-hand with an edit of the production file)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/cdimage/tests/test_tree.py'
2--- lib/cdimage/tests/test_tree.py 2017-05-01 05:31:49 +0000
3+++ lib/cdimage/tests/test_tree.py 2017-05-16 16:55:43 +0000
4@@ -159,6 +159,7 @@
5 publish_base = os.path.join(self.temp_dir, "www", "full", "daily-live")
6 target_dir = os.path.join(publish_base, "20130321")
7 series = Series.latest().name
8+ prev_series = all_series[Series.latest().index - 1]
9 for name in (
10 "%s-desktop-i386.iso" % series,
11 "%s-desktop-i386.manifest" % series,
12@@ -168,7 +169,8 @@
13 self.temp_dir, "production", "current-triggers")
14 with mkfile(current_triggers_path) as current_triggers:
15 print(
16- "ubuntu\tdaily-live\t%s\ti386" % series, file=current_triggers)
17+ "ubuntu\tdaily-live\t%s-\ti386" % prev_series,
18+ file=current_triggers)
19 self.config["SSH_ORIGINAL_COMMAND"] = (
20 "mark-current --project=ubuntu --series=%s --publish-type=desktop "
21 "--architecture=i386 20130321" % series)
22
23=== modified file 'lib/cdimage/tree.py'
24--- lib/cdimage/tree.py 2017-05-01 05:31:49 +0000
25+++ lib/cdimage/tree.py 2017-05-16 16:55:43 +0000
26@@ -2331,7 +2331,7 @@
27 continue
28 if self.image_type != image_type:
29 continue
30- if self.config.full_series != series:
31+ if not self.config.match_series(series):
32 continue
33 if arch in arches:
34 return True

Subscribers

People subscribed via source and target branches