Merge lp:~wgrant/bzr-pqm/bug-711016-no-ui-clause into lp:bzr-pqm

Proposed by William Grant
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 77
Merged at revision: 77
Proposed branch: lp:~wgrant/bzr-pqm/bug-711016-no-ui-clause
Merge into: lp:bzr-pqm
Diff against target: 143 lines (+18/-18)
2 files modified
lpland.py (+3/-3)
tests/test_lpland.py (+15/-15)
To merge this branch: bzr merge lp:~wgrant/bzr-pqm/bug-711016-no-ui-clause
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) Approve
Review via email: mp+48135@code.launchpad.net

Description of the change

This branch adjusts lp-land to only include a [ui=...] clause when there are UI reviewers, rather than always including [ui=none]. This same change was made to ec2 land in https://code.launchpad.net/~wgrant/launchpad/bug-711016-no-ui-clause/+merge/48094.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks.

As a side-note, I'm surprised there is this much project-specific code in bzr-pqm.

review: Approve
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

If I should land this, please let me know.

Revision history for this message
Aaron Bentley (abentley) wrote :

About the project-specific code in lp-land-- that's because I originally wrote lp-land as a standalone plugin for use with Launchpad landings. I believe that we are one of the few users of PQM, so it seemed fine to leave in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lpland.py'
--- lpland.py 2010-11-08 16:49:24 +0000
+++ lpland.py 2011-02-01 10:38:27 +0000
@@ -386,13 +386,13 @@
386 if not code_reviewers:386 if not code_reviewers:
387 raise MissingReviewError("Need approved votes in order to land.")387 raise MissingReviewError("Need approved votes in order to land.")
388 if ui_reviewers:388 if ui_reviewers:
389 ui_clause = _comma_separated_names(ui_reviewers)389 ui_clause = '[ui=%s]' % _comma_separated_names(ui_reviewers)
390 else:390 else:
391 ui_clause = 'none'391 ui_clause = ''
392 if rc_reviewers:392 if rc_reviewers:
393 rc_clause = (393 rc_clause = (
394 '[release-critical=%s]' % _comma_separated_names(rc_reviewers))394 '[release-critical=%s]' % _comma_separated_names(rc_reviewers))
395 else:395 else:
396 rc_clause = ''396 rc_clause = ''
397 return '%s[r=%s][ui=%s]' % (397 return '%s[r=%s]%s' % (
398 rc_clause, _comma_separated_names(code_reviewers), ui_clause)398 rc_clause, _comma_separated_names(code_reviewers), ui_clause)
399399
=== modified file 'tests/test_lpland.py'
--- tests/test_lpland.py 2010-11-08 16:49:24 +0000
+++ tests/test_lpland.py 2011-02-01 10:38:27 +0000
@@ -209,7 +209,7 @@
209 self.mp.get_bugs = FakeMethod([self.fake_bug])209 self.mp.get_bugs = FakeMethod([self.fake_bug])
210 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})210 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})
211211
212 self.assertEqual("[r=foo][ui=none][bug=20] Foobaring the sbrubble.",212 self.assertEqual("[r=foo][bug=20] Foobaring the sbrubble.",
213 self.mp.build_commit_message("Foobaring the sbrubble.",213 self.mp.build_commit_message("Foobaring the sbrubble.",
214 testfix, no_qa, incr))214 testfix, no_qa, incr))
215215
@@ -232,7 +232,7 @@
232 self.mp.get_bugs = FakeMethod([])232 self.mp.get_bugs = FakeMethod([])
233 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})233 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})
234234
235 self.assertEqual("[r=foo][ui=none][no-qa] Foobaring the sbrubble.",235 self.assertEqual("[r=foo][no-qa] Foobaring the sbrubble.",
236 self.mp.build_commit_message("Foobaring the sbrubble.",236 self.mp.build_commit_message("Foobaring the sbrubble.",
237 testfix, no_qa, incr))237 testfix, no_qa, incr))
238238
@@ -245,7 +245,7 @@
245 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})245 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})
246246
247 self.assertEqual(247 self.assertEqual(
248 "[r=foo][ui=none][bug=20][no-qa] Foobaring the sbrubble.",248 "[r=foo][bug=20][no-qa] Foobaring the sbrubble.",
249 self.mp.build_commit_message("Foobaring the sbrubble.",249 self.mp.build_commit_message("Foobaring the sbrubble.",
250 testfix, no_qa, incr))250 testfix, no_qa, incr))
251251
@@ -258,7 +258,7 @@
258 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})258 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})
259259
260 self.assertEqual(260 self.assertEqual(
261 "[r=foo][ui=none][bug=20][incr] Foobaring the sbrubble.",261 "[r=foo][bug=20][incr] Foobaring the sbrubble.",
262 self.mp.build_commit_message("Foobaring the sbrubble.",262 self.mp.build_commit_message("Foobaring the sbrubble.",
263 testfix, no_qa, incr))263 testfix, no_qa, incr))
264264
@@ -271,7 +271,7 @@
271 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})271 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})
272272
273 self.assertEqual(273 self.assertEqual(
274 "[r=foo][ui=none][bug=20][incr] Foobaring the sbrubble.",274 "[r=foo][bug=20][incr] Foobaring the sbrubble.",
275 self.mp.build_commit_message("Foobaring the sbrubble.",275 self.mp.build_commit_message("Foobaring the sbrubble.",
276 testfix, no_qa, incr))276 testfix, no_qa, incr))
277277
@@ -284,7 +284,7 @@
284 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})284 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})
285285
286 self.assertEqual(286 self.assertEqual(
287 "[r=foo][ui=none][bug=20][no-qa][incr] Foobaring the sbrubble.",287 "[r=foo][bug=20][no-qa][incr] Foobaring the sbrubble.",
288 self.mp.build_commit_message("Foobaring the sbrubble.", 288 self.mp.build_commit_message("Foobaring the sbrubble.",
289 testfix, no_qa, incr))289 testfix, no_qa, incr))
290290
@@ -293,7 +293,7 @@
293 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})293 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})
294294
295 self.assertEqual(295 self.assertEqual(
296 "[r=foo][ui=none][bug=20][rollback=123] Foobaring the sbrubble.",296 "[r=foo][bug=20][rollback=123] Foobaring the sbrubble.",
297 self.mp.build_commit_message("Foobaring the sbrubble.", 297 self.mp.build_commit_message("Foobaring the sbrubble.",
298 rollback=123))298 rollback=123))
299299
@@ -302,9 +302,9 @@
302 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})302 self.mp.get_reviews = FakeMethod({None : [self.fake_person]})
303303
304 self.assertEqual(304 self.assertEqual(
305 "[r=foo][ui=none][bug=20][rollback=123] Foobaring the sbrubble.",305 "[r=foo][bug=20][rollback=123] Foobaring the sbrubble.",
306 self.mp.build_commit_message(306 self.mp.build_commit_message(
307 "[r=foo][ui=none][bug=20][rollback=123] Foobaring the sbrubble.",307 "[r=foo][bug=20][rollback=123] Foobaring the sbrubble.",
308 rollback=123))308 rollback=123))
309309
310310
@@ -331,15 +331,15 @@
331 def test_one_reviewer_no_type(self):331 def test_one_reviewer_no_type(self):
332 # It's very common for a merge proposal to be reviewed by one person332 # It's very common for a merge proposal to be reviewed by one person
333 # with no specified type of review. It such cases the review clause is333 # with no specified type of review. It such cases the review clause is
334 # '[r=<person>][ui=none]'.334 # '[r=<person>]'.
335 clause = self.get_reviewer_clause({None: [self.makePerson('foo')]})335 clause = self.get_reviewer_clause({None: [self.makePerson('foo')]})
336 self.assertEqual('[r=foo][ui=none]', clause)336 self.assertEqual('[r=foo]', clause)
337337
338 def test_two_reviewers_no_type(self):338 def test_two_reviewers_no_type(self):
339 # Branches can have more than one reviewer.339 # Branches can have more than one reviewer.
340 clause = self.get_reviewer_clause(340 clause = self.get_reviewer_clause(
341 {None: [self.makePerson('foo'), self.makePerson('bar')]})341 {None: [self.makePerson('foo'), self.makePerson('bar')]})
342 self.assertEqual('[r=bar,foo][ui=none]', clause)342 self.assertEqual('[r=bar,foo]', clause)
343343
344 def test_mentat_reviewers(self):344 def test_mentat_reviewers(self):
345 # A mentat review sometimes is marked like 'ui*'. Due to the345 # A mentat review sometimes is marked like 'ui*'. Due to the
@@ -357,7 +357,7 @@
357 # reviews, these are treated in the same way as reviewers without any357 # reviews, these are treated in the same way as reviewers without any
358 # given type.358 # given type.
359 clause = self.get_reviewer_clause({'code': [self.makePerson('foo')]})359 clause = self.get_reviewer_clause({'code': [self.makePerson('foo')]})
360 self.assertEqual('[r=foo][ui=none]', clause)360 self.assertEqual('[r=foo]', clause)
361361
362 def test_release_critical(self):362 def test_release_critical(self):
363 # Reviews that are marked as release-critical are included in a363 # Reviews that are marked as release-critical are included in a
@@ -365,13 +365,13 @@
365 clause = self.get_reviewer_clause(365 clause = self.get_reviewer_clause(
366 {'code': [self.makePerson('foo')],366 {'code': [self.makePerson('foo')],
367 'release-critical': [self.makePerson('bar')]})367 'release-critical': [self.makePerson('bar')]})
368 self.assertEqual('[release-critical=bar][r=foo][ui=none]', clause)368 self.assertEqual('[release-critical=bar][r=foo]', clause)
369369
370 def test_db_reviewer_counts(self):370 def test_db_reviewer_counts(self):
371 # There's no special way of annotating database reviews in Launchpad371 # There's no special way of annotating database reviews in Launchpad
372 # commit messages, so they are included with the code reviews.372 # commit messages, so they are included with the code reviews.
373 clause = self.get_reviewer_clause({'db': [self.makePerson('foo')]})373 clause = self.get_reviewer_clause({'db': [self.makePerson('foo')]})
374 self.assertEqual('[r=foo][ui=none]', clause)374 self.assertEqual('[r=foo]', clause)
375375
376 def test_ui_reviewers(self):376 def test_ui_reviewers(self):
377 # If someone has done a UI review, then that appears in the clause377 # If someone has done a UI review, then that appears in the clause

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: