Project

Profile

Help

Story #7696

closed

As a plugin developer, I have the Artifacts checked at pre-save time against the ALLOWED_CONTENT_CHECKSUMS instead of at __init__

Added by bmbouter about 4 years ago. Updated almost 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 86
Quarter:

Description

Background

Right now the Artifact.init checks to see if checksums that are not allowed are being used and raises an error. That happens here.

This is has a problem when plugin code (like in pulp_rpm for example) does this:

foo = Artifact()
foo.md5 = 'somemd5string'
foo.save()

Improvement

Move the checking currently in Artifact.__init__ to a Artifact.pre_save hook using django-lifecycle.

Alternative

Add a property to each of the checksums on Artifact that checks if it was set post construction by init. This keeps the check in two places and it's more code to carry/maintain. These downsides make it the alternative.


Related issues

Related to Pulp - Story #5216: As a user, I can configure which checksum types I want to use in PulpCLOSED - CURRENTRELEASEggainey

Actions
Related to Container Support - Issue #7774: `podman push` leads to missing checksums on the ArtifactsCLOSED - CURRENTRELEASEipanova@redhat.comActions
Related to Pulp - Story #7561: As a user, I can add checksums to ALLOWED_CONTENT_CHECKSUMSCLOSED - CURRENTRELEASEipanova@redhat.com

Actions

Also available in: Atom PDF