Merge lp:~abentley/launchpad/safe-branch-upgrade into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 13036 | ||||
Proposed branch: | lp:~abentley/launchpad/safe-branch-upgrade | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
275 lines (+112/-23) 4 files modified
lib/lp/code/model/branchjob.py (+8/-4) lib/lp/code/model/tests/test_branchjob.py (+9/-18) lib/lp/scripts/helpers.py (+42/-1) lib/lp/scripts/tests/test_helpers.py (+53/-0) |
||||
To merge this branch: | bzr merge lp:~abentley/launchpad/safe-branch-upgrade | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Deryck Hodge (community) | code | Approve | |
Review via email: mp+60634@code.launchpad.net |
Commit message
Ensure no transaction during branch upgrade
Description of the change
= Summary =
Fix bug #777958: branch upgrade jobs keep transaction open
== Proposed fix ==
Use a context manager to check for open transactions.
== Pre-implementation notes ==
Pre-and mid-implementation call with deryck.
== Implementation details ==
Implement TransactionFree
must have no transaction active (i.e. long-running operations).
Provide a second contextmanager, TransactionFree
TransactionFree
Also, there were some drive-by lint fixes. Mostly removing unused variables.
== Tests ==
bin/test -t test_helpers -t test_upgrades_
== Demo and Q/A ==
None
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
This looks great. TransactionFree Operation is a nice class for dealing with this. It might be worth sending an email to launchpad-dev about its existence, about how to use it in code and tests, and so people know it's available now.
Cheers,
deryck