-
Notifications
You must be signed in to change notification settings - Fork 378
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: enable editorial stream adoption and balloting #5011
Changes from 1 commit
f18a8a1
03a2391
fd8cd4e
7df17d7
810c21e
b1a4cab
3e4b691
c18b9a5
b306d5f
0038b24
1f998fd
6c9e794
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
|
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), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# 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), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. order is almost a nuisance field. I think we'll have less confusion with this migration as is. We can make order look prettier (to no good effect otherwise) later. |
||
("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, | ||
) | ||
|
||
|
||
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() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("doc", "0049_add_rsab_doc_positions"), | ||
] | ||
|
||
operations = [migrations.RunPython(forward, reverse)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the linter no longer complain about having the first parameter as
obj
instead ofself
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen no complaints, and functionally, self makes less sense than obj given that this is a factory, and this is called by the factory engine at untypical times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok - some places have pylint directives on these lines, but I guess they're obsolete