Merge lp:~ursinha/bzr-pqm/auto-approve into lp:bzr-pqm

Proposed by Ursula Junque
Status: Rejected
Rejected by: Aaron Bentley
Proposed branch: lp:~ursinha/bzr-pqm/auto-approve
Merge into: lp:bzr-pqm
Diff against target: 60 lines (+26/-0)
2 files modified
lpland.py (+11/-0)
tests/test_lpland.py (+15/-0)
To merge this branch: bzr merge lp:~ursinha/bzr-pqm/auto-approve
Reviewer Review Type Date Requested Status
Aaron Bentley Disapprove
Jelmer Vernooij (community) Abstain
Diogo Matsubara Pending
Review via email: mp+43521@code.launchpad.net

Description of the change

This branch changes the behavior of the plugin by making it mark the merge proposal status as Approved (queue_status), if it already has any approved code votes. The added method itself doesn't check the mp votes, but the checking is done by other method before this one is called.

This change has been implemented so people won't need to set their mp's to Approved manually.

To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) wrote :

This seems like the wrong time to set the proposal to approved. This should ideally be done by the (last) reviewer as part of their review. By the time you lp-land it, it will be set to "Merged" in a few minutes, so I don't think that there's great value to setting it "approved" in the meantime.

This also assumes that the person landing the code is on the review team of the target branch. This is usually the case, but our design for merge proposals is that non-reviewers can land code if such code has been approved by a reviewer.

Doing lp_save as part of set_status_approved seems like a bad pattern, because it means that each change costs a roundtrip, instead of allowing multiple changes to be made in a single roundtrip.

Revision history for this message
Martin Pool (mbp) wrote :

On 14 December 2010 03:31, Aaron Bentley <email address hidden> wrote:
> This seems like the wrong time to set the proposal to approved.  This should ideally be done by the (last) reviewer as part of their review.  By the time you lp-land it, it will be set to "Merged" in a few minutes, so I don't think that there's great value to setting it "approved" in the meantime.

I agree.

This seems like a kludge for the fact that through the web ui or mail
ui, people are voting approve but not marking it approved. I think
there are open bugs saying that common action should be made easier.

--
Martin

Revision history for this message
Jelmer Vernooij (jelmer) :
review: Abstain
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Abstain
Revision history for this message
Aaron Bentley (abentley) wrote :

IIRC, this was to be based on a misunderstanding of how to transition from a pqm-based workflow to a Tarmac-based one. In a Tarmac-based workflow, lp-land should no longer be necessary.

review: Disapprove

Unmerged revisions

77. By Ursula Junque

adding set_status_approved method to do what it says.

76. By Ursula Junque

adding setStatus to FakeLPMergeProposal; adding test to check set_status_approved.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lpland.py'
2--- lpland.py 2010-11-08 16:49:24 +0000
3+++ lpland.py 2010-12-13 14:51:45 +0000
4@@ -179,6 +179,16 @@
5 # XXX: JonathanLange 2009-09-24: No unit tests.
6 return branch.composePublicURL(scheme="bzr+ssh")
7
8+ def set_status_approved(self):
9+ """Set the overall status of the mp to Approved."""
10+ try:
11+ self._mp.setStatus(status="Approved")
12+ self._mp.lp_save()
13+ except Exception, e:
14+ raise BzrCommandError(
15+ "Unable to set the status in the merge proposal.\n"
16+ "Got: %s" % e)
17+
18 def build_commit_message(self, commit_text, testfix=False, no_qa=False,
19 incremental=False, rollback=None):
20 """Get the Launchpad-style commit message for a merge proposal."""
21@@ -266,6 +276,7 @@
22 self.check_submission(submission)
23 self.set_message(submission, mp, self.testfix, self.no_qa,
24 self.incremental, rollback=self.rollback)
25+ self.set_status_approved()
26 email = submission.to_email(self.mail_from, self.mail_to)
27 if outf is not None:
28 outf.write(email.as_string())
29
30=== modified file 'tests/test_lpland.py'
31--- tests/test_lpland.py 2010-11-08 16:49:24 +0000
32+++ tests/test_lpland.py 2010-12-13 14:51:45 +0000
33@@ -61,6 +61,10 @@
34 def __init__(self, root=None):
35 self._root = root
36 self.commit_message = None
37+ self.queue_status = None
38+
39+ def setStatus(self, status):
40+ self.queue_status = status
41
42 def lp_save(self):
43 pass
44@@ -319,6 +323,17 @@
45 self.assertEqual(self.mp._mp.commit_message, commit_message)
46
47
48+class TestSetStatusApproved(unittest.TestCase):
49+
50+ def setUp(self):
51+ self.mp = MergeProposal(FakeLPMergeProposal())
52+ self.mp._mp.setStatus(status="Work in progress")
53+
54+ def test_set_status_approved(self):
55+ self.mp.set_status_approved()
56+ self.assertEqual(self.mp._mp.queue_status, "Approved")
57+
58+
59 class TestGetReviewerClause(unittest.TestCase):
60 """Tests for `get_reviewer_clause`."""
61

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: