Task #4028
closed
Prevent duplicate files in repositories
Status:
CLOSED - CURRENTRELEASE
Description
Prevent the possibility of duplicate files (ie files with the same relative_path) in a single repo version. I think the places we need to check for dupes are after sync and associate.
Steps to reproduce:
http POST http://localhost:24817/pulp/api/v3/repositories/ name=foo
export REPO_HREF=$(http :24817/pulp/api/v3/repositories/ | jq -r '.results[] | select(.name == "foo") | ._href')
echo "blah1" > 1.iso
echo "blah2" > 2.iso
export ART1=$(http --form POST http://localhost:24817/pulp/api/v3/artifacts/ file@./1.iso | jq -r '._href')
export ART2=$(http --form POST http://localhost:24817/pulp/api/v3/artifacts/ file@./2.iso | jq -r '._href')
export CU1=$(http POST http://localhost:24817/pulp/api/v3/content/file/files/ relative_path=1.iso _artifact="$ART1" | jq -r '._href')
export CU2=$(http POST http://localhost:24817/pulp/api/v3/content/file/files/ relative_path=1.iso _artifact="$ART2" | jq -r '._href')
http POST ':24817'$REPO_HREF'versions/' add_content_units:="[\"$CU1\", \"$CU2\"]"
sleep 5
http ":24817${REPO_HREF}versions/1/"
You'll see the count is 2 which indicates that there are two 1.iso files in the repository.
- Blocked by Story #3934: As a plugin writer, I can have a stage that removes duplicates added
- Tracker changed from Issue to Task
- % Done set to 0
- Subject changed from Remove duplicate files from repositories after sync to Prevent duplicate files in repositories
- Description updated (diff)
- Description updated (diff)
- Related to Test #4738: File repositories shouldn't have duplicate files added
- Blocked by Issue #4740: Pulpcore doesn't provide a way to guarantee uniqueness in repo versions added
- Blocked by deleted (Issue #4740: Pulpcore doesn't provide a way to guarantee uniqueness in repo versions)
- Blocked by Issue #3541: Core should not add/remove content to a repository or create a repository_version without plugin input added
- Related to Story #5008: As a user, I can enforce content specific uniqueness constaints in a repo version added
Did not move from Sprint 54 to 55 because this issue needs some planning/grooming and not high enough priority to be done in next 3 week sprint.
- Status changed from NEW to ASSIGNED
- Assignee set to bmbouter
- Sprint set to Sprint 60
Taking as assigned so I can prove pulpcore's implementation as part of fixing 5008. Adding to sprint so everyone is aware.
- Sprint/Milestone set to 0.1.0
- Blocked by deleted (Issue #3541: Core should not add/remove content to a repository or create a repository_version without plugin input)
- Status changed from ASSIGNED to POST
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF
Prevent duplicate
relative_path
filesWhen a RepositoryVersion has another
file.file
added with the samerelative_path
the original one should be removed. This is shown correctly on the RepositoryVersionadded
,removed
fields.This adds a test which uploads two distinct Artifacts, makes them into File content, and then associates one, and then another with a Repo. The second RepositoryVersion should have only 1 file.file content unit in it.
Required PR: https://github.com/pulp/pulpcore/pull/331
https://pulp.plan.io/issues/4028 closes #4028