ietf-tools / bibxml-service

Django-based Web service implementing IETF BibXML APIs
https://bib.ietf.org
BSD 3-Clause "New" or "Revised" License
17 stars 19 forks source link

Improve Datatracker lookup logic #460

Open kesara opened 3 months ago

kesara commented 3 months ago

Describe the issue

This is related to #458

BibXML makes two queries to get I-D information. First, https://datatracker.ietf.org/api/v1/doc/document/<draft name>/. Secondly, https://datatracker.ietf.org/api/v1/submit/submission/<submission id>/. submission id is the last submission in <submissions type="list"> from the first query. THis submissions list can also include failed submissions and if the last submission is a failed submission, BibXML Service will fail to get I-D information.

With the following call, BibXML Service can only get successful submissions.

https://datatracker.ietf.org/api/v1/submit/submission/?format=json&draft__name=<draft name>&state_id=posted

This might also prevent BibXML Service from making two calls to DT.

Code of Conduct

rjsparks commented 3 months ago

Note that not all Documents of type draft have associated Submission objects. (Very old drafts, in particular, will have no Submission data).

>>> Document.objects.filter(type="draft",submission__isnull=True).count()
15543