Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1a67d5e
feat: Total ids on IESG dashboard
May 21, 2024
1d2f48e
IESG I-D code comments
holloway May 21, 2024
d7b986c
Using Robert's query forIESG dashboard total_ids
holloway May 23, 2024
988f73f
Hiding columns in later IESG Dashboard tables
holloway May 23, 2024
3ac855c
Changing IESG dashboard var name to match column table
holloway May 23, 2024
b6fe1e8
Updating IESG pre_pubreqquery
holloway May 23, 2024
4bad230
IESG dashboard prepub req safeParser and graphs
May 27, 2024
2e16d5c
IESG dashboard fixing Playwright API usage
May 27, 2024
cb86c29
IESG dashboard fixing Playwright API usage (2)
May 27, 2024
45f2cd1
Updating .gitignore for /geckodriver.log
May 29, 2024
a360dbb
IESG ad test title
May 31, 2024
d0f7d19
feat: pages left to ballot on [WIP]
Jun 6, 2024
2a4634b
Adding geckodriver.log to gitignore
Jun 6, 2024
74752bb
[WIP] pages left to ballot on
Jun 7, 2024
d6c0f4a
integrating pages left to ballot on WIP
Jun 10, 2024
5fd5caa
Tests for ad pages remaining
Jun 14, 2024
982c744
Setting states to test ballot items
Jun 17, 2024
2729aef
refactor ad_pages_left_to_ballot_on count logic
Jun 17, 2024
6cc306a
WIP tests for pages left to ballot on
Jun 19, 2024
2451165
chore: remove whitespace change
rjsparks Jun 21, 2024
d5aff6f
fix: look into the BallotPositionDocEventObject
rjsparks Jun 21, 2024
8446ad3
chore: remove prints
rjsparks Jun 21, 2024
191ac98
fix: restructure test
rjsparks Jun 21, 2024
6a4feb5
Merge pull request #3 from rjsparks/ad-pages-left-6620
holloway Jun 22, 2024
6bb1e4a
style: fix js code styling
NGPixel Aug 7, 2024
414fcab
feat: pages left to ballot on (#7516)
rjsparks Aug 9, 2024
c4b12d6
feat: IESG table column 'Pre pubreq' (#7462)
rjsparks Aug 9, 2024
2817981
fix: only show graph for ADs/Secretariat
holloway Aug 14, 2024
46d9970
Merge branch 'main' into feat/ad-dash
rjsparks Aug 23, 2024
b12ef2c
Merge branch 'main' into feat/ad-dash
rjsparks Sep 4, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ datatracker.sublime-workspace
/docker/docker-compose.extend-custom.yml
/env
/ghostdriver.log
/geckodriver.log
/htmlcov
/ietf/static/dist-neue
/latest-coverage.json
Expand Down
23 changes: 23 additions & 0 deletions ietf/doc/views_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,29 @@ def _state_to_doc_type(state):
)
ad.buckets = copy.deepcopy(bucket_template)

# https://github.com/ietf-tools/datatracker/issues/4577
docs_via_group_ad = Document.objects.exclude(
group__acronym="none"
).filter(
group__role__name="ad",
group__role__person=ad
).filter(
states__type="draft-stream-ietf",
states__slug__in=["wg-doc","wg-lc","waiting-for-implementation","chair-w","writeupw"]
)

doc_for_ad = Document.objects.filter(ad=ad)

ad.pre_pubreq = (docs_via_group_ad | doc_for_ad).filter(
type="draft"
).filter(
states__type="draft",
states__slug="active"
).filter(
states__type="draft-iesg",
states__slug="idexists"
).distinct().count()

for doc in Document.objects.exclude(type_id="rfc").filter(ad=ad):
dt = doc_type(doc)
state = doc_state(doc)
Expand Down
68 changes: 64 additions & 4 deletions ietf/iesg/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from ietf.doc.models import DocEvent, BallotPositionDocEvent, TelechatDocEvent
from ietf.doc.models import Document, State, RelatedDocument
from ietf.doc.factories import WgDraftFactory, IndividualDraftFactory, ConflictReviewFactory, BaseDocumentFactory, CharterFactory, WgRfcFactory, IndividualRfcFactory
from ietf.doc.factories import BallotDocEventFactory, BallotPositionDocEventFactory, TelechatDocEventFactory, WgDraftFactory, IndividualDraftFactory, ConflictReviewFactory, BaseDocumentFactory, CharterFactory, WgRfcFactory, IndividualRfcFactory
from ietf.doc.utils import create_ballot_if_not_open
from ietf.group.factories import RoleFactory, GroupFactory, DatedGroupMilestoneFactory, DatelessGroupMilestoneFactory
from ietf.group.models import Group, GroupMilestone, Role
Expand All @@ -30,7 +30,6 @@
from ietf.iesg.factories import IESGMgmtItemFactory, TelechatAgendaContentFactory
from ietf.utils.timezone import date_today, DEADLINE_TZINFO


class IESGTests(TestCase):
def test_feed(self):
draft = WgDraftFactory(states=[('draft','active'),('draft-iesg','iesg-eva')],ad=Person.objects.get(user__username='ad'))
Expand Down Expand Up @@ -509,12 +508,13 @@ def test_agenda_documents_txt(self):
def test_agenda_documents(self):
url = urlreverse("ietf.iesg.views.agenda_documents")
r = self.client.get(url)

self.assertEqual(r.status_code, 200)

for k, d in self.telechat_docs.items():
self.assertContains(r, d.name, msg_prefix="%s '%s' not in response" % (k, d.name, ))
self.assertContains(r, d.title, msg_prefix="%s '%s' title not in response" % (k, d.title, ))

self.assertContains(r, d.title, msg_prefix="%s '%s' not in response" % (k, d.title, ))
def test_past_documents(self):
url = urlreverse("ietf.iesg.views.past_documents")
# We haven't put any documents on past telechats, so this should be empty
Expand Down Expand Up @@ -589,6 +589,66 @@ def test_admin_change(self):
draft = Document.objects.get(name="draft-ietf-mars-test")
self.assertEqual(draft.telechat_date(),today)

class IESGAgendaTelechatPagesTests(TestCase):
def setUp(self):
super().setUp()
# make_immutable_test_data made a set of future telechats - only need one
# We'll take the "next" one
self.telechat_date = get_agenda_date()
# make_immutable_test_data made and area with only one ad - give it another
ad = Person.objects.get(user__username="ad")
adrole = Role.objects.get(person=ad, name="ad")
ad2 = RoleFactory(group=adrole.group, name_id="ad").person
self.ads=[ad,ad2]

# Make some drafts
docs = [
WgDraftFactory(pages=2, states=[('draft-iesg','iesg-eva'),]),
IndividualDraftFactory(pages=20, states=[('draft-iesg','iesg-eva'),]),
WgDraftFactory(pages=200, states=[('draft-iesg','iesg-eva'),]),
]
# Put them on the telechat
for doc in docs:
TelechatDocEventFactory(doc=doc, telechat_date=self.telechat_date)
# Give them ballots
ballots = [BallotDocEventFactory(doc=doc) for doc in docs]

# Give the "ad" Area-Director a discuss on one
BallotPositionDocEventFactory(balloter=ad, doc=docs[0], pos_id="discuss", ballot=ballots[0])
# and a "norecord" position on another
BallotPositionDocEventFactory(balloter=ad, doc=docs[1], pos_id="norecord", ballot=ballots[1])
# Now "ad" should have 220 pages left to ballot on.
# Every other ad should have 222 pages left to ballot on.

def test_ad_pages_left_to_ballot_on(self):
url = urlreverse("ietf.iesg.views.agenda_documents")

# A non-AD user won't get "pages left"
response = self.client.get(url)
telechat = response.context["telechats"][0]
self.assertEqual(telechat["date"], self.telechat_date)
self.assertEqual(telechat["ad_pages_left_to_ballot_on"],0)
self.assertNotContains(response,"pages left to ballot on")

username=self.ads[0].user.username
self.assertTrue(self.client.login(username=username, password=f"{username}+password"))

response = self.client.get(url)
telechat = response.context["telechats"][0]
self.assertEqual(telechat["ad_pages_left_to_ballot_on"],220)
self.assertContains(response,"220 pages left to ballot on")

self.client.logout()
username=self.ads[1].user.username
self.assertTrue(self.client.login(username=username, password=f"{username}+password"))

response = self.client.get(url)
telechat = response.context["telechats"][0]
self.assertEqual(telechat["ad_pages_left_to_ballot_on"],222)




class RescheduleOnAgendaTests(TestCase):
def test_reschedule(self):
draft = WgDraftFactory()
Expand Down
22 changes: 17 additions & 5 deletions ietf/iesg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
from ietf.iesg.agenda import get_doc_section


TelechatPageCount = namedtuple('TelechatPageCount',['for_approval','for_action','related'])
TelechatPageCount = namedtuple('TelechatPageCount',['for_approval','for_action','related','ad_pages_left_to_ballot_on'])

def telechat_page_count(date=None, docs=None):
def telechat_page_count(date=None, docs=None, ad=None):
if not date and not docs:
return TelechatPageCount(0, 0, 0)
return TelechatPageCount(0, 0, 0, 0)

if not docs:
candidates = Document.objects.filter(docevent__telechatdocevent__telechat_date=date).distinct()
Expand All @@ -24,7 +24,18 @@ def telechat_page_count(date=None, docs=None):

drafts = [d for d in for_approval if d.type_id == 'draft']

pages_for_approval = sum([d.pages or 0 for d in drafts])
ad_pages_left_to_ballot_on = 0
pages_for_approval = 0

for draft in drafts:
pages_for_approval += draft.pages or 0
if ad:
ballot = draft.active_ballot()
if ballot:
positions = ballot.active_balloter_positions()
ad_position = positions[ad]
if ad_position is None or ad_position.pos_id == "norecord":
ad_pages_left_to_ballot_on += draft.pages or 0

pages_for_action = 0
for d in for_action:
Expand Down Expand Up @@ -53,4 +64,5 @@ def telechat_page_count(date=None, docs=None):

return TelechatPageCount(for_approval=pages_for_approval,
for_action=pages_for_action,
related=related_pages)
related=related_pages,
ad_pages_left_to_ballot_on=ad_pages_left_to_ballot_on)
8 changes: 6 additions & 2 deletions ietf/iesg/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ def handle_reschedule_form(request, doc, dates, status):
return form

def agenda_documents(request):
ad = request.user.person if has_role(request.user, "Area Director") else None

dates = list(TelechatDate.objects.active().order_by('date').values_list("date", flat=True)[:4])

docs_by_date = dict((d, []) for d in dates)
Expand Down Expand Up @@ -389,11 +391,13 @@ def agenda_documents(request):
# the search_result_row view to display them (which expects them)
fill_in_document_table_attributes(docs_by_date[date], have_telechat_date=True)
fill_in_agenda_docs(date, sections, docs_by_date[date])
pages = telechat_page_count(docs=docs_by_date[date]).for_approval

page_count = telechat_page_count(docs=docs_by_date[date], ad=ad)
pages = page_count.for_approval

telechats.append({
"date": date,
"pages": pages,
"ad_pages_left_to_ballot_on": page_count.ad_pages_left_to_ballot_on,
"sections": sorted((num, section) for num, section in sections.items()
if "2" <= num < "5")
})
Expand Down
Loading