This is a backport of PR #3588 as merged into main (b7a9e20742f06505d250a9ce5915899647726d6c).
This fix (https://github.com/pulp/pulp_rpm/issues/2821) should make the duplicate advisories in a repository version impossible. However, the fix is not covering all the cases. In a rare case, the incoming duplicate advisories are not merged/removed.
This is a backport of PR #3588 as merged into main (b7a9e20742f06505d250a9ce5915899647726d6c).
This fix (https://github.com/pulp/pulp_rpm/issues/2821) should make the duplicate advisories in a repository version impossible. However, the fix is not covering all the cases. In a rare case, the incoming duplicate advisories are not merged/removed.
Please refer to code below: https://github.com/pulp/pulp_rpm/blob/main/pulp_rpm/app/advisory.py#L114-L117
To meet the rare case, the following 2 conditions need to be met:
For example: conflict_advisories = [dup1, dup2, dup3] [], [dup1], []= resolve_advisory_conflict(dup1, dup2) [], [dup1], [] = resolve_advisory_conflict(dup1, dup3)
then the end result of set "content_pks_to_remove" will be equal to [{dup1}] and the end result of set "content_pks_to_add" will be equal to [{dup1}]
and we will end up having dup2 and dup3 associated to the repository version.
Closes #3587
Tests: 3 incoming duplicate advisories in the repository version as below:
Results without this PR is:
Results with this PR is:
Test script: