Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the field sha256 to serializers and implement filters for this field #1615

Merged
merged 1 commit into from
Mar 6, 2020

Conversation

lubosmj
Copy link
Member

@lubosmj lubosmj commented Feb 28, 2020

@@ -546,7 +547,7 @@ class Meta:
fields = SingleArtifactContentUploadSerializer.Meta.fields + (
'id', 'updated_date', 'description', 'issued_date',
'fromstr', 'status', 'title', 'summary', 'version',
'type', 'severity', 'solution', 'release', 'rights',
'type', 'sha256', 'severity', 'solution', 'release', 'rights',
Copy link
Member

@goosemania goosemania Mar 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Advisories are artifactless, I don't think this filter/field is needed here. @daviddavis , @lubosmj, what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, if a class inherits from the class SingleArtifactContentUploadSerializer which inherits from the class SingleArtifactContentSerializer, I assume it may contain an artifact. @goosemania , what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's logical :) Unfortunately, advisories are always a special case.
It inherits from SingleArtifactContentUploadSerializer because a file is used to upload an advisory to Pulp.
Data from the file is parsed and saved into the DB, no artifact is saved in pulp storage or attached to that content unit.
To be more precise, during upload, the artifact is saved and then removed after being processed because it can't be a part of the advisory content unit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright then, what else is a special case? Only advisories?

@lubosmj lubosmj force-pushed the sha256-artifact-filter-6187 branch from b42c41a to bdb3e08 Compare March 6, 2020 14:02
@lubosmj
Copy link
Member Author

lubosmj commented Mar 6, 2020

I removed the field sha256 from the serializer UpdateRecordSerializer and from the filter UpdateRecordFilter.

@lubosmj lubosmj force-pushed the sha256-artifact-filter-6187 branch from bdb3e08 to 4951749 Compare March 6, 2020 14:11
@daviddavis daviddavis merged commit f88fdf7 into pulp:master Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants