Skip to content

Commit 09e6203

Browse files
committed
Revamp sync from RFC Editor to include more info, fix a couple of bugs
and email the Secretariet when a draft sent to the RFC Editor ends up in the queue, split it up so it's easier to test; also moved the location of the binaries to bin/ - Legacy-Id: 4848
1 parent 8cbdc0b commit 09e6203

9 files changed

Lines changed: 515 additions & 661 deletions

ietf/bin/rfc-editor-index-updates

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python
2+
3+
import os, sys, re, json, datetime
4+
import syslog
5+
6+
syslog.openlog(os.path.basename(__file__), syslog.LOG_PID, syslog.LOG_LOCAL0)
7+
8+
# boilerplate
9+
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
10+
sys.path = [ basedir ] + sys.path
11+
12+
from ietf import settings
13+
from django.core import management
14+
management.setup_environ(settings)
15+
16+
17+
from ietf.sync.rfceditor import *
18+
19+
syslog.syslog("Updating document metadata from RFC index from %s" % QUEUE_URL)
20+
21+
response = fetch_index_xml(INDEX_URL)
22+
data = parse_index(response)
23+
24+
if len(data) < MIN_INDEX_RESULTS:
25+
syslog.syslog("Not enough results, only %s" % len(data))
26+
sys.exit(1)
27+
28+
changed = update_docs_from_rfc_index(data)
29+
for c in changed:
30+
syslog.syslog(c)

ietf/bin/rfc-editor-queue-updates

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env python
2+
3+
import os, sys, re, json, datetime
4+
import syslog
5+
6+
syslog.openlog(os.path.basename(__file__), syslog.LOG_PID, syslog.LOG_LOCAL0)
7+
8+
# boilerplate
9+
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
10+
sys.path = [ basedir ] + sys.path
11+
12+
from ietf import settings
13+
from django.core import management
14+
management.setup_environ(settings)
15+
16+
17+
from ietf.sync.rfceditor import *
18+
19+
syslog.syslog("Updating RFC Editor queue states from %s" % QUEUE_URL)
20+
21+
response = fetch_queue_xml(QUEUE_URL)
22+
drafts, warnings = parse_queue(response)
23+
for w in warnings:
24+
syslog.syslog(u"WARNING: %s" % w)
25+
26+
if len(drafts) < MIN_QUEUE_RESULTS:
27+
syslog.syslog("Not enough results, only %s" % len(drafts))
28+
sys.exit(1)
29+
30+
changed, warnings = update_drafts_from_queue(drafts)
31+
for w in warnings:
32+
syslog.syslog(u"WARNING: %s" % w)
33+
34+
for c in changed:
35+
syslog.syslog(u"Updated %s" % c)

ietf/idrfc/idrfc_wrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ def rfc_editor_state(self):
125125
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
126126
s = self._draft.get_state("draft-rfceditor")
127127
if s:
128-
# extract possible extra states
129-
tags = self._draft.tags.filter(slug__in=("iana-crd", "ref", "missref"))
130-
return " ".join([s.name] + [t.slug.replace("-crd", "").upper() for t in tags])
128+
# extract possible extra annotations
129+
tags = self._draft.tags.filter(slug__in=("iana", "ref"))
130+
return "*".join([s.name] + [t.slug.upper() for t in tags])
131131
else:
132132
return None
133133

ietf/idrfc/mirror_rfc_editor_queue.py

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

0 commit comments

Comments
 (0)