From 4b72ced9343fe4430f73208c5f3797499c9a8291 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Fri, 25 Apr 2025 10:46:57 -0500 Subject: [PATCH 1/6] feat: more detailed view of all docs in iesg processing (#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 --- ietf/doc/tests.py | 24 ++++++++++ ietf/doc/urls.py | 1 + ietf/doc/views_search.py | 62 +++++++++++++++++++++++++ ietf/templates/doc/drafts_for_iesg.html | 19 ++++++++ 4 files changed, 106 insertions(+) create mode 100644 ietf/templates/doc/drafts_for_iesg.html diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index d74688f3f6..344c339199 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -403,6 +403,30 @@ def test_docs_for_ad(self): self.assertContains(r, discuss_other.doc.name) self.assertContains(r, block_other.doc.name) + def test_docs_for_iesg(self): + ad1 = RoleFactory(name_id='ad',group__type_id='area',group__state_id='active').person + ad2 = RoleFactory(name_id='ad',group__type_id='area',group__state_id='active').person + + draft = IndividualDraftFactory(ad=ad1) + draft.action_holders.set([PersonFactory()]) + draft.set_state(State.objects.get(type='draft-iesg', slug='lc')) + rfc = IndividualRfcFactory(ad=ad2) + conflrev = DocumentFactory(type_id='conflrev',ad=ad1) + conflrev.set_state(State.objects.get(type='conflrev', slug='iesgeval')) + statchg = DocumentFactory(type_id='statchg',ad=ad2) + statchg.set_state(State.objects.get(type='statchg', slug='iesgeval')) + charter = CharterFactory(name='charter-ietf-ames',ad=ad1) + charter.set_state(State.objects.get(type='charter', slug='iesgrev')) + + r = self.client.get(urlreverse('ietf.doc.views_search.docs_for_iesg')) + self.assertEqual(r.status_code, 200) + self.assertContains(r, draft.name) + self.assertContains(r, escape(draft.action_holders.first().name)) + self.assertContains(r, rfc.name) + self.assertContains(r, conflrev.name) + self.assertContains(r, statchg.name) + self.assertContains(r, charter.name) + def test_auth48_doc_for_ad(self): """Docs in AUTH48 state should have a decoration""" ad = RoleFactory(name_id='ad', group__type_id='area', group__state_id='active').person diff --git a/ietf/doc/urls.py b/ietf/doc/urls.py index 6e2f03a3dc..0fa1a04b49 100644 --- a/ietf/doc/urls.py +++ b/ietf/doc/urls.py @@ -53,6 +53,7 @@ url(r'^ad/?$', views_search.ad_workload), url(r'^ad/(?P[^/]+)/?$', views_search.docs_for_ad), url(r'^ad2/(?P[\w.-]+)/$', RedirectView.as_view(url='/doc/ad/%(name)s/', permanent=True)), + url(r'^for_iesg/?$', views_search.docs_for_iesg), url(r'^rfc-status-changes/?$', views_status_change.rfc_status_changes), url(r'^start-rfc-status-change/(?:%(name)s/)?$' % settings.URL_REGEXPS, views_status_change.start_rfc_status_change), url(r'^bof-requests/?$', views_bofreq.bof_requests), diff --git a/ietf/doc/views_search.py b/ietf/doc/views_search.py index 9e9b5e88dd..70652049bd 100644 --- a/ietf/doc/views_search.py +++ b/ietf/doc/views_search.py @@ -752,6 +752,68 @@ def sort_key(doc): ) +def docs_for_iesg(request): + def sort_key(doc): + dt = doc_type(doc) + dt_key = list(AD_WORKLOAD.keys()).index(dt) + ds = doc_state(doc) + ds_key = AD_WORKLOAD[dt].index(ds) if ds in AD_WORKLOAD[dt] else 99 + return dt_key * 100 + ds_key + + results, meta = prepare_document_table( + request, + Document.objects.filter( + ad__in=Person.objects.filter( + Q( + role__name__in=("pre-ad", "ad"), + role__group__type="area", + role__group__state="active", + ) + ) + ), + max_results=1000, + show_ad_and_shepherd=True, + ) + results.sort(key=lambda d: sort_key(d)) + + # filter out some results + results = [ + r + for r in results + if not ( + r.type_id == "charter" + and ( + r.group.state_id == "abandon" + or r.get_state_slug("charter") == "replaced" + ) + ) + and not ( + r.type_id == "draft" + and ( + r.get_state_slug("draft-iesg") == "dead" + or r.get_state_slug("draft") == "repl" + or r.get_state_slug("draft") == "rfc" + ) + ) + ] + + _calculate_state_name = get_state_name_calculator() + for d in results: + dt = d.type.slug + d.search_heading = _calculate_state_name(dt, doc_state(d)) + if d.search_heading != "RFC": + d.search_heading += f" {doc_type_name(dt)}" + + return render( + request, + "doc/drafts_for_iesg.html", + { + "docs": results, + "meta": meta, + }, + ) + + def drafts_in_last_call(request): lc_state = State.objects.get(type="draft-iesg", slug="lc").pk form = SearchForm({'by':'state','state': lc_state, 'rfcs':'on', 'activedrafts':'on'}) diff --git a/ietf/templates/doc/drafts_for_iesg.html b/ietf/templates/doc/drafts_for_iesg.html new file mode 100644 index 0000000000..6f9c3cee60 --- /dev/null +++ b/ietf/templates/doc/drafts_for_iesg.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} +{# Copyright The IETF Trust 2015, All Rights Reserved #} +{% load origin static %} +{% load ietf_filters %} +{% load person_filters %} +{% block pagehead %} + +{% endblock %} +{% block title %}Documents for the IESG{% endblock %} +{% block content %} + {% cache 300 ietf_doc_drafts_for_iesg using="slowpages" %} + {% origin %} +

Documents for the IESG

+ {% include "doc/search/search_results.html" with start_table=True end_table=True %} + {% endcache %} +{% endblock %} +{% block js %} + +{% endblock %} \ No newline at end of file From 4c97d0e0e115ad01f5756207948435dcdcb93067 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Fri, 25 Apr 2025 11:25:55 -0500 Subject: [PATCH 2/6] fix: load cache tag definition --- ietf/templates/doc/drafts_for_iesg.html | 1 + 1 file changed, 1 insertion(+) diff --git a/ietf/templates/doc/drafts_for_iesg.html b/ietf/templates/doc/drafts_for_iesg.html index 6f9c3cee60..d7a79fb714 100644 --- a/ietf/templates/doc/drafts_for_iesg.html +++ b/ietf/templates/doc/drafts_for_iesg.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {# Copyright The IETF Trust 2015, All Rights Reserved #} {% load origin static %} +{% load cache %} {% load ietf_filters %} {% load person_filters %} {% block pagehead %} From 0f8548023021109a1da5309bacdb6e992a5e2aae Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Thu, 1 May 2025 13:33:54 -0500 Subject: [PATCH 3/6] fix: exclude things not in progress --- ietf/doc/tests.py | 2 +- ietf/doc/views_search.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index 344c339199..1229df46c5 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -422,7 +422,7 @@ def test_docs_for_iesg(self): self.assertEqual(r.status_code, 200) self.assertContains(r, draft.name) self.assertContains(r, escape(draft.action_holders.first().name)) - self.assertContains(r, rfc.name) + self.assertNotContains(r, rfc.name) self.assertContains(r, conflrev.name) self.assertContains(r, statchg.name) self.assertContains(r, charter.name) diff --git a/ietf/doc/views_search.py b/ietf/doc/views_search.py index 70652049bd..3433a9ca31 100644 --- a/ietf/doc/views_search.py +++ b/ietf/doc/views_search.py @@ -770,6 +770,28 @@ def sort_key(doc): role__group__state="active", ) ) + ).exclude( + type_id="rfc", + ).exclude( + type_id="draft", + states__type="draft", + states__slug__in=["repl", "rfc"], + ).exclude( + type_id="draft", + states__type="draft-iesg", + states__slug__in=["idexists", "rfcqueue"], + ).exclude( + type_id="conflrev", + states__type="conflrev", + states__slug__in=["appr-noprob-sent", "appr-reqnopub-sent", "withdraw", "dead"], + ).exclude( + type_id="statchg", + states__type="statchg", + states__slug__in=["appr-sent", "dead"], + ).exclude( + type_id="charter", + states__type="charter", + states__slug__in=["notrev", "infrev", "approved", "replaced"], ), max_results=1000, show_ad_and_shepherd=True, From 1dd41b099777242aa5f9490f11f764dac1d1a149 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Thu, 1 May 2025 13:41:33 -0500 Subject: [PATCH 4/6] fix: link to the newer all ad dashboard from the base dashboard --- ietf/templates/doc/ad_list.html | 1 + 1 file changed, 1 insertion(+) diff --git a/ietf/templates/doc/ad_list.html b/ietf/templates/doc/ad_list.html index a73264c0f3..1d7b6e2b54 100644 --- a/ietf/templates/doc/ad_list.html +++ b/ietf/templates/doc/ad_list.html @@ -29,6 +29,7 @@

IESG Dashboard

are only shown to logged-in Area Directors. {% endif %} +

Documents in IESG Processing

{% for dt in metadata %}

{{ dt.type.1 }} State Counts

From ce4e1d7befea233de2223d1dfdd4885a0b74f44c Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Wed, 14 May 2025 09:48:12 -0500 Subject: [PATCH 5/6] fix: reorder ad go-ahead to before iesg eval on search result pages --- ietf/doc/utils_search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ietf/doc/utils_search.py b/ietf/doc/utils_search.py index 59b64ad307..cfc8a872f8 100644 --- a/ietf/doc/utils_search.py +++ b/ietf/doc/utils_search.py @@ -299,10 +299,10 @@ def num(i): "ad-eval", "lc-req", "lc", + "goaheadw", "writeupw", # "defer", # probably not a useful state to show, since it's rare "iesg-eva", - "goaheadw", "approved", "ann", ], From 34acc2bc492b7fc070c00938f1a00b03f7653bd9 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Wed, 14 May 2025 10:13:19 -0500 Subject: [PATCH 6/6] fix: add a deprecation warning to the older docs in IESG processing view --- ietf/templates/doc/drafts_in_iesg_process.html | 1 + 1 file changed, 1 insertion(+) diff --git a/ietf/templates/doc/drafts_in_iesg_process.html b/ietf/templates/doc/drafts_in_iesg_process.html index f128e528a5..d9b09e984e 100644 --- a/ietf/templates/doc/drafts_in_iesg_process.html +++ b/ietf/templates/doc/drafts_in_iesg_process.html @@ -10,6 +10,7 @@ {% block content %} {% origin %}

{{ title }}

+

This view is deprecated, and will soon redirect to a different representation