Skip to content

Commit 5fd8ae6

Browse files
authored
feat: summarize all documents in iesg processing (ietf-tools#8878)
* feat: more detailed view of all docs in iesg processing (ietf-tools#8838) * feat: more detailed view of all docs in iesg processing * fix: commit new template * feat: cache the new page for 5m in slowpages * fix: add endcache * fix: load cache tag definition * fix: exclude things not in progress * fix: link to the newer all ad dashboard from the base dashboard * fix: reorder ad go-ahead to before iesg eval on search result pages * fix: add a deprecation warning to the older docs in IESG processing view
1 parent 51f5957 commit 5fd8ae6

7 files changed

Lines changed: 132 additions & 1 deletion

File tree

ietf/doc/tests.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,30 @@ def test_docs_for_ad(self):
403403
self.assertContains(r, discuss_other.doc.name)
404404
self.assertContains(r, block_other.doc.name)
405405

406+
def test_docs_for_iesg(self):
407+
ad1 = RoleFactory(name_id='ad',group__type_id='area',group__state_id='active').person
408+
ad2 = RoleFactory(name_id='ad',group__type_id='area',group__state_id='active').person
409+
410+
draft = IndividualDraftFactory(ad=ad1)
411+
draft.action_holders.set([PersonFactory()])
412+
draft.set_state(State.objects.get(type='draft-iesg', slug='lc'))
413+
rfc = IndividualRfcFactory(ad=ad2)
414+
conflrev = DocumentFactory(type_id='conflrev',ad=ad1)
415+
conflrev.set_state(State.objects.get(type='conflrev', slug='iesgeval'))
416+
statchg = DocumentFactory(type_id='statchg',ad=ad2)
417+
statchg.set_state(State.objects.get(type='statchg', slug='iesgeval'))
418+
charter = CharterFactory(name='charter-ietf-ames',ad=ad1)
419+
charter.set_state(State.objects.get(type='charter', slug='iesgrev'))
420+
421+
r = self.client.get(urlreverse('ietf.doc.views_search.docs_for_iesg'))
422+
self.assertEqual(r.status_code, 200)
423+
self.assertContains(r, draft.name)
424+
self.assertContains(r, escape(draft.action_holders.first().name))
425+
self.assertNotContains(r, rfc.name)
426+
self.assertContains(r, conflrev.name)
427+
self.assertContains(r, statchg.name)
428+
self.assertContains(r, charter.name)
429+
406430
def test_auth48_doc_for_ad(self):
407431
"""Docs in AUTH48 state should have a decoration"""
408432
ad = RoleFactory(name_id='ad', group__type_id='area', group__state_id='active').person

ietf/doc/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
url(r'^ad/?$', views_search.ad_workload),
5454
url(r'^ad/(?P<name>[^/]+)/?$', views_search.docs_for_ad),
5555
url(r'^ad2/(?P<name>[\w.-]+)/$', RedirectView.as_view(url='/doc/ad/%(name)s/', permanent=True)),
56+
url(r'^for_iesg/?$', views_search.docs_for_iesg),
5657
url(r'^rfc-status-changes/?$', views_status_change.rfc_status_changes),
5758
url(r'^start-rfc-status-change/(?:%(name)s/)?$' % settings.URL_REGEXPS, views_status_change.start_rfc_status_change),
5859
url(r'^bof-requests/?$', views_bofreq.bof_requests),

ietf/doc/utils_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,10 @@ def num(i):
299299
"ad-eval",
300300
"lc-req",
301301
"lc",
302+
"goaheadw",
302303
"writeupw",
303304
# "defer", # probably not a useful state to show, since it's rare
304305
"iesg-eva",
305-
"goaheadw",
306306
"approved",
307307
"ann",
308308
],

ietf/doc/views_search.py

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,90 @@ def sort_key(doc):
752752
)
753753

754754

755+
def docs_for_iesg(request):
756+
def sort_key(doc):
757+
dt = doc_type(doc)
758+
dt_key = list(AD_WORKLOAD.keys()).index(dt)
759+
ds = doc_state(doc)
760+
ds_key = AD_WORKLOAD[dt].index(ds) if ds in AD_WORKLOAD[dt] else 99
761+
return dt_key * 100 + ds_key
762+
763+
results, meta = prepare_document_table(
764+
request,
765+
Document.objects.filter(
766+
ad__in=Person.objects.filter(
767+
Q(
768+
role__name__in=("pre-ad", "ad"),
769+
role__group__type="area",
770+
role__group__state="active",
771+
)
772+
)
773+
).exclude(
774+
type_id="rfc",
775+
).exclude(
776+
type_id="draft",
777+
states__type="draft",
778+
states__slug__in=["repl", "rfc"],
779+
).exclude(
780+
type_id="draft",
781+
states__type="draft-iesg",
782+
states__slug__in=["idexists", "rfcqueue"],
783+
).exclude(
784+
type_id="conflrev",
785+
states__type="conflrev",
786+
states__slug__in=["appr-noprob-sent", "appr-reqnopub-sent", "withdraw", "dead"],
787+
).exclude(
788+
type_id="statchg",
789+
states__type="statchg",
790+
states__slug__in=["appr-sent", "dead"],
791+
).exclude(
792+
type_id="charter",
793+
states__type="charter",
794+
states__slug__in=["notrev", "infrev", "approved", "replaced"],
795+
),
796+
max_results=1000,
797+
show_ad_and_shepherd=True,
798+
)
799+
results.sort(key=lambda d: sort_key(d))
800+
801+
# filter out some results
802+
results = [
803+
r
804+
for r in results
805+
if not (
806+
r.type_id == "charter"
807+
and (
808+
r.group.state_id == "abandon"
809+
or r.get_state_slug("charter") == "replaced"
810+
)
811+
)
812+
and not (
813+
r.type_id == "draft"
814+
and (
815+
r.get_state_slug("draft-iesg") == "dead"
816+
or r.get_state_slug("draft") == "repl"
817+
or r.get_state_slug("draft") == "rfc"
818+
)
819+
)
820+
]
821+
822+
_calculate_state_name = get_state_name_calculator()
823+
for d in results:
824+
dt = d.type.slug
825+
d.search_heading = _calculate_state_name(dt, doc_state(d))
826+
if d.search_heading != "RFC":
827+
d.search_heading += f" {doc_type_name(dt)}"
828+
829+
return render(
830+
request,
831+
"doc/drafts_for_iesg.html",
832+
{
833+
"docs": results,
834+
"meta": meta,
835+
},
836+
)
837+
838+
755839
def drafts_in_last_call(request):
756840
lc_state = State.objects.get(type="draft-iesg", slug="lc").pk
757841
form = SearchForm({'by':'state','state': lc_state, 'rfcs':'on', 'activedrafts':'on'})

ietf/templates/doc/ad_list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ <h1>IESG Dashboard</h1>
2929
are only shown to logged-in Area Directors.
3030
</div>
3131
{% endif %}
32+
<p><a href="{% url 'ietf.doc.views_search.docs_for_iesg' %}">Documents in IESG Processing</a></p>
3233
{% for dt in metadata %}
3334
<h2 class="mt-5" id="{{ dt.type.0 }}">{{ dt.type.1 }} State Counts</h2>
3435
<table class="table table-sm table-striped table-bordered tablesorter navskip">
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{% extends "base.html" %}
2+
{# Copyright The IETF Trust 2015, All Rights Reserved #}
3+
{% load origin static %}
4+
{% load cache %}
5+
{% load ietf_filters %}
6+
{% load person_filters %}
7+
{% block pagehead %}
8+
<link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
9+
{% endblock %}
10+
{% block title %}Documents for the IESG{% endblock %}
11+
{% block content %}
12+
{% cache 300 ietf_doc_drafts_for_iesg using="slowpages" %}
13+
{% origin %}
14+
<h1 class="mt-4">Documents for the IESG</h1>
15+
{% include "doc/search/search_results.html" with start_table=True end_table=True %}
16+
{% endcache %}
17+
{% endblock %}
18+
{% block js %}
19+
<script src="{% static "ietf/js/list.js" %}"></script>
20+
{% endblock %}

ietf/templates/doc/drafts_in_iesg_process.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
{% block content %}
1111
{% origin %}
1212
<h1>{{ title }}</h1>
13+
<h2><i class="bi bi-exclamation-triangle"></i>This view is deprecated, and will soon redirect to a <a href="{% url 'ietf.doc.views_search.docs_for_iesg' %}">different representation</a></h2>
1314
<table class="table table-sm table-striped tablesorter">
1415
<thead>
1516
<tr>

0 commit comments

Comments
 (0)