Task #4028
closedPrevent duplicate files in repositories
100%
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.
Related issues
Updated by daviddavis over 6 years ago
- Blocked by Story #3934: As a plugin writer, I can have a stage that removes duplicates added
Updated by daviddavis over 6 years ago
- Tracker changed from Issue to Task
- % Done set to 0
Updated by daviddavis over 6 years ago
- Subject changed from Remove duplicate files from repositories after sync to Prevent duplicate files in repositories
- Description updated (diff)
Updated by daviddavis over 5 years ago
When publishing we sort by created when building the manifest file[0] as #4731 points out. We should look at removing this code since it won't be needed anymore.
Updated by daviddavis over 5 years ago
- Related to Test #4738: File repositories shouldn't have duplicate files added
Updated by daviddavis over 5 years ago
- Blocked by Issue #4740: Pulpcore doesn't provide a way to guarantee uniqueness in repo versions added
Updated by daviddavis over 5 years ago
- Blocked by deleted (Issue #4740: Pulpcore doesn't provide a way to guarantee uniqueness in repo versions)
Updated by daviddavis over 5 years ago
- Blocked by Issue #3541: Core should not add/remove content to a repository or create a repository_version without plugin input added
Updated by ttereshc over 5 years ago
- Related to Story #5008: As a user, I can enforce content specific uniqueness constaints in a repo version added
Updated by rchan over 5 years ago
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.
Updated by bmbouter about 5 years ago
- 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.
Updated by daviddavis about 5 years ago
- Blocked by deleted (Issue #3541: Core should not add/remove content to a repository or create a repository_version without plugin input)
Updated by bmbouter about 5 years ago
- Status changed from ASSIGNED to POST
PR available at: https://github.com/pulp/pulp_file/pull/290
Added by bmbouter about 5 years ago
Updated by bmbouter about 5 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset 2551ede93a5a21df4a1ff7beb114e24cef377a79.
Updated by bmbouter about 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
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