Skip to content

feat: Celery task to generate I-D BibXML#10974

Open
kesara wants to merge 3 commits into
ietf-tools:feat/bibgenfrom
kesara:feat/bibxml-id
Open

feat: Celery task to generate I-D BibXML#10974
kesara wants to merge 3 commits into
ietf-tools:feat/bibgenfrom
kesara:feat/bibxml-id

Conversation

@kesara

@kesara kesara commented Jun 2, 2026

Copy link
Copy Markdown
Member

Fixes #10973

@kesara kesara marked this pull request as ready for review June 5, 2026 04:22
@kesara kesara requested a review from jennifer-richards June 9, 2026 02:38

@jennifer-richards jennifer-richards left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Comment thread ietf/sync/bibxml.py
"""Return BibXML entry for the given I-D doc"""
name = "-".join(draft_name.split("-", 2)[1:])
date = ""
if doc.is_dochistory():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should implement DocHistory.pub_date() so that you don't have to branch here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that'll make things easier. But this is the sort of same logic that has been used elsewhere in DT get revisions.

Comment thread ietf/sync/bibxml.py
Comment on lines +91 to +92
doc.pub_date = latest_event.time
date = doc.pub_date.strftime('<date day="%-d" month="%B" year="%Y"/>')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, happy to improve. I was using the same logic as in

if doc.is_dochistory():
latest_event = doc.latest_event(type='new_revision', rev=rev)
if latest_event:
doc.pub_date = latest_event.time

IMO there should be easier way to get the revisions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect it's done there for use in a template (where {{ doc.pub_date }} will call the callable if necessary.

Comment thread ietf/sync/bibxml.py


def recreate_id_bibxml():
"""Creates BibXML for all Internet Drafts."""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we probably want to have a way to throttle this, run on subsets, etc. There are many drafts.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants