Skip to content

Commit 7dbfc02

Browse files
authored
feat: Remove document notes from the datatracker (ietf-tools#6387)
* Remove doc.note * Address comments from @rjsparks * Consistently display doc notes
1 parent 0f16012 commit 7dbfc02

17 files changed

Lines changed: 31 additions & 174 deletions

ietf/doc/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ def test_document_draft(self):
828828
stream_id=draft.stream_id, group_id=draft.group_id, abstract=draft.abstract,stream=draft.stream, rev=draft.rev,
829829
pages=draft.pages, intended_std_level_id=draft.intended_std_level_id,
830830
shepherd_id=draft.shepherd_id, ad_id=draft.ad_id, expires=draft.expires,
831-
notify=draft.notify, note=draft.note)
831+
notify=draft.notify)
832832
rel = RelatedDocument.objects.create(source=replacement,
833833
target=draft.docalias.get(name__startswith="draft"),
834834
relationship_id="replaces")

ietf/doc/tests_draft.py

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -362,16 +362,14 @@ def test_edit_info(self):
362362
stream=draft.stream_id,
363363
ad=str(new_ad.pk),
364364
notify="test@example.com",
365-
note="New note",
366365
telechat_date="",
367366
))
368367
self.assertEqual(r.status_code, 302)
369368

370369
draft = Document.objects.get(name=draft.name)
371370
self.assertEqual(draft.ad, new_ad)
372-
self.assertEqual(draft.note, "New note")
373371
self.assertTrue(not draft.latest_event(TelechatDocEvent, type="scheduled_for_telechat"))
374-
self.assertEqual(draft.docevent_set.count(), events_before + 3)
372+
self.assertEqual(draft.docevent_set.count(), events_before + 2)
375373
self.assertEqual(len(outbox), mailbox_before + 1)
376374
self.assertTrue(draft.name in outbox[-1]['Subject'])
377375

@@ -386,7 +384,6 @@ def test_edit_telechat_date(self):
386384
stream=draft.stream_id,
387385
ad=str(draft.ad_id),
388386
notify=draft.notify,
389-
note="",
390387
)
391388

392389
# get
@@ -489,20 +486,18 @@ def test_start_iesg_process_on_draft(self):
489486
ad=ad.pk,
490487
create_in_state=State.objects.get(used=True, type="draft-iesg", slug="watching").pk,
491488
notify="test@example.com",
492-
note="This is a note",
493489
telechat_date="",
494490
))
495491
self.assertEqual(r.status_code, 302)
496492

497493
draft = Document.objects.get(name=draft.name)
498494
self.assertEqual(draft.get_state_slug("draft-iesg"), "watching")
499495
self.assertEqual(draft.ad, ad)
500-
self.assertEqual(draft.note, "This is a note")
501496
self.assertTrue(not draft.latest_event(TelechatDocEvent, type="scheduled_for_telechat"))
502-
self.assertEqual(draft.docevent_set.count(), events_before + 5)
497+
self.assertEqual(draft.docevent_set.count(), events_before + 4)
503498
self.assertCountEqual(draft.action_holders.all(), [draft.ad])
504499
events = list(draft.docevent_set.order_by('time', 'id'))
505-
self.assertEqual(events[-5].type, "started_iesg_process")
500+
self.assertEqual(events[-4].type, "started_iesg_process")
506501
self.assertEqual(len(outbox), mailbox_before+1)
507502
self.assertTrue('IESG processing' in outbox[-1]['Subject'])
508503
self.assertTrue('draft-ietf-mars-test2@' in outbox[-1]['To'])
@@ -518,7 +513,6 @@ def test_start_iesg_process_on_draft(self):
518513
ad=ad.pk,
519514
create_in_state=State.objects.get(used=True, type="draft-iesg", slug="pub-req").pk,
520515
notify="test@example.com",
521-
note="This is a note",
522516
telechat_date="",
523517
))
524518
self.assertEqual(r.status_code, 302)
@@ -1043,23 +1037,6 @@ def test_doc_change_telechat_date(self):
10431037
doc = Document.objects.get(name=self.docname)
10441038
self.assertEqual(doc.latest_event(TelechatDocEvent, "scheduled_for_telechat").telechat_date,None)
10451039

1046-
def test_doc_change_iesg_note(self):
1047-
url = urlreverse('ietf.doc.views_draft.edit_iesg_note', kwargs=dict(name=self.docname))
1048-
login_testing_unauthorized(self, "secretary", url)
1049-
1050-
# get
1051-
r = self.client.get(url)
1052-
self.assertEqual(r.status_code,200)
1053-
q = PyQuery(r.content)
1054-
self.assertEqual(len(q('[type=submit]:contains("Save")')),1)
1055-
1056-
# post
1057-
r = self.client.post(url,dict(note='ZpyQFGmA\r\nZpyQFGmA'))
1058-
self.assertEqual(r.status_code,302)
1059-
doc = Document.objects.get(name=self.docname)
1060-
self.assertEqual(doc.note,'ZpyQFGmA\nZpyQFGmA')
1061-
self.assertTrue('ZpyQFGmA' in doc.latest_event(DocEvent,type='added_comment').desc)
1062-
10631040
def test_doc_change_ad(self):
10641041
url = urlreverse('ietf.doc.views_draft.edit_ad', kwargs=dict(name=self.docname))
10651042
login_testing_unauthorized(self, "secretary", url)

ietf/doc/urls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
url(r'^%(name)s/edit/suggested-replaces/$' % settings.URL_REGEXPS, views_draft.review_possibly_replaces),
135135
url(r'^%(name)s/edit/status/$' % settings.URL_REGEXPS, views_draft.change_intention),
136136
url(r'^%(name)s/edit/telechat/$' % settings.URL_REGEXPS, views_doc.telechat_date),
137-
url(r'^%(name)s/edit/iesgnote/$' % settings.URL_REGEXPS, views_draft.edit_iesg_note),
138137
url(r'^%(name)s/edit/ad/$' % settings.URL_REGEXPS, views_draft.edit_ad),
139138
url(r'^%(name)s/edit/authors/$' % settings.URL_REGEXPS, views_doc.edit_authors),
140139
url(r'^%(name)s/edit/consensus/$' % settings.URL_REGEXPS, views_draft.edit_consensus),

ietf/doc/views_draft.py

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,6 @@ class EditInfoForm(forms.Form):
491491
help_text="Separate email addresses with commas.",
492492
required=False,
493493
)
494-
note = forms.CharField(widget=forms.Textarea, label="IESG note", required=False, strip=False)
495494
telechat_date = forms.TypedChoiceField(coerce=lambda x: datetime.datetime.strptime(x, '%Y-%m-%d').date(), empty_value=None, required=False, widget=forms.Select(attrs={'onchange':'make_bold()'}))
496495
returning_item = forms.BooleanField(required=False)
497496

@@ -515,9 +514,6 @@ def __init__(self, *args, **kwargs):
515514
# returning item is rendered non-standard
516515
self.standard_fields = [x for x in self.visible_fields() if x.name not in ('returning_item',)]
517516

518-
def clean_note(self):
519-
return self.cleaned_data['note'].replace('\r', '').strip()
520-
521517
def to_iesg(request,name):
522518
""" Submit an IETF stream document to the IESG for publication """
523519
doc = get_object_or_404(Document, docalias__name=name, stream='ietf')
@@ -715,18 +711,6 @@ def diff(attr, name):
715711
diff('ad', "Responsible AD")
716712
diff('notify', "State Change Notice email list")
717713

718-
if r['note'] != doc.note:
719-
if not r['note']:
720-
if doc.note:
721-
changes.append("Note field has been cleared")
722-
else:
723-
if doc.note:
724-
changes.append("Note changed to '%s'" % r['note'])
725-
else:
726-
changes.append("Note added '%s'" % r['note'])
727-
728-
doc.note = r['note']
729-
730714
if doc.group.type_id in ("individ", "area"):
731715
if not r["area"]:
732716
r["area"] = Group.objects.get(type="individ")
@@ -769,7 +753,6 @@ def diff(attr, name):
769753
area=doc.group_id,
770754
ad=doc.ad_id,
771755
notify=doc.notify,
772-
note=doc.note,
773756
telechat_date=initial_telechat_date,
774757
returning_item=initial_returning_item,
775758
)
@@ -862,52 +845,6 @@ def restore_draft_file(request, draft):
862845
log.log(" Exception %s when attempting to move %s" % (ex, file))
863846

864847

865-
class IESGNoteForm(forms.Form):
866-
note = forms.CharField(widget=forms.Textarea, label="IESG note", required=False, strip=False)
867-
868-
def clean_note(self):
869-
# not munging the database content to use html line breaks --
870-
# that has caused a lot of pain in the past.
871-
return self.cleaned_data['note'].replace('\r', '').strip()
872-
873-
@role_required("Area Director", "Secretariat")
874-
def edit_iesg_note(request, name):
875-
doc = get_object_or_404(Document, type="draft", name=name)
876-
login = request.user.person
877-
878-
initial = dict(note=doc.note)
879-
880-
if request.method == "POST":
881-
form = IESGNoteForm(request.POST, initial=initial)
882-
883-
if form.is_valid():
884-
new_note = form.cleaned_data['note']
885-
if new_note != doc.note:
886-
if not new_note:
887-
if doc.note:
888-
log_message = "Note field has been cleared"
889-
else:
890-
if doc.note:
891-
log_message = "Note changed to '%s'" % new_note
892-
else:
893-
log_message = "Note added '%s'" % new_note
894-
895-
c = DocEvent(type="added_comment", doc=doc, rev=doc.rev, by=login)
896-
c.desc = log_message
897-
c.save()
898-
899-
doc.note = new_note
900-
doc.save_with_history([c])
901-
902-
return redirect('ietf.doc.views_doc.document_main', name=doc.name)
903-
else:
904-
form = IESGNoteForm(initial=initial)
905-
906-
return render(request, 'doc/draft/edit_iesg_note.html',
907-
dict(doc=doc,
908-
form=form,
909-
))
910-
911848
class ShepherdWriteupUploadForm(forms.Form):
912849
content = forms.CharField(widget=forms.Textarea, label="Shepherd writeup", help_text="Edit the shepherd writeup.", required=False, strip=False)
913850
txt = forms.FileField(label=".txt format", help_text="Or upload a .txt file.", required=False)

ietf/iesg/views.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ def agenda_json(request, date=None):
142142
'ad':doc.ad.name if doc.ad else None,
143143
}
144144

145-
if doc.note:
146-
docinfo['note'] = doc.note
147145
defer = doc.active_defer_event()
148146
if defer:
149147
docinfo['defer-by'] = defer.by.name

ietf/submit/tests.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ def submit_new_wg(self, formats):
355355
ad=draft.ad,
356356
expires=timezone.now() + datetime.timedelta(days=settings.INTERNET_DRAFT_DAYS_TO_EXPIRE),
357357
notify="aliens@example.mars",
358-
note="",
359358
)
360359
sug_replaced_draft.set_state(State.objects.get(used=True, type="draft", slug="active"))
361360
sug_replaced_alias = DocAlias.objects.create(name=sug_replaced_draft.name)
@@ -1413,7 +1412,6 @@ def test_edit_submission_and_force_post(self):
14131412
"submitter-name": "Some Random Test Person",
14141413
"submitter-email": "random@example.com",
14151414
"replaces": [str(draft.docalias.first().pk)],
1416-
"edit-note": "no comments",
14171415
"authors-0-name": "Person 1",
14181416
"authors-0-email": "person1@example.com",
14191417
"authors-1-name": "Person 2",
@@ -1429,7 +1427,6 @@ def test_edit_submission_and_force_post(self):
14291427
self.assertEqual(submission.document_date, document_date)
14301428
self.assertEqual(submission.abstract, "some abstract")
14311429
self.assertEqual(submission.pages, 123)
1432-
self.assertEqual(submission.note, "no comments")
14331430
self.assertEqual(submission.submitter, "Some Random Test Person <random@example.com>")
14341431
self.assertEqual(submission.replaces, draft.docalias.first().name)
14351432
self.assertEqual(submission.state_id, "manual")

ietf/templates/doc/ballot/writeupnotes.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1>
1414
{% csrf_token %}
1515
{% bootstrap_form ballot_writeup_form %}
1616
<div class="form-text my-3">
17-
Technical summary, Working Group summary, document quality, personnel, IRTF note, IESG note, IANA note. This text will be appended to all announcements and messages to the IRTF or RFC Editor.
17+
Technical summary, Working Group summary, document quality, personnel, IANA note. This text will be appended to all announcements and messages to the IRTF or RFC Editor.
1818
{% if ballot_issue_danger %}
1919
<p class="text-danger">
2020
This document has not completed IETF Last Call. Please do not issue the ballot early without good reason.
@@ -36,4 +36,4 @@ <h1>
3636
Back
3737
</a>
3838
</form>
39-
{% endblock %}
39+
{% endblock %}

ietf/templates/doc/charter/ballot_writeup.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ RFC Editor Note
3636

3737
(Insert RFC Editor Note here or remove section)
3838

39-
IRTF Note
40-
41-
(Insert IRTF Note here or remove section)
42-
43-
IESG Note
44-
45-
(Insert IESG Note here or remove section)
46-
4739
IANA Note
4840

4941
(Insert IANA Note here or remove section)

ietf/templates/doc/charter/ballot_writeupnotes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>
1313
<form class="mt-3" method="post">
1414
{% csrf_token %}
1515
{% bootstrap_form ballot_writeup_form %}
16-
<div class="form-text mb-3">Working group summary, personnel, IAB note, IESG note, IANA note.</div>
16+
<div class="form-text mb-3">Working group summary, personnel, IANA note.</div>
1717
<button type="submit"
1818
class="btn btn-primary"
1919
name="save_ballot_writeup"

ietf/templates/doc/document_draft.html

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -408,32 +408,19 @@
408408
{% endif %}
409409
</td>
410410
</tr>
411-
{% if iesg_state.slug != 'idexists' %}
412-
{% if doc.note or can_edit %}
413-
<tr>
414-
<td></td>
415-
<th scope="row">
416-
IESG note
417-
</th>
418-
<td class="edit">
419-
{% if can_edit and not snapshot %}
420-
<a class="btn btn-primary btn-sm"
421-
href="{% url 'ietf.doc.views_draft.edit_iesg_note' name=doc.name %}">
422-
Edit
423-
</a>
424-
{% endif %}
425-
</td>
426-
<td>
427-
{% if doc.note %}
428-
{{ doc.note|linebreaksbr }}
429-
{% else %}
430-
<span class="text-body-secondary">
431-
(None)
432-
</span>
433-
{% endif %}
434-
</td>
435-
</tr>
436-
{% endif %}
411+
{% if iesg_state.slug != 'idexists' and doc.note %}
412+
<tr>
413+
<td></td>
414+
<th scope="row">
415+
IESG note
416+
</th>
417+
<td class="edit">
418+
{# IESG Notes are historic and read-only now #}
419+
</td>
420+
<td>
421+
{{ doc.notedoc.note|urlize_ietf_docs|linkify|linebreaksbr }}
422+
</td>
423+
</tr>
437424
{% endif %}
438425
<tr>
439426
<td></td>

0 commit comments

Comments
 (0)