Merge lp:~gary/tarmac/fix693595 into lp:~launchpad/tarmac/lp-tarmac
Status: | Merged |
---|---|
Approved by: | Gary Poster |
Approved revision: | 390 |
Merged at revision: | 389 |
Proposed branch: | lp:~gary/tarmac/fix693595 |
Merge into: | lp:~launchpad/tarmac/lp-tarmac |
Diff against target: |
364 lines (+157/-90) 4 files modified
tarmac/bin/commands.py (+49/-55) tarmac/branch.py (+34/-20) tarmac/pidfile.py (+36/-12) tarmac/tests/test_commands.py (+38/-3) |
To merge this branch: | bzr merge lp:~gary/tarmac/fix693595 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Diogo Matsubara (community) | Approve | ||
Review via email: mp+45039@code.launchpad.net |
Commit message
[r=matsubara] fix bug 693595 so we can use the commit message plugin currently configured on sapote for SMM.
Description of the change
This branch fixes bug 693595 (in Launchpad's Tarmac fork), so that we can use the commit message plugin currently configured on sapote for SMM. It has test code to show the change.
In the course of fixing this, I discovered that the .throw method of the generator protocol was not being implemented properly. The yield following a thrown exception is always used as the return value to the "throw" call, and the code did not handle this correctly. I needed to fix this error for my changes. This error would have had at least one other effect: after a pre-commit hook rejected a branch, the next branch's pre-commit hook would not have been called. I have not tested it explicitly, though perhaps I should.
Another problem that this fixes is that proposals that had been rejected in pre-commit hooks were being sent as participating proposals to the hook that tests the branch. I don't have an explicit test for that, though I probably should.
A last problem addressed is that pidfiles were being created in a loop, and not deleted until the process died. This caused problems when the loop actually looped. I am still not happy with how our pidfiles are created, but I only handled the high-level problem here by destroying the pidfile at the end of each loop. Tests existed for this, actually, but other logic errors hid the problem.
I discussed the changes with Gary on IRC. Here's the summary. Gary's going to change the small issues I brought up and push the changes. I'm approving the review based on the conversation.
<matsubara> gary_poster, about the review, there's only one thing I didn't quite understand, in lines 150 to 161 how's that yield raising an error?
<matsubara> is that when _fire_merge_hook is called and then generator.throw(e) ?
<gary_poster> yes matsubara
<matsubara> gary_poster, on line 212 you missed a new line between def update_proposal() and the last statement from the previous method
* gary_poster goes to diff, one sec
<gary_poster> matsubara, agreed
<matsubara> gary_poster, lines 119 says the bundle merge hooks is supposed to raise an exception but it doesn't do that anymore
<matsubara> lines 118 to 119
<gary_poster> matsubara: ah, right. I don't think it did before I came along either, but maybe I'm wrong. but yes, that needs to change. I'll make those two changes in just a sec and push a new version for you
<matsubara> cool. thanks