Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Show docs that an AD hasn't balloted on that need ballots to progress #6075

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 31 additions & 15 deletions ietf/doc/views_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
IESG_BALLOT_ACTIVE_STATES, IESG_STATCHG_CONFLREV_ACTIVE_STATES,
IESG_CHARTER_ACTIVE_STATES )
from ietf.doc.fields import select2_id_doc_name_json
from ietf.doc.utils import get_search_cache_key, augment_events_with_revision
from ietf.doc.utils import get_search_cache_key, augment_events_with_revision, needed_ballot_positions
from ietf.group.models import Group
from ietf.idindex.index import active_drafts_index_by_group
from ietf.name.models import DocTagName, DocTypeName, StreamName
Expand Down Expand Up @@ -705,18 +705,20 @@ def docs_for_ad(request, name):

for d in results:
d.search_heading = ad_dashboard_group(d)
#
# Additional content showing docs with blocking positions by this ad

# Additional content showing docs with blocking positions by this AD,
# and docs that the AD hasn't balloted on that are lacking ballot positions to progress
blocked_docs = []
not_balloted_docs = []
if ad in get_active_ads():
possible_docs = Document.objects.filter(Q(states__type="draft-iesg",
states__slug__in=IESG_BALLOT_ACTIVE_STATES) |
Q(states__type="charter",
states__slug__in=IESG_CHARTER_ACTIVE_STATES) |
Q(states__type__in=("statchg", "conflrev"),
states__slug__in=IESG_STATCHG_CONFLREV_ACTIVE_STATES),
docevent__ballotpositiondocevent__pos__blocking=True,
docevent__ballotpositiondocevent__balloter=ad).distinct()
iesg_docs = Document.objects.filter(Q(states__type="draft-iesg",
states__slug__in=IESG_BALLOT_ACTIVE_STATES) |
Q(states__type="charter",
states__slug__in=IESG_CHARTER_ACTIVE_STATES) |
Q(states__type__in=("statchg", "conflrev"),
states__slug__in=IESG_STATCHG_CONFLREV_ACTIVE_STATES)).distinct()
possible_docs = iesg_docs.filter(docevent__ballotpositiondocevent__pos__blocking=True,
docevent__ballotpositiondocevent__balloter=ad)
for doc in possible_docs:
ballot = doc.active_ballot()
if not ballot:
Expand All @@ -737,12 +739,26 @@ def docs_for_ad(request, name):
if blocked_docs:
blocked_docs.sort(key=lambda d: min(p.time for p in d.blocking_positions if p.balloter==ad), reverse=True)

for d in blocked_docs:
if d.get_base_name() == 'charter-ietf-shmoo-01-04.txt':
print('Is in list')
possible_docs = iesg_docs.exclude(
Q(docevent__ballotpositiondocevent__balloter=ad)
)
for doc in possible_docs:
ballot = doc.active_ballot()
if (
not ballot
or doc.get_state_slug("draft") == "repl"
or (doc.telechat_date() and doc.telechat_date() > timezone.now().date())
):
continue

iesg_ballot_summary = needed_ballot_positions(
doc, list(ballot.active_balloter_positions().values())
)
if re.search(r"\bNeeds\s+\d+", iesg_ballot_summary):
not_balloted_docs.append(doc)

return render(request, 'doc/drafts_for_ad.html', {
'form':form, 'docs':results, 'meta':meta, 'ad_name': ad.plain_name(), 'blocked_docs': blocked_docs
'form':form, 'docs':results, 'meta':meta, 'ad_name': ad.plain_name(), 'blocked_docs': blocked_docs, 'not_balloted_docs': not_balloted_docs
})
def drafts_in_last_call(request):
lc_state = State.objects.get(type="draft-iesg", slug="lc").pk
Expand Down
29 changes: 28 additions & 1 deletion ietf/templates/doc/drafts_for_ad.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,35 @@ <h2 class="mt-4">Blocking positions held by {{ ad_name }}</h2>
{% endfor %}
</tbody>
</table>
<h2 class="mt-4">Documents for {{ ad_name }}</h2>
{% endif %}
{% if not_balloted_docs %}
<h2 class="mt-4">Missing ballot positions for {{ ad_name }}</h2>
<table class="table table-sm table-striped tablesorter">
<thead>
<tr>
<th scope="col" data-sort="document">Document</th>
<th scope="col" data-sort="status">Status</th>
<th scope="col" class="d-none d-sm-table-cell" data-sort="responsible">Responsible AD</th>
</tr>
</thead>
<tbody>
{% for doc in not_balloted_docs %}
<tr>
<td>{{ doc.displayname_with_link }}</td>
{% include "doc/search/status_columns.html" %}
<td class="d-none d-sm-table-cell">
{% if doc.ad %}
{% person_link doc.ad %}
{% else %}
<span class="text-body-secondary">(None)</span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<h2 class="mt-4">Documents for {{ ad_name }}</h2>
{% include "doc/search/search_results.html" with start_table=True end_table=True %}
{% endblock %}
{% block js %}
Expand Down
6 changes: 2 additions & 4 deletions ietf/templates/doc/search/status_columns.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
{% origin %}
{% load ietf_filters ballot_icon person_filters %}
<td class="status">
{% if doc.ballot %}
<div class="float-end ms-1 mb-1" id="ballot-icon-{{ doc.name }}">{% ballot_icon doc %}</div>
{% endif %}
<div class="float-end ms-1 mb-1" id="ballot-icon-{{ doc.name }}">{% ballot_icon doc %}</div>
{% if not doc.get_state_slug == "rfc" %}
{% if '::' in doc.friendly_state %}
{{ doc.friendly_state|safe }}
Expand Down Expand Up @@ -92,4 +90,4 @@
<span class="text-body-secondary">Updated by {{ doc.updated_by_list|join:", "|urlize_ietf_docs }}</span>
{% endif %}
{% endif %}
</td>
</td>
Loading