Project

Profile

Help

Task #2298

Task #1873: Plan REST API for 3.0

Add serializer for the repository models.

Added by jortel@redhat.com about 3 years ago. Updated 6 months ago.

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

100%

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

Description

Write a serializer for each model in repository.py.


Related issues

Blocks Pulp - Task #2310: Add a Publisher ViewSet MODIFIED Actions
Blocks Pulp - Task #2309: Add a Importer ViewSet MODIFIED Actions
Blocks Pulp - Task #2308: Add a RepositoryGroup ViewSet MODIFIED Actions
Blocks Pulp - Task #2307: Add a Repository ViewSet MODIFIED Actions
Copied to Pulp - Task #2299: Add serializer for the content models. MODIFIED Actions

Associated revisions

Revision 4ff2756e View on GitHub
Added by Austin Macdonald about 3 years ago

Finish Repository serializer

Add remaining fields and move fiter_fields back to ViewSet.

closes #2298

Revision 4ff2756e View on GitHub
Added by Austin Macdonald about 3 years ago

Finish Repository serializer

Add remaining fields and move fiter_fields back to ViewSet.

closes #2298

Revision 4ff2756e View on GitHub
Added by Austin Macdonald about 3 years ago

Finish Repository serializer

Add remaining fields and move fiter_fields back to ViewSet.

closes #2298

Revision c7b871bc View on GitHub
Added by Austin Macdonald almost 3 years ago

Add remaining fields to Importer Serializer

re #2298

Revision c7b871bc View on GitHub
Added by Austin Macdonald almost 3 years ago

Add remaining fields to Importer Serializer

re #2298

Revision c7b871bc View on GitHub
Added by Austin Macdonald almost 3 years ago

Add remaining fields to Importer Serializer

re #2298

History

#1 Updated by jortel@redhat.com about 3 years ago

  • Copied to Task #2299: Add serializer for the content models. added

#2 Updated by amacdona@redhat.com about 3 years ago

  • Blocks Task #2310: Add a Publisher ViewSet added

#3 Updated by amacdona@redhat.com about 3 years ago

#4 Updated by amacdona@redhat.com about 3 years ago

  • Blocks Task #2308: Add a RepositoryGroup ViewSet added

#5 Updated by amacdona@redhat.com about 3 years ago

  • Blocks Task #2307: Add a Repository ViewSet added

#6 Updated by amacdona@redhat.com about 3 years ago

  • Groomed changed from No to Yes

#7 Updated by semyers about 3 years ago

This task cannot be started until the documentation written in #1873 is merged to 3.0-dev.

#8 Updated by mhrivnak about 3 years ago

  • Sprint/Milestone set to 27

#9 Updated by semyers about 3 years ago

This task should be considered complete when all serializers for a given models module are defined in a corresponding serializers module.

The serializers defined should expose fields "native" (defined directly on a model or in its superclasses) to the model being represented, including Generic Key/Value types (Config/Notes/Scratchpad). Relations to other models should be included where possible, but the available serializer base classes and fields may be insufficient, so only the "native" fields should be required.

This task is among several similar tasks to stub out serializers for our existing models. Please spread the work around so we gain more team-wide knowledge around these serializers. If you have any questions, ask me. Common issues and their resolutions will be added to the pulp 3.0 rest-api development guide.

#10 Updated by amacdona@redhat.com about 3 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to amacdona@redhat.com

#11 Updated by amacdona@redhat.com about 3 years ago

  • Status changed from ASSIGNED to POST

#12 Updated by Anonymous about 3 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#13 Updated by amacdona@redhat.com about 3 years ago

  • Status changed from MODIFIED to ASSIGNED

PR was only for repository model, the story is for all models in the repos module, resetting to assigned.

#14 Updated by jortel@redhat.com almost 3 years ago

  • Sprint/Milestone changed from 27 to 28

#15 Updated by ttereshc almost 3 years ago

Is the following correct?
  • We do not need serializer for ContentAdaptor model because its fields will be serialized in Importer/Publisher serializers.
  • We do not need serializer for RepositoryContent model because we won't access this model directly, it is a through model. We are going to set relations specified in it via ContentViewset and read this info via RepositoryViewset or ContentViewset.

#16 Updated by semyers almost 3 years ago

ttereshc wrote:

Is the following correct?
  • We do not need serializer for ContentAdaptor model because its fields will be serialized in Importer/Publisher serializers.

Maybe true! If it's useful to create an abstract ContentAdaptor to define the fields that should be included on all Model subclasses, though, then it makes sense to create a similar serializer that only gets used abstractly by all ContentAdaptorSerializer subclasses. Since all ContentAdaptors have at least a name and 0 or more related repositories, I think it may be worthwhile to have a ContentAdaptorSerializer.

  • We do not need serializer for RepositoryContent model because we won't access this model directly, it is a through model. We are going to set relations specified in it via ContentViewset and read this info via RepositoryViewset or ContentViewset.

I'm not really sure how best to handle this. I have some ideas, I think Austin has some other ideas, but I think the best thing right now might be to leave it out, and figure out how to work in the timestamp stored on this through model later. From an API standpoint, I think we definitely want to be able to filter repository content by this timestamp, and we'll definitely want to include it in some view, somewhere. I'm just not sure about the specifics, and think this is an easy enough one to do that we can avoid having to do it right now.

#17 Updated by ttereshc almost 3 years ago

Since all ContentAdaptors have at least a name and 0 or more related repositories, I think it may be worthwhile to have a ContentAdaptorSerializer.

I agreed initially but now I am thinking that maybe it makes sense to have those common fields specified in each ContentAdaptor, this way we will be able to be more specific in the `help_text`: "name of the importer" or "name of the publisher" rather than just "name of the content adaptor". So I will leave this one as well. It should be very easy to create it and refactor importer/publisher later if needed.

#18 Updated by ttereshc almost 3 years ago

  • Status changed from ASSIGNED to POST

#19 Updated by amacdona@redhat.com almost 3 years ago

  • Status changed from POST to MODIFIED
  • Platform Release set to 3.0.0

#20 Updated by bmbouter over 1 year ago

  • Sprint set to Sprint 10

#21 Updated by bmbouter over 1 year ago

  • Sprint/Milestone deleted (28)

#22 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#23 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF