From 7dbfc0208a9925e7e68de2e1eddd279780eacfb1 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Mon, 9 Oct 2023 20:15:18 +0300 Subject: [PATCH] feat: Remove document notes from the datatracker (#6387) * Remove doc.note * Address comments from @rjsparks * Consistently display doc notes --- ietf/doc/tests.py | 2 +- ietf/doc/tests_draft.py | 29 +-------- ietf/doc/urls.py | 1 - ietf/doc/views_draft.py | 63 ------------------- ietf/iesg/views.py | 2 - ietf/submit/tests.py | 3 - ietf/templates/doc/ballot/writeupnotes.html | 4 +- ietf/templates/doc/charter/ballot_writeup.txt | 8 --- .../doc/charter/ballot_writeupnotes.html | 2 +- ietf/templates/doc/document_draft.html | 39 ++++-------- ietf/templates/doc/draft/edit_iesg_note.html | 19 ------ ietf/templates/doc/mail/ballot_writeup.txt | 7 --- ietf/templates/iesg/agenda_conflict_doc.html | 4 +- ietf/templates/iesg/agenda_conflict_doc.txt | 3 +- ietf/templates/iesg/agenda_doc.txt | 3 +- ietf/templates/iesg/moderator_doc.html | 15 +++-- ietf/utils/test_data.py | 1 - 17 files changed, 31 insertions(+), 174 deletions(-) delete mode 100644 ietf/templates/doc/draft/edit_iesg_note.html diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index 7e6be2f4f..106ac1782 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -828,7 +828,7 @@ Man Expires September 22, 2015 [Page 3] stream_id=draft.stream_id, group_id=draft.group_id, abstract=draft.abstract,stream=draft.stream, rev=draft.rev, pages=draft.pages, intended_std_level_id=draft.intended_std_level_id, shepherd_id=draft.shepherd_id, ad_id=draft.ad_id, expires=draft.expires, - notify=draft.notify, note=draft.note) + notify=draft.notify) rel = RelatedDocument.objects.create(source=replacement, target=draft.docalias.get(name__startswith="draft"), relationship_id="replaces") diff --git a/ietf/doc/tests_draft.py b/ietf/doc/tests_draft.py index 85efbf1a6..a8c013859 100644 --- a/ietf/doc/tests_draft.py +++ b/ietf/doc/tests_draft.py @@ -362,16 +362,14 @@ class EditInfoTests(TestCase): stream=draft.stream_id, ad=str(new_ad.pk), notify="test@example.com", - note="New note", telechat_date="", )) self.assertEqual(r.status_code, 302) draft = Document.objects.get(name=draft.name) self.assertEqual(draft.ad, new_ad) - self.assertEqual(draft.note, "New note") self.assertTrue(not draft.latest_event(TelechatDocEvent, type="scheduled_for_telechat")) - self.assertEqual(draft.docevent_set.count(), events_before + 3) + self.assertEqual(draft.docevent_set.count(), events_before + 2) self.assertEqual(len(outbox), mailbox_before + 1) self.assertTrue(draft.name in outbox[-1]['Subject']) @@ -386,7 +384,6 @@ class EditInfoTests(TestCase): stream=draft.stream_id, ad=str(draft.ad_id), notify=draft.notify, - note="", ) # get @@ -489,7 +486,6 @@ class EditInfoTests(TestCase): ad=ad.pk, create_in_state=State.objects.get(used=True, type="draft-iesg", slug="watching").pk, notify="test@example.com", - note="This is a note", telechat_date="", )) self.assertEqual(r.status_code, 302) @@ -497,12 +493,11 @@ class EditInfoTests(TestCase): draft = Document.objects.get(name=draft.name) self.assertEqual(draft.get_state_slug("draft-iesg"), "watching") self.assertEqual(draft.ad, ad) - self.assertEqual(draft.note, "This is a note") self.assertTrue(not draft.latest_event(TelechatDocEvent, type="scheduled_for_telechat")) - self.assertEqual(draft.docevent_set.count(), events_before + 5) + self.assertEqual(draft.docevent_set.count(), events_before + 4) self.assertCountEqual(draft.action_holders.all(), [draft.ad]) events = list(draft.docevent_set.order_by('time', 'id')) - self.assertEqual(events[-5].type, "started_iesg_process") + self.assertEqual(events[-4].type, "started_iesg_process") self.assertEqual(len(outbox), mailbox_before+1) self.assertTrue('IESG processing' in outbox[-1]['Subject']) self.assertTrue('draft-ietf-mars-test2@' in outbox[-1]['To']) @@ -518,7 +513,6 @@ class EditInfoTests(TestCase): ad=ad.pk, create_in_state=State.objects.get(used=True, type="draft-iesg", slug="pub-req").pk, notify="test@example.com", - note="This is a note", telechat_date="", )) self.assertEqual(r.status_code, 302) @@ -1043,23 +1037,6 @@ class IndividualInfoFormsTests(TestCase): doc = Document.objects.get(name=self.docname) self.assertEqual(doc.latest_event(TelechatDocEvent, "scheduled_for_telechat").telechat_date,None) - def test_doc_change_iesg_note(self): - url = urlreverse('ietf.doc.views_draft.edit_iesg_note', kwargs=dict(name=self.docname)) - login_testing_unauthorized(self, "secretary", url) - - # get - r = self.client.get(url) - self.assertEqual(r.status_code,200) - q = PyQuery(r.content) - self.assertEqual(len(q('[type=submit]:contains("Save")')),1) - - # post - r = self.client.post(url,dict(note='ZpyQFGmA\r\nZpyQFGmA')) - self.assertEqual(r.status_code,302) - doc = Document.objects.get(name=self.docname) - self.assertEqual(doc.note,'ZpyQFGmA\nZpyQFGmA') - self.assertTrue('ZpyQFGmA' in doc.latest_event(DocEvent,type='added_comment').desc) - def test_doc_change_ad(self): url = urlreverse('ietf.doc.views_draft.edit_ad', kwargs=dict(name=self.docname)) login_testing_unauthorized(self, "secretary", url) diff --git a/ietf/doc/urls.py b/ietf/doc/urls.py index c2addc5c9..a9703d632 100644 --- a/ietf/doc/urls.py +++ b/ietf/doc/urls.py @@ -134,7 +134,6 @@ urlpatterns = [ url(r'^%(name)s/edit/suggested-replaces/$' % settings.URL_REGEXPS, views_draft.review_possibly_replaces), url(r'^%(name)s/edit/status/$' % settings.URL_REGEXPS, views_draft.change_intention), url(r'^%(name)s/edit/telechat/$' % settings.URL_REGEXPS, views_doc.telechat_date), - url(r'^%(name)s/edit/iesgnote/$' % settings.URL_REGEXPS, views_draft.edit_iesg_note), url(r'^%(name)s/edit/ad/$' % settings.URL_REGEXPS, views_draft.edit_ad), url(r'^%(name)s/edit/authors/$' % settings.URL_REGEXPS, views_doc.edit_authors), url(r'^%(name)s/edit/consensus/$' % settings.URL_REGEXPS, views_draft.edit_consensus), diff --git a/ietf/doc/views_draft.py b/ietf/doc/views_draft.py index a71a586ed..5863b64e3 100644 --- a/ietf/doc/views_draft.py +++ b/ietf/doc/views_draft.py @@ -491,7 +491,6 @@ class EditInfoForm(forms.Form): help_text="Separate email addresses with commas.", required=False, ) - note = forms.CharField(widget=forms.Textarea, label="IESG note", required=False, strip=False) 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()'})) returning_item = forms.BooleanField(required=False) @@ -515,9 +514,6 @@ class EditInfoForm(forms.Form): # returning item is rendered non-standard self.standard_fields = [x for x in self.visible_fields() if x.name not in ('returning_item',)] - def clean_note(self): - return self.cleaned_data['note'].replace('\r', '').strip() - def to_iesg(request,name): """ Submit an IETF stream document to the IESG for publication """ doc = get_object_or_404(Document, docalias__name=name, stream='ietf') @@ -715,18 +711,6 @@ def edit_info(request, name): diff('ad', "Responsible AD") diff('notify', "State Change Notice email list") - if r['note'] != doc.note: - if not r['note']: - if doc.note: - changes.append("Note field has been cleared") - else: - if doc.note: - changes.append("Note changed to '%s'" % r['note']) - else: - changes.append("Note added '%s'" % r['note']) - - doc.note = r['note'] - if doc.group.type_id in ("individ", "area"): if not r["area"]: r["area"] = Group.objects.get(type="individ") @@ -769,7 +753,6 @@ def edit_info(request, name): area=doc.group_id, ad=doc.ad_id, notify=doc.notify, - note=doc.note, telechat_date=initial_telechat_date, returning_item=initial_returning_item, ) @@ -862,52 +845,6 @@ def restore_draft_file(request, draft): log.log(" Exception %s when attempting to move %s" % (ex, file)) -class IESGNoteForm(forms.Form): - note = forms.CharField(widget=forms.Textarea, label="IESG note", required=False, strip=False) - - def clean_note(self): - # not munging the database content to use html line breaks -- - # that has caused a lot of pain in the past. - return self.cleaned_data['note'].replace('\r', '').strip() - -@role_required("Area Director", "Secretariat") -def edit_iesg_note(request, name): - doc = get_object_or_404(Document, type="draft", name=name) - login = request.user.person - - initial = dict(note=doc.note) - - if request.method == "POST": - form = IESGNoteForm(request.POST, initial=initial) - - if form.is_valid(): - new_note = form.cleaned_data['note'] - if new_note != doc.note: - if not new_note: - if doc.note: - log_message = "Note field has been cleared" - else: - if doc.note: - log_message = "Note changed to '%s'" % new_note - else: - log_message = "Note added '%s'" % new_note - - c = DocEvent(type="added_comment", doc=doc, rev=doc.rev, by=login) - c.desc = log_message - c.save() - - doc.note = new_note - doc.save_with_history([c]) - - return redirect('ietf.doc.views_doc.document_main', name=doc.name) - else: - form = IESGNoteForm(initial=initial) - - return render(request, 'doc/draft/edit_iesg_note.html', - dict(doc=doc, - form=form, - )) - class ShepherdWriteupUploadForm(forms.Form): content = forms.CharField(widget=forms.Textarea, label="Shepherd writeup", help_text="Edit the shepherd writeup.", required=False, strip=False) txt = forms.FileField(label=".txt format", help_text="Or upload a .txt file.", required=False) diff --git a/ietf/iesg/views.py b/ietf/iesg/views.py index cec22719d..8c2bd7d0e 100644 --- a/ietf/iesg/views.py +++ b/ietf/iesg/views.py @@ -142,8 +142,6 @@ def agenda_json(request, date=None): 'ad':doc.ad.name if doc.ad else None, } - if doc.note: - docinfo['note'] = doc.note defer = doc.active_defer_event() if defer: docinfo['defer-by'] = defer.by.name diff --git a/ietf/submit/tests.py b/ietf/submit/tests.py index ac8988053..0d5626edc 100644 --- a/ietf/submit/tests.py +++ b/ietf/submit/tests.py @@ -355,7 +355,6 @@ class SubmitTests(BaseSubmitTestCase): ad=draft.ad, expires=timezone.now() + datetime.timedelta(days=settings.INTERNET_DRAFT_DAYS_TO_EXPIRE), notify="aliens@example.mars", - note="", ) sug_replaced_draft.set_state(State.objects.get(used=True, type="draft", slug="active")) sug_replaced_alias = DocAlias.objects.create(name=sug_replaced_draft.name) @@ -1413,7 +1412,6 @@ class SubmitTests(BaseSubmitTestCase): "submitter-name": "Some Random Test Person", "submitter-email": "random@example.com", "replaces": [str(draft.docalias.first().pk)], - "edit-note": "no comments", "authors-0-name": "Person 1", "authors-0-email": "person1@example.com", "authors-1-name": "Person 2", @@ -1429,7 +1427,6 @@ class SubmitTests(BaseSubmitTestCase): self.assertEqual(submission.document_date, document_date) self.assertEqual(submission.abstract, "some abstract") self.assertEqual(submission.pages, 123) - self.assertEqual(submission.note, "no comments") self.assertEqual(submission.submitter, "Some Random Test Person ") self.assertEqual(submission.replaces, draft.docalias.first().name) self.assertEqual(submission.state_id, "manual") diff --git a/ietf/templates/doc/ballot/writeupnotes.html b/ietf/templates/doc/ballot/writeupnotes.html index dbbd04dc2..9c52493d8 100644 --- a/ietf/templates/doc/ballot/writeupnotes.html +++ b/ietf/templates/doc/ballot/writeupnotes.html @@ -14,7 +14,7 @@ {% csrf_token %} {% bootstrap_form ballot_writeup_form %}
- 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. + 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. {% if ballot_issue_danger %}

This document has not completed IETF Last Call. Please do not issue the ballot early without good reason. @@ -36,4 +36,4 @@ Back -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/ietf/templates/doc/charter/ballot_writeup.txt b/ietf/templates/doc/charter/ballot_writeup.txt index 552fe65e8..bf753bdfa 100644 --- a/ietf/templates/doc/charter/ballot_writeup.txt +++ b/ietf/templates/doc/charter/ballot_writeup.txt @@ -36,14 +36,6 @@ RFC Editor Note (Insert RFC Editor Note here or remove section) -IRTF Note - - (Insert IRTF Note here or remove section) - -IESG Note - - (Insert IESG Note here or remove section) - IANA Note (Insert IANA Note here or remove section) diff --git a/ietf/templates/doc/charter/ballot_writeupnotes.html b/ietf/templates/doc/charter/ballot_writeupnotes.html index ba15f8974..a202d48b7 100644 --- a/ietf/templates/doc/charter/ballot_writeupnotes.html +++ b/ietf/templates/doc/charter/ballot_writeupnotes.html @@ -13,7 +13,7 @@

{% csrf_token %} {% bootstrap_form ballot_writeup_form %} -
Working group summary, personnel, IAB note, IESG note, IANA note.
+
Working group summary, personnel, IANA note.
- Back -
-{% endblock %} \ No newline at end of file diff --git a/ietf/templates/doc/mail/ballot_writeup.txt b/ietf/templates/doc/mail/ballot_writeup.txt index 7c7209cf6..74871e5a8 100644 --- a/ietf/templates/doc/mail/ballot_writeup.txt +++ b/ietf/templates/doc/mail/ballot_writeup.txt @@ -33,13 +33,6 @@ Personnel Who is the Document Shepherd for this document? Who is the Responsible Area Director? {% endif %} -{% if doc.stream.slug == "irtf" %}IRTF Note - - (Insert IRTF Note here or remove section) -{% elif doc.stream.slug == "ietf" %}IESG Note - - (Insert IESG Note here or remove section) -{% endif %} IANA Note {% if iana %} {% filter wordwrap:"76"|indent:2 %}{{ iana }}{% endfilter %} diff --git a/ietf/templates/iesg/agenda_conflict_doc.html b/ietf/templates/iesg/agenda_conflict_doc.html index ceb84199c..f856ba9bb 100644 --- a/ietf/templates/iesg/agenda_conflict_doc.html +++ b/ietf/templates/iesg/agenda_conflict_doc.html @@ -1,7 +1,7 @@ {# Copyright The IETF Trust 2015, All Rights Reserved #} {% load origin %} {% origin %} -{% load ietf_filters ballot_icon person_filters %} +{% load ietf_filters ballot_icon person_filters textfilters %}
{% ballot_icon doc %}
@@ -27,7 +27,7 @@ {% if conflictdoc.note %}
Note
-
{{ conflictdoc.note|linebreaksbr }}
+
{{ conflictdoc.note|urlize_ietf_docs|linkify|linebreaksbr }}
{% endif %}
diff --git a/ietf/templates/iesg/agenda_conflict_doc.txt b/ietf/templates/iesg/agenda_conflict_doc.txt index 4ff2e3b00..c6be94f8b 100644 --- a/ietf/templates/iesg/agenda_conflict_doc.txt +++ b/ietf/templates/iesg/agenda_conflict_doc.txt @@ -3,6 +3,5 @@ {% filter wordwrap:"68"|indent|indent %}{{ doc.title }}{% endfilter %} {{ conflictdoc.canonical_name }}-{{ conflictdoc.rev }} {% filter wordwrap:"66"|indent:"4" %}{{ conflictdoc.title }} ({{ conflictdoc.stream }}: {{ conflictdoc.intended_std_level }}){% endfilter %} -{% if conflictdoc.note %}{# note: note is not escaped #} {% filter wordwrap:"64"|indent:"6" %}Note: {{ conflictdoc.note|striptags }}{% endfilter %} -{% endif %} Token: {{ doc.ad }} + Token: {{ doc.ad }} {% with doc.active_defer_event as defer %}{% if defer %} Was deferred by {{defer.by}} on {{defer.time|date:"Y-m-d"}}{% endif %}{% endwith %}{% endwith %} diff --git a/ietf/templates/iesg/agenda_doc.txt b/ietf/templates/iesg/agenda_doc.txt index 247d456a5..7e90885d3 100644 --- a/ietf/templates/iesg/agenda_doc.txt +++ b/ietf/templates/iesg/agenda_doc.txt @@ -1,8 +1,7 @@ {% load ietf_filters %}{% with doc.rfc_number as rfc_number %} o {{doc.canonical_name}}{% if not rfc_number %}-{{doc.rev}}{% endif %}{% endwith %}{%if doc.has_rfc_editor_note %} (Has RFC Editor Note){% endif %}{% if doc.stream %} - {{ doc.stream }} stream{% endif %} {% filter wordwrap:"68"|indent|indent %}{{ doc.title }} ({{ doc.intended_std_level }}){% endfilter %} -{% if doc.note %}{# note: note is not escaped #} {% filter wordwrap:"68"|indent|indent %}Note: {{ doc.note|striptags }}{% endfilter %} -{% endif %} Token: {{ doc.ad }}{% if doc.iana_review_state %} + Token: {{ doc.ad }}{% if doc.iana_review_state %} IANA Review: {{ doc.iana_review_state }}{% endif %}{% if doc.consensus %} Consensus: {{ doc.consensus }}{% endif %}{% if doc.lastcall_expires %} Last call expires: {{ doc.lastcall_expires|date:"Y-m-d" }}{% endif %}{% if doc.review_assignments %} diff --git a/ietf/templates/iesg/moderator_doc.html b/ietf/templates/iesg/moderator_doc.html index fb48b75be..3c497858e 100644 --- a/ietf/templates/iesg/moderator_doc.html +++ b/ietf/templates/iesg/moderator_doc.html @@ -93,7 +93,7 @@ Parts Copyright (c) 2009 The IETF Trust, all rights reserved.

If APPROVED with caveats - The Secretariat will send a working group submission, Protocol Action Announcement that includes the - [RFC Editor Note, IESG Note, etc.] to be drafted by [Name that + [RFC Editor Note, etc.] to be drafted by [Name that AD].

{% endif %} @@ -103,7 +103,7 @@ Parts Copyright (c) 2009 The IETF Trust, all rights reserved.

If APPROVED with caveats - The Secretariat will send an individual submission, Protocol Action Announcement that includes - the [RFC Editor Note, IESG Note, etc.] to be drafted by [Name that + the [RFC Editor Note, etc.] to be drafted by [Name that AD].

{% endif %} @@ -113,7 +113,7 @@ Parts Copyright (c) 2009 The IETF Trust, all rights reserved.

If APPROVED with caveats - The Secretariat will send the associated status change Protocol Action Announcements that includes the - [RFC Editor Note, IESG Note, etc.] to be drafted by [Name that + [RFC Editor Note, etc.] to be drafted by [Name that AD].

{% endif %} @@ -123,7 +123,7 @@ Parts Copyright (c) 2009 The IETF Trust, all rights reserved.

If APPROVED with caveats - The Secretariat will send a working group submission Document Action announcement that includes the [RFC - Ed. Note, IESG, note, etc.] from [Name that AD].

+ Ed. Note, etc.] from [Name that AD].

{% endif %} {% if num|startswith:"3.2.1" or num|startswith:"3.2.2" %} @@ -132,7 +132,7 @@ Parts Copyright (c) 2009 The IETF Trust, all rights reserved.

If APPROVED with caveats - The Secretariat will send an individual submission Document Action announcement that includes the - [RFC Ed. Note, IESG, note, etc.] from [Name that AD].

+ [RFC Ed. Note, etc.] from [Name that AD].

{% endif %} {% if num|startswith:"3.3.1" or num|startswith:"3.3.2" %} @@ -141,13 +141,12 @@ Parts Copyright (c) 2009 The IETF Trust, all rights reserved.

If APPROVED with caveats - The Secretariat will send the associated status change Document Action announcements that includes the [RFC - Ed. Note, IESG, note, etc.] from [Name that AD].

+ Ed. Note, etc.] from [Name that AD].

{% endif %} {% if num|startswith:"3.4.1" or num|startswith:"3.4.2" %}

If APPROVED - The Secretariat will send a standard no problem - message to the RFC Editor. [Name of AD] will you supply the text for - the IESG Note?

+ message to the RFC Editor.

If APPROVED with caveats - The Secretariat will send a standard no problem message to the RFC Editor that includes the note drafted diff --git a/ietf/utils/test_data.py b/ietf/utils/test_data.py index 1e7097625..ce5a46995 100644 --- a/ietf/utils/test_data.py +++ b/ietf/utils/test_data.py @@ -306,7 +306,6 @@ def make_test_data(): ad=ad, expires=timezone.now() + datetime.timedelta(days=settings.INTERNET_DRAFT_DAYS_TO_EXPIRE), notify="aliens@example.mars", - note="", ) draft.set_state(State.objects.get(used=True, type="draft", slug="active"))