Merge lp:~thumper/launchpad/new-reviewer-email-job into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Tim Penhey |
Approved revision: | no longer in the source branch. |
Merge reported by: | Tim Penhey |
Merged at revision: | not available |
Proposed branch: | lp:~thumper/launchpad/new-reviewer-email-job |
Merge into: | lp:launchpad |
Prerequisite: | lp:~thumper/launchpad/code-review-comment-email-job |
Diff against target: |
415 lines (+201/-34) 8 files modified
lib/lp/code/configure.zcml (+10/-0) lib/lp/code/interfaces/branchmergeproposal.py (+19/-0) lib/lp/code/mail/branch.py (+6/-7) lib/lp/code/mail/branchmergeproposal.py (+3/-16) lib/lp/code/mail/tests/test_branch.py (+7/-3) lib/lp/code/mail/tests/test_branchmergeproposal.py (+79/-5) lib/lp/code/model/branchmergeproposal.py (+2/-1) lib/lp/code/model/branchmergeproposaljob.py (+75/-2) |
To merge this branch: | bzr merge lp:~thumper/launchpad/new-reviewer-email-job |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brad Crittenden (community) | code | Approve | |
Review via email: mp+21610@code.launchpad.net |
Description of the change
This branch adds the job to send the notification email for review requests.
lib/lp/
- simple registering of the job and the job source
lib/lp/
- define the interface for the job itself and the utility to create them
lib/lp/
- since the details are now stored in the job, we pass through a few
more details into the BMPMailer.
lib/lp/
- vastly simplify the event listner function.
NOTE: this method is renamed in a later pipe.
lib/lp/
lib/lp/
- since the static constructor function changed the parameters, the tests
also had to be updated.
lib/lp/
- some of the existing tests had to be augmented with job.run in order
to send the email that they were checking before
- other tests are checking the job creation.
lib/lp/
- the implementation of the new job
- just defers to the existing BMPMailer functionality
Hi Tim,
There are some real issues that 'make lint' exposes. Good luck
finding them amongst all of the noise. :)
Otherwise this is a fine branch with the exception of a few items marked below.
Thanks.
--Brad
> === modified file 'lib/lp/ code/interfaces /branchmergepro posal.py' code/interfaces /branchmergepro posal.py 2010-03-29 00:59:29 +0000 code/interfaces /branchmergepro posal.py 2010-03-29 00:59:31 +0000 dEmailJob( IRunnableJob) :
> --- lib/lp/
> +++ lib/lp/
> @@ -613,6 +615,23 @@
> """Create a job to email subscribers about the comment."""
>
>
> +class IReviewRequeste
> + """Interface for the job to sends review request emails."""
> +
> + reviewer = Attribute('The person or team asked to do the review.')
> + requester = Attribute('The person who as asked for the review.')
s/as/has/
> === modified file 'lib/lp/ code/mail/ tests/test_ branchmergeprop osal.py' code/mail/ tests/test_ branchmergeprop osal.py 2010-03-05 03:35:10 +0000 code/mail/ tests/test_ branchmergeprop osal.py 2010-03-29 00:59:31 +0000 self.owner) cationEmail( self): BranchMergeProp osalJob) .find( osalJob, osalJob. branch_ merge_proposal == self.bmp, osalJob. job_type == osalJobType. REVIEW_ REQUEST_ EMAIL)) EmailJob( job) view_creates_ job(self) : makePerson( ) nominateReviewe r(reviewer, self.owner, None) l([], sent_mail) otificationEmai l() l(self. bmp, review_ request_ job.branch_ merge_proposal) l(reviewer, review_ request_ job.reviewer) l(self. bmp.registrant, review_ request_ job.requester) view_email_ content( self): makePerson( ) description = 'This branch is awesome.' nominateReviewe r(reviewer, self.owner, None) otificationEmai l() request_ job.run( )
> --- lib/lp/
> +++ lib/lp/
> @@ -431,6 +437,76 @@
> login_person(
> return person
>
> + def getReviewNotifi
> + """Return the review requested email job for the test's proposal."""
> + [job] = list(
> + IStore(
> + BranchMergeProp
> + BranchMergeProp
> + BranchMergeProp
> + BranchMergeProp
> + return ReviewRequested
> +
> + def test_nominateRe
> + # When a reviewer is nominated, a job is created to send out the
> + # review request email.
> + reviewer = self.factory.
> + pop_notifications()
> + vote_reference = self.bmp.
> + # No email is sent.
> + sent_mail = pop_notifications()
> + self.assertEqua
> + # A job is created.
> + review_request_job = self.getReviewN
> + self.assertEqua
> + self.assertEqua
> + self.assertEqua
> +
> + def test_nominateRe
> + # The email that is sent contains the description of the proposal, and
> + # a link to the proposal.
> + reviewer = self.factory.
> + self.bmp.
> + vote_reference = self.bmp.
> + review_request_job = self.getReviewN
> + review_
> + [sent_mail] = pop_notifications()
> + self.assertEqual(
> + dedent("""\
> + You have been requested to review the proposed merge of %(source)s into %(target)s.
> +
> + This branch is awesome.
> +
> + --
> + %(bmp)s
> + You ...