Story #8384
Updated by bmbouter over 3 years ago
1. Create a new MasterModel named `Distribution`. This would have these fields:
* All the existing fields from `BaseDistribution` [see here](https://github.com/pulp/pulpcore/blob/a0fce1f1917f1a8b85b836af8f76c27699d0b04f/pulpcore/app/models/publication.py#L283-L287).
* Include all of the fields from the `PublicationDistribution` and `RepositoryVersionDistribution` models also, this includes the: `publication`, `repository`, and `repository_version` fields
2. Create corresponding Serializer and Viewset. These will be similar to the [`BaseDistributionSerializer`](https://github.com/pulp/pulpcore/blob/c8c4e5bba6f4ee054d5a93c984c2d123c179e761/pulpcore/app/serializers/publication.py#L78) and [`BaseDistributionViewset`](https://github.com/pulp/pulpcore/blob/70d711c52f92b5c068d6b0b32ccc6a923e5c1a7d/pulpcore/app/viewsets/publication.py#L109).
3. Handle the plugin code that deals with these detail types to ensure a mixutre of detail inheriting from `BaseDistribution` and `Distribution` can cooperate together.
* base path overlap, the [code here](https://github.com/pulp/pulpcore/blob/c8c4e5bba6f4ee054d5a93c984c2d123c179e761/pulpcore/app/serializers/publication.py#L132-L157) needs to be updated for both models to consider base path overlaps from both models.
* name field uniqueness. We need to have uniqueness of the name apply across both models
* The [content app](https://github.com/pulp/pulpcore/blob/master/pulpcore/content/handler.py#L61) needs to be prepared to read/handle data from both `BaseDistribution` and `Distribution`.
NOTE: while doing this work, the author should also implement https://pulp.plan.io/issues/8387 at the same time.