Merge lp:~ursinha/launchpad/auto-approve into lp:launchpad
Status: | Work in progress |
---|---|
Proposed branch: | lp:~ursinha/launchpad/auto-approve |
Merge into: | lp:launchpad |
Diff against target: |
526 lines (+260/-15) 6 files modified
lib/devscripts/autoland.py (+59/-0) lib/devscripts/ec2test/builtins.py (+21/-5) lib/devscripts/ec2test/remote.py (+57/-4) lib/devscripts/ec2test/testrunner.py (+82/-3) lib/devscripts/ec2test/tests/test_remote.py (+3/-2) lib/devscripts/tests/test_autoland.py (+38/-1) |
To merge this branch: | bzr merge lp:~ursinha/launchpad/auto-approve |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | code | Approve | |
Review via email: mp+45850@code.launchpad.net |
Description of the change
These changes implement ec2 land capability to work with the new Launchpad Tarmac merge workflow.
= Summary =
This branch adds the -T (--use-tarmac) option to ec2 land, so when the tests finish, one "tests" vote is added to the merge proposal, and its queue status is set to approved or rejected.
For this to work, I had to add a --mergeproposal
== Tests ==
I've tested the newly created method by adding more tests to test_autoland.py.
./bin/test -vvt devscripts.*
== Demo and Q/A ==
I've tested by running the command in a real merge proposal in Launchpad, using the --dry-run option, to check if the command line is correctly generated by ec2 land.
$ ec2 land <merge_proposal> --force --dry-run --use-tarmac
Should show the command line with the ec2 test --mergeproposal
Unmerged revisions
- 12054. By Ursula Junque
-
Added tests to MergeProposalMe
ssage class - 12053. By Ursula Junque
-
moved MergeProposalMe
ssage to autoland. - 12052. By Ursula Junque
-
moved MergeProposalMe
ssage to autoland.py, where MergeProposal is defined. - 12051. By Ursula Junque
-
Merging latest devel
- 12050. By Ursula Junque
-
fixed spacing
- 12049. By Ursula Junque
-
change parameters when calling Request
- 12048. By Ursula Junque
-
Added a MergeProposalMe
ssage class to represent a signed message to be sent to the MP, changing it according to the test results. - 12047. By Ursula Junque
-
removing the signing phase of merge proposal messages, now it gets both preassembled success/failure messages and decodes as it does with pqm_message
- 12046. By Ursula Junque
-
updated tests and standarized variable and methods names
- 12045. By Ursula Junque
-
adding workaround to ask the user signature before tests start, to after that email the results to the launchpad mp. It also adds that if mergeproposal address is provided, pqm submission is ignored.
So now we're getting "tests" votes? Nice! That's something I've been wanting.
The branch looks good overall, though it wouldn't be me if there weren't some comments.
Some of those are things that need changing. Most of them are mere suggestions. I trust you to get the changes right, so I'm giving you an approval vote. But feel free to ask if you do want them reviewed, of course.
> === modified file 'lib/devscripts /autoland. py' autoland. py 2011-01-04 20:22:39 +0000 autoland. py 2011-01-11 13:08:59 +0000 SERVICE_ ROOT) email_message import EmailMessage
> --- lib/devscripts/
> +++ lib/devscripts/
> @@ -6,6 +6,8 @@
> STAGING_
> from lazr.uri import URI
> from bzrlib.errors import BzrCommandError
> +from bzrlib.
> +from bzrlib.config import GlobalConfig
Those should be in alphabetical order. Which is a drag to keep up. Run utilities/ format- new-and- modified- imports to automate the drudgery.
> @@ -191,6 +193,63 @@ ssage(EmailMess age):
> self._mp.lp_save()
>
>
> +class MergeProposalMe
> +
> + def __init__(self, mail_to, mail_from, successful=None,
> + source_branch=None, gpg_strategy=None):
Our coding standards say the continuation line(s) for the parameters in the method definition (not in calls mind you!) should be indented to the same column as the first parameter.
So the "source_branch" parameter aligns with "self." If this comes through correctly:
def __init__(self, mail_to, mail_from, successful=None,
source_ branch= None, gpg_strategy=None):
> + if successful:
> + self.subject = "Test results: SUCCESS"
> + self.body_text = """
> +Full test results were mailed to the submitter.
> +
> + review approve tests
> + merge approved
> +"""
> + else:
> + self.subject = "Test results: FAILURE"
> + self.body_text = """
> +Full test results were mailed to the submitter.
> +
> + review needsfixing tests
> + merge rejected
> +"""
Getting rid of unwanted indentation in multi-line strings is always a pain. Dedent() alone is not enough because the string starts out with a newline: thus not every line begins with indentation. Personally I consider it a bug but we have to live with it.
One question though: those two body texts are identical in structure and similar in text. How significant is that? If it's something inherent, it may help to abstract away the differences. For example:
if successful:
test_outcome = "SUCCESS"
test_outcome = "FAILURE"
vote = "approve"
status = "approved"
else:
vote = "needsfixing"
status = "rejected"
self.subject = "Test results: %s" % test_outcome
self.body_text = '\n'.join([
"Full test results were mailed to the submitter.",
"",
"review %s tests" % vote,
"merge %s" % status,
])
Mind you, just an example. Another approach might be to create an email template in a separate file, as in lib/lp/ */emailtemplate s. But it hardly seems worth the trouble.
> + self.successful = successful
> + self.source_branch = source_branch
> + self.mail_from = mail_from
> + self.mail_to = mail_...