feat: Celery task to generate I-D BibXML#10974
Conversation
jennifer-richards
left a comment
There was a problem hiding this comment.
Major thing: I don't see a task, just helpers?
Couple comments inline. Some thought as to how we're going to run this is needed - I think we'll want more nuance than "all the drafts all at once."
| """Return BibXML entry for the given I-D doc""" | ||
| name = "-".join(draft_name.split("-", 2)[1:]) | ||
| date = "" | ||
| if doc.is_dochistory(): |
There was a problem hiding this comment.
I wonder if we should implement DocHistory.pub_date() so that you don't have to branch here
There was a problem hiding this comment.
Yeah, that'll make things easier. But this is the sort of same logic that has been used elsewhere in DT get revisions.
| doc.pub_date = latest_event.time | ||
| date = doc.pub_date.strftime('<date day="%-d" month="%B" year="%Y"/>') |
There was a problem hiding this comment.
I recommend against pseudo-shadowing pub_date this way. It's not a true shadow since a DocHistory doesn't have a pub_date() method, but to a person reading the code it appears to be replacing the method.
I think it's just a temp variable and you don't actually need to attach it to the DocHistory.
There was a problem hiding this comment.
Yeah, happy to improve. I was using the same logic as in
datatracker/ietf/doc/views_doc.py
Lines 1292 to 1295 in 1cccb08
IMO there should be easier way to get the revisions.
There was a problem hiding this comment.
I suspect it's done there for use in a template (where {{ doc.pub_date }} will call the callable if necessary.
|
|
||
|
|
||
| def recreate_id_bibxml(): | ||
| """Creates BibXML for all Internet Drafts.""" |
There was a problem hiding this comment.
I think we probably want to have a way to throttle this, run on subsets, etc. There are many drafts.
There was a problem hiding this comment.
I would imagine this to be a one time thing. So kind of hoping we run this manually as required because it's resource consuming.
There was a problem hiding this comment.
Right, and that resource consumption is actually my worry. This is going to tie up a celery worker for the entire run, and if it fails part way through we have to start over.
Do you have a sense for how long it takes? If it's five minutes, then fine. If it's hours, then we want to be prepared to manage it in more detail
Fixes #10973