Skip to content

Commit 57f6fba

Browse files
committed
Merged in [18276] from housley@vigilsec.com:
Send email to AD when an IETF Last Call expires that contains downrefs. Fixes ietf-tools#2472 - Legacy-Id: 18306 Note: SVN reference [18276] has been migrated to Git commit e0ca07e
2 parents dbd4202 + e0ca07e commit 57f6fba

4 files changed

Lines changed: 58 additions & 1 deletion

File tree

ietf/doc/lastcall.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from ietf.person.models import Person
1010
from ietf.doc.utils import add_state_change_event
1111
from ietf.doc.mails import generate_ballot_writeup, generate_approval_mail, generate_last_call_announcement
12-
from ietf.doc.mails import send_last_call_request, email_last_call_expired
12+
from ietf.doc.mails import send_last_call_request, email_last_call_expired, email_last_call_expired_with_downref
1313

1414
def request_last_call(request, doc):
1515
if not doc.latest_event(type="changed_ballot_writeup_text"):
@@ -65,3 +65,8 @@ def expire_last_call(doc):
6565
doc.save_with_history([e])
6666

6767
email_last_call_expired(doc)
68+
69+
if doc.type_id == 'draft':
70+
lc_text = doc.latest_event(LastCallDocEvent, type="sent_last_call").desc
71+
if "document makes the following downward references" in lc_text:
72+
email_last_call_expired_with_downref(doc, lc_text)

ietf/doc/mails.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,18 @@ def email_last_call_expired(doc):
504504
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url()),
505505
cc = addrs.cc)
506506

507+
def email_last_call_expired_with_downref(doc, last_call_text):
508+
if doc.type_id != 'draft':
509+
return
510+
send_mail(None,
511+
(doc.ad.email().address, ),
512+
"DraftTracker Mail System <iesg-secretary@ietf.org>",
513+
"Review Downrefs From Expired Last Call: %s" % doc.file_tag(),
514+
"doc/mail/downrefs_notice.txt",
515+
dict(last_call_text=last_call_text,
516+
doc=doc,
517+
url=settings.IDTRACKER_BASE_URL + "/downref/add/"))
518+
507519
def email_intended_status_changed(request, doc, text):
508520
(to,cc) = gather_address_lists('doc_intended_status_changed',doc=doc)
509521

ietf/doc/tests_draft.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,31 @@ def test_expire_last_call(self):
794794
self.assertTrue('aread@' in outbox[-1]['To'])
795795
self.assertTrue('draft-ietf-mars-test@' in outbox[-1]['To'])
796796

797+
def test_expire_last_call_with_downref(self):
798+
from ietf.doc.lastcall import get_expired_last_calls, expire_last_call
799+
800+
secretary = Person.objects.get(name="Sec Retary")
801+
ad = Person.objects.get(user__username='ad')
802+
draft = WgDraftFactory(ad=ad,name='draft-ietf-mars-test')
803+
draft.set_state(State.objects.get(used=True, type="draft-iesg", slug="lc"))
804+
805+
e = LastCallDocEvent(doc=draft, rev=draft.rev, type="sent_last_call", by=secretary)
806+
e.text = "Last call sent"
807+
e.desc = "Blah, blah, blah.\n\nThis document makes the following downward references (downrefs):\n ** Downref: Normative reference to an Experimental RFC: RFC 4764"
808+
e.expires = datetime.datetime.now()
809+
e.save()
810+
811+
drafts = list(get_expired_last_calls())
812+
self.assertEqual(len(drafts), 1)
813+
814+
mailbox_before = len(outbox)
815+
expire_last_call(drafts[0])
816+
817+
d = Document.objects.get(name=draft.name)
818+
self.assertEqual(len(outbox), mailbox_before + 2)
819+
self.assertTrue("Review Downrefs From Expired Last Call" in outbox[-1]["Subject"])
820+
self.assertTrue(d.ad.email().address in outbox[-1]['To'])
821+
797822
class IndividualInfoFormsTests(TestCase):
798823

799824
def setUp(self):
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% autoescape off %}
2+
Please DO NOT reply to this email.
3+
4+
I-D: {{ doc.file_tag|safe }}
5+
6+
IETF Last Call recently ended for this Internet-Draft, and the Last Call
7+
included downward references (downrefs).
8+
9+
If the Last Call consensus is that these RFCs are to be added to the
10+
downref registry, then please do so by going to {{ url }}.
11+
12+
The Last Call announcement said...
13+
14+
{{ last_call_text }}
15+
{% endautoescape%}

0 commit comments

Comments
 (0)