Project

Profile

Help

Issue #3605

Publications can contain published artifacts with duplicate paths

Added by daviddavis over 1 year ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 36

Description

An example

To use pulp_python as an example, I can create a content unit and specify the relative path for the artifact:

https://github.com/pulp/pulp_python/blob/2c6ab8b983877c1b4b7987bb55a8d829059a65b6/README.rst#create-python-content-from-an-artifact

Suppose I create a package with filename Y and relative_path Y. Then I create a package with filename X and relative_path Y (but different artifact). I can then add both to a repo version, publish it, and distribute it. Then I request artifact with relative_path Y. Which content unit's artifact gets served?

pulp_file

In pulp_file we solved this problem by making sure we use the latest content unit's artifact:

https://github.com/pulp/pulp_file/commit/a15d800d48dfaa0e06db1e05505a7d5e852649a8

Other solutions

The problem is that other plugin writers can make the same mistake. In fact, I believe this problem currently exists in pulp_python (although I haven't tested it).

Some solutions:

1. Add validation where content units are added to a repo version and have the same relative_path
2. Add validation to a publication when two published artifacts have the same path
3. Or just document this gotcha and warn plugin writers they need to deal with duplicate relative paths in repo versions/publications.

Associated revisions

Revision 103272ed View on GitHub
Added by jortel@redhat.com over 1 year ago

Add unique constraint to prevent duplicate relative paths in publications.
closes #3605

Revision 103272ed View on GitHub
Added by jortel@redhat.com over 1 year ago

Add unique constraint to prevent duplicate relative paths in publications.
closes #3605

Revision 103272ed View on GitHub
Added by jortel@redhat.com over 1 year ago

Add unique constraint to prevent duplicate relative paths in publications.
closes #3605

History

#1 Updated by daviddavis over 1 year ago

  • Description updated (diff)

#2 Updated by daviddavis over 1 year ago

  • Subject changed from Repository versions can contain content units with non-unique relative paths to Publications can contain published artifacts with duplicate paths

#3 Updated by jortel@redhat.com over 1 year ago

The repository is a generic collection of content and we should be cautious about putting constraints on it. I suggest we add a unique constraint in PublishedFile on (publication, relative_path).

#4 Updated by daviddavis over 1 year ago

+1. Some plugin writer docs would be nice too.

#5 Updated by dalley over 1 year ago

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

#6 Updated by jortel@redhat.com over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to jortel@redhat.com

#7 Updated by jortel@redhat.com over 1 year ago

  • Status changed from ASSIGNED to POST

#8 Updated by jortel@redhat.com over 1 year ago

  • Status changed from POST to MODIFIED

#9 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#10 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF