YangCatalog / backend

YANG Catalog's REST API and internal module processing pipeline
https://yangcatalog.org
Apache License 2.0
2 stars 11 forks source link

Multiple entries with same revision returned on `api/yang-search/v2/module-details/<module-name>` endpoint #750

Closed richardzilincikPantheon closed 1 year ago

richardzilincikPantheon commented 1 year ago

Example from https://yangcatalog.org/api/yang-search/v2/module-details/ietf-alarms

{
    "revisions": [
        {
            "is_rfc": false,
            "revision": "2019-09-11"
        },
        {
            "is_rfc": true,
            "revision": "2019-09-11"
        },
        {
            "is_rfc": false,
            "revision": "2019-04-10"
        },
        {
            "is_rfc": false,
            "revision": "2019-03-21"
        },
        {
            "is_rfc": false,
            "revision": "2018-11-22"
        },
        {
            "is_rfc": false,
            "revision": "2018-11-06"
        }
    ]
}

I've also seen it for other modules which I don't remember right now.

richardzilincikPantheon commented 1 year ago

Another example https://yangcatalog.org/yang-search/module_details/ietf-connectionless-oam-methods

richardzilincikPantheon commented 1 year ago

It seems that this script from https://github.com/YangCatalog/backend/pull/705 somehow didn't work as intended and left some documents without the "rfc" field.

richardzilincikPantheon commented 1 year ago

Searching ES only returns 10 results by default, this means that the 'rfc' property was only set on the first 10 results. Needs to be done through an update by query instead.

richardzilincikPantheon commented 1 year ago

Fixed the script https://gist.github.com/richardzilincikPantheon/e7fa472f1ef9f54988465be93f883238, the issue should be resolved after it's run in production.