Skip to content

Commit

Permalink
Replace Distribution with other objects
Browse files Browse the repository at this point in the history
Model Changes

The Distribution model was replaced with the
RepositoryVersionDistribution and PublicationDistribution models. These
are both abstract models and are meant to be subclassed further.

Serializer Changes

The DistributionSerializer is removed and now
BaseDistributionSerializer, PublicationDistributionSerializer, and
RepositoryVersionDistributionSerializer are here. These can also be
further subclassed by plugin writers.

ViewSet Changes

DistributionViewset is now called BaseDistributionViewSet. No other
viewsets are provided.

Docs Changes

The release notes are updated to indicate the breaking changes.

Required PR: pulp/pulpcore#124
Required PR: pulp/pulp_file#219

https://pulp.plan.io/issues/4785
closes #4785
  • Loading branch information
Brian Bouterse committed May 9, 2019
1 parent 0e41c9f commit 1ffed2c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
16 changes: 11 additions & 5 deletions docs/release-notes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ See :doc:`Plugin API <../index>` and
Breaking Changes
----------------

* `The RepositoryPublishURLSerializer was removed from the plugin API. <https://github.com/pulp/pulpcore-plugin/pull/93/>`_
* `Publications are now Master/Detail. <https://pulp.plan.io/issues/4678>`_ Plugins that use
Publications will need to provide a detail Publication. Here is an example of pulp_file
introducing the `FilePublisher <https://github.com/pulp/pulp_file/pull/205>`_ as an example of
changes to match along with its `follow-on change <https://github.com/pulp/pulp_file/pull/215>`.
`The RepositoryPublishURLSerializer was removed from the plugin API. <https://github.com/pulp/
pulpcore-plugin/pull/93/>`_

`Distributions are now Master/Detail. <https://pulp.plan.io/issues/4785>`_ All plugins will require
updating to provide a Detail :term:`Distribution`. Here is an example of pulp_file introducing the
`FileDistribution <https://github.com/pulp/pulp_file/pull/217>`_ as an example of changes to match.

`Publications are now Master/Detail. <https://pulp.plan.io/issues/4678>`_ Plugins that use
:term:`Publications` will need to provide a detail Publication. Here is an example of pulp_file
introducing the `FilePublisher <https://github.com/pulp/pulp_file/pull/205>`_ as an example of
changes to match along with its `follow-on change <https://github.com/pulp/pulp_file/pull/215>`_.

0.1.0rc1
========
Expand Down
5 changes: 3 additions & 2 deletions pulpcore/plugin/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@
Content,
ContentArtifact,
CreatedResource,
Distribution,
MasterModel,
Model,
ProgressBar,
ProgressSpinner,
Publication,
PublicationDistribution,
PublishedArtifact,
PublishedMetadata,
Repository,
RemoteArtifact,
RepositoryContent,
RepositoryVersion
RepositoryVersion,
RepositoryVersionDistribution,
)

from .content import ContentGuard # noqa
Expand Down
3 changes: 2 additions & 1 deletion pulpcore/plugin/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
ArtifactSerializer,
AsyncOperationResponseSerializer,
BaseDistributionSerializer,
DistributionSerializer,
ContentGuardSerializer,
NoArtifactContentSerializer,
SingleArtifactContentSerializer,
Expand All @@ -14,10 +13,12 @@
NestedIdentityField,
NestedRelatedField,
RemoteSerializer,
PublicationDistributionSerializer,
PublicationSerializer,
PublisherSerializer,
RelatedField,
RepositorySyncURLSerializer,
RepositoryVersionDistributionSerializer,
SingleContentArtifactField,
relative_path_validator,
validate_unknown_fields
Expand Down
2 changes: 1 addition & 1 deletion pulpcore/plugin/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

# Import Viewsets in platform that are potentially useful to plugin writers
from pulpcore.app.viewsets import ( # noqa
BaseDistributionViewSet,
BaseFilterSet,
ContentFilter,
ContentGuardFilter,
ContentGuardViewSet,
ContentViewSet,
DistributionViewSet,
NamedModelViewSet,
PublicationViewSet,
PublisherViewSet,
Expand Down

0 comments on commit 1ffed2c

Please sign in to comment.