Skip to content

Commit 0f69f87

Browse files
committed
Skip IANA - Review Needed and Version Changed - Review Needed changes
from IANA as it turns out that the Datatracker is the authoritative source on these states. Also improve logging so that the raw JSON from IANA is dumped, the parsed JSON on imported changes is dumped and we write to syslog before starting a sync script in the notification view. - Legacy-Id: 5800
1 parent 57b0ca9 commit 0f69f87

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

ietf/bin/iana-changes-updates

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ while t < end:
5555
# requests if necessary
5656

5757
text = fetch_changes_json(settings.IANA_SYNC_CHANGES_URL, t, min(end, t + MAX_INTERVAL_ACCEPTED_BY_IANA))
58+
syslog.syslog("Retrieved the JSON: %s" % text)
59+
5860
changes = parse_changes_json(text)
5961
added_events, warnings = update_history_with_changes(changes, send_email=options.send_email)
6062

6163
for e in added_events:
62-
syslog.syslog("Added event for %s %s: %s" % (e.doc_id, e.time, e.desc))
64+
syslog.syslog("Added event for %s %s: %s (parsed json: %s)" % (e.doc_id, e.time, e.desc, e.json))
6365

6466
for w in warnings:
6567
syslog.syslog("WARNING: %s" % w)

ietf/sync/iana.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ def update_history_with_changes(changes, send_email=True):
169169
state = states[kind][c["state"]]
170170
state_type = "draft-iana-%s" % kind
171171

172+
if state.slug in ("need-rev", "changed"):
173+
# the Datatracker is the ultimate source of these
174+
# states, so skip them
175+
continue
176+
172177
e = StateDocEvent.objects.filter(type="changed_state", time=timestamp,
173178
state_type=state_type, state=state)
174179
if not e:
@@ -185,6 +190,8 @@ def update_history_with_changes(changes, send_email=True):
185190
e = add_state_change_event(doc, system, prev_state, state, timestamp)
186191

187192
if e:
193+
# for logging purposes
194+
e.json = c
188195
added_events.append(e)
189196

190197
if not StateDocEvent.objects.filter(doc=doc, time__gt=timestamp, state_type=state_type):

ietf/sync/tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ def test_changes_sync(self):
4545
"state": "IANA Not OK",
4646
"type": "iana_review",
4747
},
48+
{
49+
"time": "2011-10-09 12:00:02",
50+
"doc": draft.name,
51+
"state": "IANA - Review Needed", # this should be skipped
52+
"type": "iana_review",
53+
},
4854
{
4955
"time": "2011-10-09 12:00:00",
5056
"doc": draft.name,

ietf/sync/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ def runscript(name):
7878
out, _ = p.communicate()
7979
return (p.returncode, out)
8080

81+
import syslog
82+
syslog.syslog("Running sync script from notify view POST")
83+
8184
if notification == "protocols":
8285
failed, out = runscript("iana-protocols-updates")
8386

0 commit comments

Comments
 (0)