Merge lp:~statik/tarmac/reject-failures into lp:tarmac

Proposed by Elliot Murphy
Status: Merged
Merged at revision: not available
Proposed branch: lp:~statik/tarmac/reject-failures
Merge into: lp:tarmac
Diff against target: None lines
To merge this branch: bzr merge lp:~statik/tarmac/reject-failures
Reviewer Review Type Date Requested Status
Paul Hummer Needs Fixing
Review via email: mp+4470@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Elliot Murphy (statik) wrote :

Hi Paul,

An important thing to do if the branch fails to merge is to take it out of the approved queue. I think this branch does that, although I'm uncertain about whether setting queue_status works as I expected it to.

Revision history for this message
Paul Hummer (rockstar) wrote :

Hi statik-

  Strangely enough, I was planning on doing this EXACT same thing tonight.
Thanks for taking care of it for me. There's only one issue with this patch,
and I've documented it below. I'm willing to chat about this though, so don't
think it's not open for discussion.

=== modified file 'tarmac/bin.py'
--- a/tarmac/bin.py 2009-03-13 01:56:16 +0000
+++ b/tarmac/bin.py 2009-03-13 21:52:50 +0000
@@ -140,6 +145,12 @@
                     if self.dry_run:
                         print 'Branch failed test command'
                     target_tree.revert()
+ comment = '\n'.join(['Branch failed test command',
+ stdout_value, stderr_value])
+ candidate.createComment(subject="unused", content=comment,
+ vote='Needs Fixing')
+ candidate.queue_status = 'Needs Fixing'
+ candidate.lp_save()

Just a couple of things. I think the subject should be something like 'Branch
failed test command', and then the comment should just be stdout and stderr.
I'm also not sure if we should add the vote here, or just change the status.
All strings need to be unicode (although it still shouldn't affect it). The
queue_status is actually u'Needs review'. I've been trying to brainstorm a
better way to do enumerators, but for now, we just kinda gotta memorize them.

review: Needs Fixing
Revision history for this message
Elliot Murphy (statik) wrote :

Fixed, and pushed revision 55. Thanks for the great feedback!

lp:~statik/tarmac/reject-failures updated
55. By Elliot Murphy

Implemented review feedback.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tarmac/bin.py'
--- tarmac/bin.py 2009-03-13 01:56:16 +0000
+++ tarmac/bin.py 2009-03-13 21:33:40 +0000
@@ -129,7 +129,12 @@
129 if self.test_command:129 if self.test_command:
130 cwd = os.getcwd()130 cwd = os.getcwd()
131 os.chdir(temp_dir)131 os.chdir(temp_dir)
132 retcode = subprocess.call(self.test_command, shell=True)132 proc = subprocess.Popen(self.test_command,
133 shell=True,
134 stdout=subprocess.PIPE,
135 stderr=subprocess.PIPE)
136 stdout_value, stderr_value = proc.communicate()
137 retcode = proc.wait()
133 os.chdir(cwd)138 os.chdir(cwd)
134 if retcode == 0:139 if retcode == 0:
135 if not self.dry_run:140 if not self.dry_run:
@@ -140,6 +145,12 @@
140 if self.dry_run:145 if self.dry_run:
141 print 'Branch failed test command'146 print 'Branch failed test command'
142 target_tree.revert()147 target_tree.revert()
148 comment = '\n'.join(['Branch failed test command',
149 stdout_value, stderr_value])
150 candidate.createComment(subject="unused", content=comment,
151 vote='Needs Fixing')
152 candidate.queue_status = 'Needs Fixing'
153 candidate.lp_save()
143 else:154 else:
144 if not self.dry_run:155 if not self.dry_run:
145 target_tree.commit(commit_message)156 target_tree.commit(commit_message)

Subscribers

People subscribed via source and target branches