feat: Remove document notes from the datatracker (#6387)

* Remove doc.note

* Address comments from @rjsparks

* Consistently display doc notes
This commit is contained in:
Lars Eggert 2023-10-09 20:15:18 +03:00 committed by GitHub
parent 0f16012c73
commit 7dbfc0208a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 31 additions and 174 deletions

View file

@ -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")

View file

@ -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)

View file

@ -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),

View file

@ -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)

View file

@ -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

View file

@ -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 <random@example.com>")
self.assertEqual(submission.replaces, draft.docalias.first().name)
self.assertEqual(submission.state_id, "manual")

View file

@ -14,7 +14,7 @@
{% csrf_token %}
{% bootstrap_form ballot_writeup_form %}
<div class="form-text my-3">
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 %}
<p class="text-danger">
This document has not completed IETF Last Call. Please do not issue the ballot early without good reason.
@ -36,4 +36,4 @@
Back
</a>
</form>
{% endblock %}
{% endblock %}

View file

@ -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)

View file

@ -13,7 +13,7 @@
<form class="mt-3" method="post">
{% csrf_token %}
{% bootstrap_form ballot_writeup_form %}
<div class="form-text mb-3">Working group summary, personnel, IAB note, IESG note, IANA note.</div>
<div class="form-text mb-3">Working group summary, personnel, IANA note.</div>
<button type="submit"
class="btn btn-primary"
name="save_ballot_writeup"

View file

@ -408,32 +408,19 @@
{% endif %}
</td>
</tr>
{% if iesg_state.slug != 'idexists' %}
{% if doc.note or can_edit %}
<tr>
<td></td>
<th scope="row">
IESG note
</th>
<td class="edit">
{% if can_edit and not snapshot %}
<a class="btn btn-primary btn-sm"
href="{% url 'ietf.doc.views_draft.edit_iesg_note' name=doc.name %}">
Edit
</a>
{% endif %}
</td>
<td>
{% if doc.note %}
{{ doc.note|linebreaksbr }}
{% else %}
<span class="text-body-secondary">
(None)
</span>
{% endif %}
</td>
</tr>
{% endif %}
{% if iesg_state.slug != 'idexists' and doc.note %}
<tr>
<td></td>
<th scope="row">
IESG note
</th>
<td class="edit">
{# IESG Notes are historic and read-only now #}
</td>
<td>
{{ doc.notedoc.note|urlize_ietf_docs|linkify|linebreaksbr }}
</td>
</tr>
{% endif %}
<tr>
<td></td>

View file

@ -1,19 +0,0 @@
{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% load django_bootstrap5 %}
{% block title %}Edit IESG note for {{ doc.name }}{% endblock %}
{% block content %}
{% origin %}
<h1>
Edit IESG note
<br>
<small class="text-body-secondary">{{ doc.name }}</small>
</h1>
<form class="mt-3" method="post">
{% csrf_token %}
{% bootstrap_form form %}
<button type="submit" class="btn btn-primary">Save</button>
<a class="btn btn-secondary float-end" href="{{ doc.get_absolute_url }}">Back</a>
</form>
{% endblock %}

View file

@ -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 %}

View file

@ -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 %}
<div class="card mb-3">
<div class="position-absolute top-0 end-0 m-3">{% ballot_icon doc %}</div>
<div class="card-body">
@ -27,7 +27,7 @@
{% if conflictdoc.note %}
<div class="row">
<div class="col-3 text-end fw-bold">Note</div>
<div class="col">{{ conflictdoc.note|linebreaksbr }}</div>
<div class="col">{{ conflictdoc.note|urlize_ietf_docs|linkify|linebreaksbr }}</div>
</div>
{% endif %}
<div class="row">

View file

@ -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 %}

View file

@ -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 %}

View file

@ -93,7 +93,7 @@ Parts Copyright (c) 2009 The IETF Trust, all rights reserved.
<p>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].</p>
{% endif %}
@ -103,7 +103,7 @@ Parts Copyright (c) 2009 The IETF Trust, all rights reserved.
<p>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].</p>
{% endif %}
@ -113,7 +113,7 @@ Parts Copyright (c) 2009 The IETF Trust, all rights reserved.
<p>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].</p>
{% endif %}
@ -123,7 +123,7 @@ Parts Copyright (c) 2009 The IETF Trust, all rights reserved.
<p>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].</p>
Ed. Note, etc.] from [Name that AD].</p>
{% 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.
<p>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].</p>
[RFC Ed. Note, etc.] from [Name that AD].</p>
{% 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.
<p>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].</p>
Ed. Note, etc.] from [Name that AD].</p>
{% endif %}
{% if num|startswith:"3.4.1" or num|startswith:"3.4.2" %}
<p>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?</p>
message to the RFC Editor.</p>
<p>If APPROVED with caveats - The Secretariat will send a standard
no problem message to the RFC Editor that includes the note drafted

View file

@ -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"))