Merge lp:~mars/tarmac/fix-needs-review-api-call into lp:~launchpad/tarmac/lp-tarmac

Proposed by Māris Fogels
Status: Merged
Approved by: Māris Fogels
Approved revision: 386
Merged at revision: 386
Proposed branch: lp:~mars/tarmac/fix-needs-review-api-call
Merge into: lp:~launchpad/tarmac/lp-tarmac
Diff against target: 128 lines (+12/-12)
7 files modified
docs/introduction.txt (+1/-1)
docs/writingplugins.txt (+1/-1)
tarmac/plugins/bundlecommand.py (+2/-2)
tarmac/plugins/tests/test_bundlecommand.py (+2/-2)
tarmac/tests/__init__.py (+1/-1)
tarmac/tests/mock.py (+1/-1)
tarmac/tests/test_commands.py (+4/-4)
To merge this branch: bzr merge lp:~mars/tarmac/fix-needs-review-api-call
Reviewer Review Type Date Requested Status
Māris Fogels (community) Approve
Review via email: mp+43863@code.launchpad.net

Commit message

Fix the bundle-merge command's ability to set the 'Needs review' MP status.

Description of the change

This branch fixes a bug in the tarmac merge command that incorrectly sets the "Needs review" proposal status through the API.

To post a comment you must log in.
Revision history for this message
Māris Fogels (mars) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'docs/introduction.txt'
--- docs/introduction.txt 2010-10-26 00:59:55 +0000
+++ docs/introduction.txt 2010-12-16 04:03:56 +0000
@@ -151,7 +151,7 @@
151The Command plugin takes the merged tree result and runs a command on that151The Command plugin takes the merged tree result and runs a command on that
152tree. If the command fails, then it raises an exception that causes the merge152tree. If the command fails, then it raises an exception that causes the merge
153to be abandoned, a comment on the merge proposal to be added, and the merge153to be abandoned, a comment on the merge proposal to be added, and the merge
154proposal set to "Needs Review" (so that Tarmac doesn't try to merge it in the154proposal set to "Needs review" (so that Tarmac doesn't try to merge it in the
155next run). This command can be a script that runs tests, verifies certain155next run). This command can be a script that runs tests, verifies certain
156files aren't changed, a script that verifies a proper build, etc. In order to156files aren't changed, a script that verifies a proper build, etc. In order to
157use the Command plugin, your branch must have a ``verify_command`` option in157use the Command plugin, your branch must have a ``verify_command`` option in
158158
=== modified file 'docs/writingplugins.txt'
--- docs/writingplugins.txt 2010-09-17 21:57:28 +0000
+++ docs/writingplugins.txt 2010-12-16 04:03:56 +0000
@@ -105,7 +105,7 @@
105typically a longer message describing the issue in more detail. This comment105typically a longer message describing the issue in more detail. This comment
106will be posted to the merge proposal on Launchpad, to inform the developer106will be posted to the merge proposal on Launchpad, to inform the developer
107of what went wrong during the merge of their branch. The merge proposal will107of what went wrong during the merge of their branch. The merge proposal will
108also be set back to the ``Needs Review`` status, to avoid having tarmac108also be set back to the ``Needs review`` status, to avoid having tarmac
109attempt to merge the branch again, without having the issues resolved. If109attempt to merge the branch again, without having the issues resolved. If
110no ``comment`` argument is supplied, the ``message`` argument will be used110no ``comment`` argument is supplied, the ``message`` argument will be used
111for the comment when posting to Launchpad, instead.111for the comment when posting to Launchpad, instead.
112112
=== modified file 'tarmac/plugins/bundlecommand.py'
--- tarmac/plugins/bundlecommand.py 2010-12-14 14:44:33 +0000
+++ tarmac/plugins/bundlecommand.py 2010-12-16 04:03:56 +0000
@@ -186,7 +186,7 @@
186186
187 In this case, the full failure is emailed to the proposal subscribers,187 In this case, the full failure is emailed to the proposal subscribers,
188 a summary of the test failure is posted as a comment and the188 a summary of the test failure is posted as a comment and the
189 proposal is then set to "Needs Review" so that Tarmac doesn't attempt189 proposal is then set to "Needs review" so that Tarmac doesn't attempt
190 to merge it again without human interaction.190 to merge it again without human interaction.
191 '''191 '''
192 # Make output into a Result object, and create a tgz of the192 # Make output into a Result object, and create a tgz of the
@@ -241,7 +241,7 @@
241241
242 proposal.createComment(subject=subject,242 proposal.createComment(subject=subject,
243 content=comment)243 content=comment)
244 proposal.setStatus(status=u'Needs Review')244 proposal.setStatus(status=u'Needs review')
245 proposal.lp_save()245 proposal.lp_save()
246246
247 def get_subscribers_emails(self, proposal):247 def get_subscribers_emails(self, proposal):
248248
=== modified file 'tarmac/plugins/tests/test_bundlecommand.py'
--- tarmac/plugins/tests/test_bundlecommand.py 2010-12-14 14:44:33 +0000
+++ tarmac/plugins/tests/test_bundlecommand.py 2010-12-16 04:03:56 +0000
@@ -261,8 +261,8 @@
261261
262 # Proposals status is updated.262 # Proposals status is updated.
263 proposal1, proposal2 = self.collected_proposals263 proposal1, proposal2 = self.collected_proposals
264 self.assertEqual(proposal1[1].queue_status, "Needs Review")264 self.assertEqual(proposal1[1].queue_status, "Needs review")
265 self.assertEqual(proposal2[1].queue_status, "Needs Review")265 self.assertEqual(proposal2[1].queue_status, "Needs review")
266266
267 def test_send_report_email(self):267 def test_send_report_email(self):
268 """Test send_report_email()."""268 """Test send_report_email()."""
269269
=== modified file 'tarmac/tests/__init__.py'
--- tarmac/tests/__init__.py 2010-11-23 17:18:33 +0000
+++ tarmac/tests/__init__.py 2010-12-16 04:03:56 +0000
@@ -132,7 +132,7 @@
132132
133 self.proposals = [Thing(133 self.proposals = [Thing(
134 self_link=u'http://api.edge.launchpad.net/devel/proposal0',134 self_link=u'http://api.edge.launchpad.net/devel/proposal0',
135 queue_status=u'Needs Review',135 queue_status=u'Needs review',
136 commit_message=u'Commitable.',136 commit_message=u'Commitable.',
137 source_branch=self.branches[0],137 source_branch=self.branches[0],
138 target_branch=self.branches[1],138 target_branch=self.branches[1],
139139
=== modified file 'tarmac/tests/mock.py'
--- tarmac/tests/mock.py 2010-12-14 14:44:33 +0000
+++ tarmac/tests/mock.py 2010-12-16 04:03:56 +0000
@@ -71,7 +71,7 @@
71 def lp_save(self, *args, **kwargs):71 def lp_save(self, *args, **kwargs):
72 pass72 pass
7373
74 def setStatus(self, status="Needs Review"):74 def setStatus(self, status="Needs review"):
75 self.queue_status = status75 self.queue_status = status
7676
7777
7878
=== modified file 'tarmac/tests/test_commands.py'
--- tarmac/tests/test_commands.py 2010-12-15 16:52:26 +0000
+++ tarmac/tests/test_commands.py 2010-12-16 04:03:56 +0000
@@ -176,7 +176,7 @@
176 # Set up an unapproved proposal for the prerequisite176 # Set up an unapproved proposal for the prerequisite
177 b3_proposal = Thing(177 b3_proposal = Thing(
178 self_link=u'http://api.edge.launchpad.net/devel/proposal3',178 self_link=u'http://api.edge.launchpad.net/devel/proposal3',
179 queue_status=u'Work in Progress',179 queue_status=u'Work in progress',
180 commit_message=u'Commitable.',180 commit_message=u'Commitable.',
181 source_branch=branch3.lp_branch,181 source_branch=branch3.lp_branch,
182 target_branch=self.branches[1],182 target_branch=self.branches[1],
@@ -218,7 +218,7 @@
218 # Set up an unapproved proposal for the prerequisite218 # Set up an unapproved proposal for the prerequisite
219 b3_proposal = Thing(219 b3_proposal = Thing(
220 self_link=u'http://api.edge.launchpad.net/devel/proposal3',220 self_link=u'http://api.edge.launchpad.net/devel/proposal3',
221 queue_status=u'Work in Progress',221 queue_status=u'Work in progress',
222 commit_message=u'Commitable.',222 commit_message=u'Commitable.',
223 source_branch=branch3.lp_branch,223 source_branch=branch3.lp_branch,
224 target_branch=self.branches[1],224 target_branch=self.branches[1],
@@ -260,7 +260,7 @@
260 # Set up an unapproved proposal for the prerequisite260 # Set up an unapproved proposal for the prerequisite
261 b3_proposal = Thing(261 b3_proposal = Thing(
262 self_link=u'http://api.edge.launchpad.net/devel/proposal3',262 self_link=u'http://api.edge.launchpad.net/devel/proposal3',
263 queue_status=u'Work in Progress',263 queue_status=u'Work in progress',
264 commit_message=u'Commitable.',264 commit_message=u'Commitable.',
265 source_branch=branch3.lp_branch,265 source_branch=branch3.lp_branch,
266 target_branch=self.branches[1],266 target_branch=self.branches[1],
@@ -277,7 +277,7 @@
277 b3_proposal,277 b3_proposal,
278 Thing(278 Thing(
279 target_branch=self.branches[1],279 target_branch=self.branches[1],
280 queue_status='Needs Review')]280 queue_status='Needs review')]
281281
282 self.proposals.append(b3_proposal)282 self.proposals.append(b3_proposal)
283 self.proposals[1].prerequisite_branch = branch3.lp_branch283 self.proposals[1].prerequisite_branch = branch3.lp_branch

Subscribers

People subscribed via source and target branches

to all changes: