Merge ~ubuntu-release/britney/+git/britney2-ubuntu:less-recipients2 into ~ubuntu-release/britney/+git/britney2-ubuntu:master

Proposed by Brian Murray
Status: Merged
Merge reported by: Brian Murray
Merged at revision: 61e32300f36763237bd8f8e86864614d95bb6b64
Proposed branch: ~ubuntu-release/britney/+git/britney2-ubuntu:less-recipients2
Merge into: ~ubuntu-release/britney/+git/britney2-ubuntu:master
Diff against target: 22 lines (+4/-0)
1 file modified
britney2/policies/email.py (+4/-0)
Reviewer Review Type Date Requested Status
Steve Langasek Needs Fixing
Review via email: mp+469139@code.launchpad.net

Description of the change

I was reading britney logs (fun!) and saw the following failure to send an email:

I: [2024-07-10T05:49:41+0000] - python-django-crispy-forms-foundation/1.0.2+ds-1 stuck for 135 days (email last sent at 0 days old, threshold for sending 125 days), emailing
E: [2024-07-10T05:49:41+0000] - Failed to send mail! Is SMTP server running?
E: [2024-07-10T05:49:41+0000] - {'': (501, b'5.1.3 Bad recipient address syntax')}

Looking into it that package was uploaded by "~team+python" which has no gpg keys (https://api.launchpad.net/1.0/~team+python/gpg_keys) so we shouldn't continue trying to find an email address for that user.

Additionally, this stops returning a couple of variables if they are empty.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) :
review: Needs Information
Revision history for this message
Steve Langasek (vorlon) :
248df06... by Brian Murray

Revert "policies/email.py: if there are no gpg entries don't continue"

This reverts commit bc49b74ab765182b27e2d2c3fd5c7c0ff44cd767.

Revision history for this message
Brian Murray (brian-murray) wrote :

It's ready for re-review.

Revision history for this message
Steve Langasek (vorlon) :
review: Needs Fixing
61e3230... by Brian Murray

policies/email.py drop unused import

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/britney2/policies/email.py b/britney2/policies/email.py
2index 349bf91..d62cb60 100644
3--- a/britney2/policies/email.py
4+++ b/britney2/policies/email.py
5@@ -154,6 +154,8 @@ class EmailPolicy(BasePolicy, Rest):
6 if match:
7 addresses.append(match.group(1))
8 address = self.addresses[person] = address_chooser(addresses)
9+ if not address:
10+ return None
11 return address
12 except HTTPError as e:
13 if e.code != 410: # suspended user
14@@ -166,6 +168,8 @@ class EmailPolicy(BasePolicy, Rest):
15 def scrape_gpg_emails(self, people):
16 """Find email addresses from GPG keys."""
17 emails = [self._scrape_gpg_emails(person) for person in (people or [])]
18+ if not emails:
19+ return
20 return [email for email in emails if email is not None]
21
22 def lp_get_emails(self, pkg, version):

Subscribers

People subscribed via source and target branches