Project

Profile

Help

Issue #4272

ArtifactFileField's validation is too strict

Added by dkliban@redhat.com about 1 year ago. Updated about 1 month ago.

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

Description

ArtifactFileField validates that the file being saved does not already exist in Artifact storage0. However, when bulk_get_or_create encounters a problem during bulk_create, it already moves the file into place before falling back to saving each model individually1. As a result, the validation logic from ArtifactFileField throws a ValueError because the file is already in Artifact storage, however it is still not saved to the database.

The validation should allow the file to be already in Artifact storage as long as it's being "saved" to the exact same location as it is at already.

[0] https://github.com/pulp/pulp/blob/master/pulpcore/app/models/fields.py#L31
[1] https://github.com/pulp/pulp/blob/master/pulpcore/app/models/content.py#L46

Associated revisions

Revision a73e29d0 View on GitHub
Added by mdellweg about 1 year ago

Do not fail if file already moved to storage

https://pulp.plan.io/issues/4272
closes #4272

Revision a73e29d0 View on GitHub
Added by mdellweg about 1 year ago

Do not fail if file already moved to storage

https://pulp.plan.io/issues/4272
closes #4272

History

#1 Updated by dkliban@redhat.com about 1 year ago

  • Tags Pulp 3 added

#2 Updated by mdellweg about 1 year ago

  • Status changed from NEW to MODIFIED

#3 Updated by daviddavis 9 months ago

  • Sprint/Milestone set to 3.0.0

#4 Updated by bmbouter 9 months ago

  • Tags deleted (Pulp 3)

#5 Updated by bmbouter about 1 month ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF