Project

Profile

Help

Issue #8229

closed

Do not replace advisory if only 'updated_date' has changed

Added by adam.winberg@smhi.se about 3 years ago. Updated almost 3 years ago.

Status:
CLOSED - NOTABUG
Priority:
Low
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

It seems that EPEL sets a new 'updated_date' every day, so when I run my daily sync I get:

    "content_summary": {
        "added": {
            "rpm.advisory": {
                "count": 2540,
                "href": "/pulp/api/v3/content/rpm/advisories/?repository_version_added=/pulp/api/v3/repositories/rpm/rpm/10e51ae6-65c7-42aa-8ab1-ffebdf752500/versions/19/"
            },
            "rpm.package": {
                "count": 6,
                "href": "/pulp/api/v3/content/rpm/packages/?repository_version_added=/pulp/api/v3/repositories/rpm/rpm/10e51ae6-65c7-42aa-8ab1-ffebdf752500/versions/19/"
            }
        },
        "removed": {
            "rpm.advisory": {
                "count": 2536,
                "href": "/pulp/api/v3/content/rpm/advisories/I've tested this and it works?repository_version_removed=/pulp/api/v3/repositories/rpm/rpm/10e51ae6-65c7-42aa-8ab1-ffebdf752500/versions/19/"
            }
        }
    },

Inspecting the advisories, the only thing changed is the 'updated_date' metadata, version and package lists are identical. EPEL seems to set a new 'updated_date' each day on existing advisories, and in such a case there is not much sense in replacing the existing advisory with the 'new' one. I run weekly scripts to copy new advisories to a frozen repo which is a lot harder to do when thousands of new advisories are coming in every day.

I looked at the code ("pulp_rpm/app/advisory.py") and propose that an additional test is made in the "resolve_advisory_conflict" function, a crude example:

    elif not same_dates and pkgs_intersection:
        if same_version and previous_pkglist == added_pkglist:
            # Ignore new advisory if only 'updated_date' has changed
            to_exclude.append(added_advisory.pk)

Also available in: Atom PDF