-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable editorial stream adoption and balloting (#5011)
* feat: enable editorial stream adoption and balloting * fix: bring tests into line with refactor * feat: force intended_std_level to Informational when adopting into a non-ietf stream. * fix: improve blocking position labels and email content * fix: simplify pointer to group on doc main page for rswg docs * fix: recover from merge typos * fix: correct defer and clear ballot behavior * fix: improve publication request access logic * fix: clean up broken editorial state * fix: adjust test to match migrations
- Loading branch information
Showing
37 changed files
with
2,079 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -334,6 +334,9 @@ def generate_publication_request(request, doc): | |
if doc.stream_id == "irtf": | ||
approving_body = "IRSG" | ||
consensus_body = doc.group.acronym.upper() | ||
if doc.stream_id == "editorial": | ||
approving_body = "RSAB" | ||
consensus_body = doc.group.acronym.upper() | ||
else: | ||
approving_body = str(doc.stream) | ||
consensus_body = approving_body | ||
|
@@ -486,6 +489,54 @@ def email_irsg_ballot_closed(request, doc, ballot): | |
"doc/mail/close_irsg_ballot_mail.txt", | ||
) | ||
|
||
def _send_rsab_ballot_email(request, doc, ballot, subject, template): | ||
"""Send email notification when IRSG ballot is issued""" | ||
(to, cc) = gather_address_lists('rsab_ballot_issued', doc=doc) | ||
sender = 'IESG Secretary <[email protected]>' | ||
|
||
active_ballot = doc.active_ballot() | ||
if active_ballot is None: | ||
needed_bps = '' | ||
else: | ||
needed_bps = needed_ballot_positions( | ||
doc, | ||
list(active_ballot.active_balloter_positions().values()) | ||
) | ||
|
||
return send_mail( | ||
request=request, | ||
frm=sender, | ||
to=to, | ||
cc=cc, | ||
subject=subject, | ||
extra={'Reply-To': [sender]}, | ||
template=template, | ||
context=dict( | ||
doc=doc, | ||
doc_url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(), | ||
needed_ballot_positions=needed_bps, | ||
)) | ||
|
||
def email_rsab_ballot_issued(request, doc, ballot): | ||
"""Send email notification when RSAB ballot is issued""" | ||
return _send_rsab_ballot_email( | ||
request, | ||
doc, | ||
ballot, | ||
'RSAB ballot issued: %s to %s'%(doc.file_tag(), std_level_prompt(doc)), | ||
'doc/mail/issue_rsab_ballot_mail.txt', | ||
) | ||
|
||
def email_rsab_ballot_closed(request, doc, ballot): | ||
"""Send email notification when RSAB ballot is closed""" | ||
return _send_rsab_ballot_email( | ||
request, | ||
doc, | ||
ballot, | ||
'RSAB ballot closed: %s to %s'%(doc.file_tag(), std_level_prompt(doc)), | ||
"doc/mail/close_rsab_ballot_mail.txt", | ||
) | ||
|
||
def email_iana(request, doc, to, msg, cc=None): | ||
# fix up message and send it with extra info on doc in headers | ||
import email | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright The IETF Trust 2022, All Rights Reserved | ||
# -*- coding: utf-8 -*- | ||
|
||
from django.db import migrations | ||
|
||
|
||
def forward(apps, schema_editor): | ||
State = apps.get_model("doc", "State") | ||
State.objects.create( | ||
type_id="draft-stream-editorial", | ||
slug="rsab_review", | ||
name="RSAB Review", | ||
desc="RSAB Review", | ||
used=True, | ||
) | ||
BallotPositionName = apps.get_model("name", "BallotPositionName") | ||
BallotPositionName.objects.create(slug="concern", name="Concern", blocking=True) | ||
|
||
BallotType = apps.get_model("doc", "BallotType") | ||
bt = BallotType.objects.create( | ||
doc_type_id="draft", | ||
slug="rsab-approve", | ||
name="RSAB Approve", | ||
question="Is this draft ready for publication in the Editorial stream?", | ||
) | ||
bt.positions.set( | ||
["yes", "concern", "recuse"] | ||
) # See RFC9280 section 3.2.2 list item 9. | ||
|
||
|
||
def reverse(apps, schema_editor): | ||
State = apps.get_model("doc", "State") | ||
State.objects.filter(type_id="draft-stream-editorial", slug="rsab_review").delete() | ||
|
||
Position = apps.get_model("name", "BallotPositionName") | ||
Position.objects.filter(slug="concern").delete() | ||
|
||
BallotType = apps.get_model("doc", "BallotType") | ||
BallotType.objects.filter(slug="irsg-approve").delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("doc", "0048_allow_longer_notify"), | ||
("name", "0045_polls_and_chatlogs"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forward, reverse), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright The IETF Trust 2022, All Rights Reserved | ||
from django.db import migrations | ||
|
||
|
||
def forward(apps, schema_editor): | ||
State = apps.get_model("doc", "State") | ||
StateType = apps.get_model("doc", "StateType") | ||
StateType.objects.create( | ||
slug="draft-stream-editorial", label="Editorial stream state" | ||
) | ||
for slug, name, order in ( | ||
("repl", "Replaced editorial stream document", 0), | ||
("active", "Active editorial stream document", 2), | ||
("rsabpoll", "Editorial stream document under RSAB review", 3), | ||
("pub", "Published RFC", 4), | ||
("dead", "Dead editorial stream document", 5), | ||
): | ||
State.objects.create( | ||
type_id="draft-stream-editorial", | ||
slug=slug, | ||
name=name, | ||
order=order, | ||
used=True, | ||
) | ||
State.objects.filter(type_id="draft-stream-editorial", slug="rsab_review").delete() | ||
|
||
|
||
|
||
def reverse(apps, schema_editor): | ||
State = apps.get_model("doc", "State") | ||
StateType = apps.get_model("doc", "StateType") | ||
State.objects.filter(type_id="draft-stream-editorial").delete() | ||
StateType.objects.filter(slug="draft-stream-editorial").delete() | ||
# Intentionally not trying to return broken rsab_review State object | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("doc", "0049_add_rsab_doc_positions"), | ||
] | ||
|
||
operations = [migrations.RunPython(forward, reverse)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.