Merge lp:~sinzui/launchpad/email-authentication-errors into lp:launchpad
Status: | Merged |
---|---|
Approved by: | j.c.sackett |
Approved revision: | no longer in the source branch. |
Merged at revision: | 16051 |
Proposed branch: | lp:~sinzui/launchpad/email-authentication-errors |
Merge into: | lp:launchpad |
Diff against target: |
121 lines (+15/-27) 6 files modified
lib/lp/bugs/mail/errortemplates/unauthenticated-bug-creation.txt (+0/-2) lib/lp/bugs/mail/handler.py (+1/-3) lib/lp/bugs/tests/bugs-emailinterface.txt (+3/-13) lib/lp/services/mail/errortemplates/not-signed.txt (+2/-1) lib/lp/services/mail/helpers.py (+7/-7) lib/lp/services/mail/tests/test_helpers.py (+2/-1) |
To merge this branch: | bzr merge lp:~sinzui/launchpad/email-authentication-errors |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Launchpad code reviewers | Pending | ||
Review via email: mp+126801@code.launchpad.net |
Commit message
send users emails about signing errors.
Description of the change
OOPS-a337346d65f5d5476f10a93df6e3abcb shows a user send a bug report via
email. It was signed with an unknown key. An IOError was raised when
lib/lp/
found. The actual error template is located at
lib/lp/
services.
error_templates arg to get_error_message, but since the helpers module
manages key-not-
passed for error_templates.
-------
RULES
Pre-
* Update services.
to not pass the error_templates arg to get_error_message when
it is working with the special messages.
* I think we need a test for both special error templates that
ensure_
ADDENDUM:
* No callsite uses the no_key_template kwarg. It can be moved
entirely into the method to avoid naming/path confusion.
* The error_template kwarg is used only only once. The wording
between the bugs template and the standard template is a little
different. If I find common wording, we can remove all the kwargs
and the unused bug template.
QA
* Clear the staging mail box.
* send an email to <email address hidden> that is
signed with a key not registered in Lp with this body:
affects gdp
testing 123.
* Check the staging mailbox and verify there is a message stating that
your OpenPGP key isn't imported into Launchpad.
LINT
lib/
lib/
lib/
lib/
lib/
TEST
./bin/test -vvc -t NotWeaklyAuthen
./bin/test -vvc -t bugs-emailinter
IMPLEMENTATION
The initial fix was easy. I added a test based on
test_weakly_
the IOError. I fixed the code to never pass None for error_templates.
lib/
lib/
Then I looked at all the callsites for ensure_
and realised that I can remove no_key_template now, and with a small
change to bugs.mail, I could remove the other two kwargs. I merged the two
not-signed email templates, they are both a single sentence. I liked the
how the bug mail sentence ended so I combined the sentences. I then found
the message was tested twice. I deleted the first test because the section
was not about errors. Once the kwargs were gone, my test was unneeded, so
I deleted it.
Note, I think bugs-emailinter
lp.bugs.mail.tests. We might be able to delete 1,500 lines of code. Once
lib/
lib/
lib/
lib/
lib/