Project

Profile

Help

Issue #6362

Check for duplicated content happens without plugin input

Added by ttereshc 5 months ago. Updated 4 months ago.

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

Description

Currently, due to #5567, a check is performed in add_content and the error is raised , plugins might want to deal with duplicates themselves at the finalization stage of the repo version creation.

For the cases when a user can't change much (e.g. sync from a remote, copy different versions of the same advisory from multiple repos), Pulp should try its best to solve issues itself without producing an error.

The check can be performed after finalize_repo_version is happened but before a repo version is marked as complete.


Related issues

Related to Pulp - Issue #5567: Content with duplicate repo_key_fields can be added to a repo versionCLOSED - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Related to Pulp - Issue #6217: First repo_version can contain duplicatesNEW<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 7c032a16 View on GitHub
Added by daviddavis 4 months ago

Moving duplicate content check to finalize

fixes #6362 https://pulp.plan.io/issues/6362

Required PR: https://github.com/pulp/pulpcore/pull/599

(cherry picked from commit dc6acb9d60a1d3aa61ff4def99cc12ddd9981076)

History

#1 Updated by ttereshc 5 months ago

  • Description updated (diff)

#2 Updated by ttereshc 5 months ago

  • Related to Issue #5567: Content with duplicate repo_key_fields can be added to a repo version added

#3 Updated by ttereshc 5 months ago

  • Related to Issue #6217: First repo_version can contain duplicates added

#4 Updated by daviddavis 5 months ago

We should either move this check to remove_duplicates[0] which is called from finalize_new_version or roll a new repo util method that plugins can call during finalize to check for duplicates. The latter gives the plugin writer greater flexibility. However, I can't think of a case where a plugin might want to actually have that flexibility.

[0] https://github.com/pulp/pulpcore/blob/747504c019e618dbb5949ead75144f7d1e731cff/pulpcore/plugin/repo_version_utils.py#L16

#5 Updated by daviddavis 5 months ago

Looks like plugins are calling remove_duplicates before resolving content[0]. If we go with updating remove_duplicates, we'll need to move it to the end.

[0] https://github.com/pulp/pulp_rpm/blob/0464c62ff2b157124a1b86e6fab5a8b562d062fe/pulp_rpm/app/models/repository.py#L118

#6 Updated by daviddavis 5 months ago

  • Status changed from NEW to POST
  • Assignee set to daviddavis

#7 Updated by fao89 5 months ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 69

#10 Updated by daviddavis 4 months ago

  • Status changed from POST to MODIFIED

#13 Updated by ttereshc 4 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
  • Sprint/Milestone set to 3.3.0

Please register to edit this issue

Also available in: Atom PDF