Project

Profile

Help

Story #5927

As a plugin writer, I can validate Content data in the Stages API

Added by daviddavis about 2 months ago. Updated 4 days ago.

Status:
POST
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Platform Release:
Blocks Release:
Backwards Incompatible:
No
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 67

Description

In a discussion on pulp-dev[0] we decided that models shouldn't validate data (but rather serializers should). The Stages API should provide a way for plugin writers to validate Content data when syncing.

[0] https://www.redhat.com/archives/pulp-dev/2019-December/msg00003.html

History

#1 Updated by daviddavis about 2 months ago

  • Description updated (diff)

#2 Updated by bmbouter about 2 months ago

  • Groomed changed from No to Yes
  • Sprint Candidate changed from No to Yes

#3 Updated by rchan about 2 months ago

  • Sprint set to Sprint 64

#4 Updated by fabricio.aguiar about 1 month ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fabricio.aguiar

#5 Updated by fabricio.aguiar about 1 month ago

I have an implementation, but I made so many workarounds:
https://github.com/pulp/pulpcore/pull/514

1 - I adapted PulpPluginAppConfig for getting the serializers (2 serializers with the same model, results in dict with only the last serializer)
2 - Convert model to dict for using it on serializer
2.1 - serializers with nested serializers like DistributionTreeSerializer: https://github.com/pulp/pulp_rpm/blob/master/pulp_rpm/app/serializers.py#L1020
I'm sending an empty list on the related fields like: "addons": [], "checksums": [], ...
2.2 - SingleArtifactContentUploadSerializer needs relative_path, artifact / file, I'm sending a fake file,
but when validation requires a specific kind of file it fails. I got it here: https://github.com/pulp/pulp_rpm/blob/master/pulp_rpm/app/serializers.py#L232-L246
which I treated by avoiding deferred_validate
but I also got a problem here:
https://github.com/pulp/pulp_rpm/blob/master/pulp_rpm/app/serializers.py#L500-L513
that I could not treat

#6 Updated by rchan about 1 month ago

  • Sprint changed from Sprint 64 to Sprint 65

#7 Updated by fabricio.aguiar 29 days ago

  • Status changed from ASSIGNED to POST

#8 Updated by fabricio.aguiar 26 days ago

  • Status changed from POST to NEW
  • Assignee deleted (fabricio.aguiar)

#9 Updated by rchan 18 days ago

  • Sprint changed from Sprint 65 to Sprint 66

#10 Updated by fabricio.aguiar 15 days ago

  • Description updated (diff)
  • Status changed from NEW to ASSIGNED
  • Assignee set to fabricio.aguiar

#11 Updated by fabricio.aguiar 14 days ago

  • Status changed from ASSIGNED to POST

#12 Updated by daviddavis 14 days ago

  • Sprint/Milestone changed from 3.1.0 to 3.2.0

#13 Updated by rchan 4 days ago

  • Sprint changed from Sprint 66 to Sprint 67

Please register to edit this issue

Also available in: Atom PDF