Skip to content

Commit 319a202

Browse files
committed
Finish charter milestones support so they're merged in after approval
of the charter, also replace references to WGs in wgcharter with a more generic counterpart so will be easier to add support for RGs if someone ever gets that far (will still need testing and probably some minor adjustments though). - Legacy-Id: 4534
1 parent 8929413 commit 319a202

12 files changed

Lines changed: 194 additions & 132 deletions

File tree

ietf/group/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def save_group_in_history(group):
1212

1313
# save RoleHistory
1414
for role in group.role_set.all():
15-
rh = RoleHistory(name=role.name, group=grouphist, email=role.email, person=role.person)
15+
rh = RoleHistory(name=role.name, group=h, email=role.email, person=role.person)
1616
rh.save()
1717

1818
copy_many_to_many_for_history(h, group)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{% load ietf_filters %}{% autoescape off %}From: The IESG <iesg-secretary@ietf.org>
2-
To: IETF-Announce <ietf-announce@ietf.org>{% if wg.list_email %}
3-
Cc: {{ wg.acronym }} WG <{{ wg.list_email }}> {% endif %}
4-
Subject: WG Action: {{ action_type }} {{ wg.name }} ({{ wg.acronym }})
2+
To: IETF-Announce <ietf-announce@ietf.org>{% if group.list_email %}
3+
Cc: {{ group.acronym }} {{ group.type.name }} <{{ group.list_email }}> {% endif %}
4+
Subject: WG Action: {{ action_type }} {{ group.name }} ({{ group.acronym }})
55

6-
{% filter wordwrap:73 %}{% ifequal action_type "Formed" %}A new IETF working group has been formed in the {{ wg.parent.name }}.{% endifequal %}{% ifequal action_type "Rechartered" %}The {{ wg.name }} ({{ wg.acronym }}) working group in the {{ wg.parent.name }} of the IETF has been rechartered.{% endifequal %} For additional information please contact the Area Directors or the WG Chair{{ chairs|pluralize}}.
6+
{% filter wordwrap:73 %}{% ifequal action_type "Formed" %}A new IETF working group has been formed in the {{ group.parent.name }}.{% endifequal %}{% ifequal action_type "Rechartered" %}The {{ group.name }} ({{ group.acronym }}) working group in the {{ group.parent.name }} of the IETF has been rechartered.{% endifequal %} For additional information please contact the Area Directors or the {{ group.type.name }} Chair{{ chairs|pluralize}}.
77

8-
{% include "wgcharter/wg_info.txt" %}{% endfilter %}{% endautoescape %}
8+
{% include "wgcharter/group_info.txt" %}{% endfilter %}{% endautoescape %}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% load ietf_filters %}{% autoescape off %}
22
{{ text|fill:70 }}
33

4-
WG: {{ wg_url }}
4+
{{ group.type.name}}: {{ group_url }}
55
Charter: {{ charter_url }}
66
{% endautoescape %}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{ group.name }} ({{ group.acronym }})
2+
------------------------------------------------
3+
Current Status: {{ group.state.name }} {{ group.type.name }}
4+
5+
{% if chairs %}Chairs:
6+
{% for r in chairs %} {{ r.person.plain_name }} <{{r.email.address}}>
7+
{% endfor %}
8+
{% endif %}{% if secr %}Secretaries:
9+
{% for r in secr %} {{ r.person.plain_name }} <{{r.email.address}}>
10+
{% endfor %}
11+
{% endif %}{% if techadv %}Technical advisors:
12+
{% for r in techadv %} {{ r.person.plain_name }} <{{r.email.address}}>
13+
{% endfor %}
14+
{% endif %}{% if group.ad %}Assigned Area Director:
15+
{{ group.ad.plain_name }} <{{ ad_email }}>
16+
17+
{% endif %}{% if group.list_email %}Mailing list
18+
Address: {{ group.list_email }}
19+
To Subscribe: {{ group.list_subscribe }}
20+
Archive: {{ group.list_archive }}
21+
{% endif %}
22+
Charter:
23+
24+
{{ charter_text }}
25+
26+
Milestones:
27+
{% for milestone in milestones %} {% if milestone.resolved %}{{ milestone.resolved }} {% else %}{{ milestone.due|date:"M Y" }}{% endif %} - {{ milestone.desc|safe }}
28+
{% endfor %}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{% load ietf_filters %}{% autoescape off %}From: The IESG <iesg-secretary@ietf.org>
2-
To: IETF-Announce <ietf-announce@ietf.org>{% if wg.list_email %}
3-
Cc: {{ wg.acronym }} WG <{{ wg.list_email }}> {% endif %}
4-
Subject: WG Review: {{ wg.name }} ({{ wg.acronym }})
2+
To: IETF-Announce <ietf-announce@ietf.org>{% if group.list_email %}
3+
Cc: {{ group.acronym }} {{ group.type.name }} <{{ group.list_email }}> {% endif %}
4+
Subject: WG Review: {{ group.name }} ({{ group.acronym }})
55

6-
{% filter wordwrap:73 %}{% ifequal review_type "new" %}A new IETF working group has been proposed in the {{ wg.parent.name }}.{% endifequal %}{% ifequal review_type "recharter" %}The {{ wg.name }} ({{wg.acronym}}) working group in the {{ wg.parent.name }} of the IETF is undergoing rechartering.{% endifequal %} The IESG has not made any determination yet. The following draft charter was submitted, and is provided for informational purposes only. Please send your comments to the IESG mailing list (iesg at ietf.org) by {{ review_date }}.
6+
{% filter wordwrap:73 %}{% ifequal review_type "new" %}A new IETF working group has been proposed in the {{ group.parent.name }}.{% endifequal %}{% ifequal review_type "recharter" %}The {{ group.name }} ({{group.acronym}}) working group in the {{ group.parent.name }} of the IETF is undergoing rechartering.{% endifequal %} The IESG has not made any determination yet. The following draft charter was submitted, and is provided for informational purposes only. Please send your comments to the IESG mailing list (iesg at ietf.org) by {{ review_date }}.
77

8-
{% include "wgcharter/wg_info.txt" %}{% endfilter %}{% endautoescape %}
8+
{% include "wgcharter/group_info.txt" %}{% endfilter %}{% endautoescape %}

ietf/templates/wgcharter/search_result_row.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

ietf/templates/wgcharter/submit.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
{% endblock %}
99

1010
{% block title %}
11-
Charter submission for {{ wg.acronym }}
11+
Charter submission for {{ group.acronym }} {{ group.type.name }}
1212
{% endblock %}
1313

1414
{% block content %}
15-
<h1>Charter submission for {{ wg.acronym }}</h1>
15+
<h1>Charter submission for {{ group.acronym }} {{ group.type.name }}</h1>
1616

17-
<p>The text will be submitted as <strong>charter-ietf-{{ wg.acronym }}-{{ next_rev }}</strong></p>
17+
<p>The text will be submitted as <strong>charter-ietf-{{ group.acronym }}-{{ next_rev }}</strong></p>
1818
<form class="edit-info" action="" enctype="multipart/form-data" method="POST">
1919
<table>
2020
{% for field in form.visible_fields %}
@@ -30,7 +30,7 @@ <h1>Charter submission for {{ wg.acronym }}</h1>
3030
<tr>
3131
<td></td>
3232
<td class="actions">
33-
<a href="{% url doc_view name=wg.charter.name %}">Back</a>
33+
<a href="{% url doc_view name=group.charter.name %}">Back</a>
3434
<input type="submit" value="Submit"/>
3535
</td>
3636
</tr>

ietf/templates/wgcharter/wg_info.txt

Lines changed: 0 additions & 28 deletions
This file was deleted.

ietf/wgcharter/mails.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from ietf.person.models import Person
1414
from ietf.wgcharter.utils import *
1515

16-
def email_secretariat(request, wg, type, text):
16+
def email_secretariat(request, group, type, text):
1717
to = ["iesg-secretary@ietf.org"]
1818

1919
types = {}
@@ -24,16 +24,16 @@ def email_secretariat(request, wg, type, text):
2424
types['state-extrev'] = "State changed to External review"
2525
types['state-iesgrev'] = "State changed to IESG review"
2626
types['state-approved'] = "Charter approved"
27-
types['conclude'] = "Request closing of WG"
27+
types['conclude'] = "Request closing of group"
2828

29-
subject = u"Regarding WG %s: %s" % (wg.acronym, types[type])
29+
subject = u"Regarding %s %s: %s" % (group.type.name, group.acronym, types[type])
3030

3131
text = strip_tags(text)
3232
send_mail(request, to, None, subject,
3333
"wgcharter/email_secretariat.txt",
3434
dict(text=text,
35-
wg_url=settings.IDTRACKER_BASE_URL + urlreverse('wg_charter', kwargs=dict(acronym=wg.acronym)),
36-
charter_url=settings.IDTRACKER_BASE_URL + urlreverse('doc_view', kwargs=dict(name=wg.charter.name)),
35+
group_url=settings.IDTRACKER_BASE_URL + urlreverse('wg_charter', kwargs=dict(acronym=group.acronym)),
36+
charter_url=settings.IDTRACKER_BASE_URL + urlreverse('doc_view', kwargs=dict(name=group.charter.name)),
3737
)
3838
)
3939

@@ -62,47 +62,47 @@ def generate_ballot_writeup(request, doc):
6262

6363
return e
6464

65-
def default_action_text(wg, charter, user):
66-
if next_approved_revision(wg.charter.rev) == "01":
65+
def default_action_text(group, charter, user):
66+
if next_approved_revision(group.charter.rev) == "01":
6767
action = "Formed"
6868
else:
6969
action = "Rechartered"
7070

7171
e = WriteupDocEvent(doc=charter, by=user)
7272
e.by = user
7373
e.type = "changed_action_announcement"
74-
e.desc = "WG action text was changed"
74+
e.desc = "%s action text was changed" % group.type.name
7575
e.text = render_to_string("wgcharter/action_text.txt",
76-
dict(wg=wg,
76+
dict(group=group,
7777
charter_url=settings.IDTRACKER_BASE_URL + charter.get_absolute_url(),
7878
charter_text=read_charter_text(charter),
79-
chairs=wg.role_set.filter(name="chair"),
80-
secr=wg.role_set.filter(name="secr"),
81-
techadv=wg.role_set.filter(name="techadv"),
82-
milestones=wg.groupmilestone_set.all(),
83-
ad_email=wg.ad.role_email("ad") if wg.ad else None,
79+
chairs=group.role_set.filter(name="chair"),
80+
secr=group.role_set.filter(name="secr"),
81+
techadv=group.role_set.filter(name="techadv"),
82+
milestones=group.groupmilestone_set.filter(state="charter"),
83+
ad_email=group.ad.role_email("ad") if group.ad else None,
8484
action_type=action,
8585
))
8686

8787
e.save()
8888
return e
8989

90-
def default_review_text(wg, charter, user):
90+
def default_review_text(group, charter, user):
9191
e = WriteupDocEvent(doc=charter, by=user)
9292
e.by = user
9393
e.type = "changed_review_announcement"
94-
e.desc = "WG review text was changed"
94+
e.desc = "%s review text was changed" % group.type.name
9595
e.text = render_to_string("wgcharter/review_text.txt",
96-
dict(wg=wg,
96+
dict(group=group,
9797
charter_url=settings.IDTRACKER_BASE_URL + charter.get_absolute_url(),
9898
charter_text=read_charter_text(charter),
99-
chairs=wg.role_set.filter(name="chair"),
100-
secr=wg.role_set.filter(name="secr"),
101-
techadv=wg.role_set.filter(name="techadv"),
102-
milestones=wg.groupmilestone_set.all(),
103-
ad_email=wg.ad.role_email("ad") if wg.ad else None,
99+
chairs=group.role_set.filter(name="chair"),
100+
secr=group.role_set.filter(name="secr"),
101+
techadv=group.role_set.filter(name="techadv"),
102+
milestones=group.groupmilestone_set.filter(state="charter"),
103+
ad_email=group.ad.role_email("ad") if group.ad else None,
104104
review_date=(datetime.date.today() + datetime.timedelta(weeks=1)).isoformat(),
105-
review_type="new" if wg.state_id == "proposed" else "recharter",
105+
review_type="new" if group.state_id == "proposed" else "recharter",
106106
)
107107
)
108108
e.save()

ietf/wgcharter/tests.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def test_submit_charter(self):
174174
self.assertEquals(f.read(),
175175
"Windows line\nMac line\nUnix line\n" + utf_8_snippet)
176176

177-
class CharterApproveBallotTestCase(django.test.TestCase):
177+
class ApproveCharterTestCase(django.test.TestCase):
178178
fixtures = ['names']
179179

180180
def setUp(self):
@@ -209,6 +209,28 @@ def test_approve(self):
209209

210210
charter.set_state(State.objects.get(type="charter", slug="iesgrev"))
211211

212+
due_date = datetime.date.today() + datetime.timedelta(days=180)
213+
m1 = GroupMilestone.objects.create(group=group,
214+
state_id="active",
215+
desc="Has been copied",
216+
due=due_date,
217+
resolved="")
218+
m2 = GroupMilestone.objects.create(group=group,
219+
state_id="active",
220+
desc="To be deleted",
221+
due=due_date,
222+
resolved="")
223+
m3 = GroupMilestone.objects.create(group=group,
224+
state_id="charter",
225+
desc="Has been copied",
226+
due=due_date,
227+
resolved="")
228+
m4 = GroupMilestone.objects.create(group=group,
229+
state_id="charter",
230+
desc="New charter milestone",
231+
due=due_date,
232+
resolved="")
233+
212234
# normal get
213235
r = self.client.get(url)
214236
self.assertEquals(r.status_code, 200)
@@ -232,3 +254,8 @@ def test_approve(self):
232254
self.assertEquals(len(outbox), mailbox_before + 2)
233255
self.assertTrue("WG Action" in outbox[-1]['Subject'])
234256
self.assertTrue("Charter approved" in outbox[-2]['Subject'])
257+
258+
self.assertEquals(group.groupmilestone_set.filter(state="charter").count(), 0)
259+
self.assertEquals(group.groupmilestone_set.filter(state="active").count(), 2)
260+
self.assertEquals(group.groupmilestone_set.filter(state="active", desc=m1.desc).count(), 1)
261+
self.assertEquals(group.groupmilestone_set.filter(state="active", desc=m4.desc).count(), 1)

0 commit comments

Comments
 (0)