[Pulp-dev] Context Manager meeting recap

Austin Macdonald austin at redhat.com
Wed Jan 31 21:19:58 UTC 2018


Today, some of the developers met to discuss our new context managers.
These objects are the interface for creating and using RepositoryVersion
and Publication objects and they are used by both core developers and
plugin writers. They described in detail in https://pulp.plan.io/issues/3285
and https://pulp.plan.io/issues/3295.

The subject of the meeting was inheritance vs composition and where the
business logic should live. The previous design created a facade layer, but
we settled on adding these features directly to the Django model. Since
most objects in our Plugin API are simple Django models, we are going
forward with the plan to do the same with RepositoryVersion and Publication
models.

What this means for plugin writers:
Plugins will use the RepositoryVersion and Publication Django models
directly. These models can be used as a context manager with Python's
`with` statement to safely create, finalize, and cleanup.
These models will also contain some business logic (for example  adding and
removing content), which writes to multiple database tables.

What needs to be done:
- Bihan will remove the facade object and move functionality onto the
model, and update the Plugin API
- I will update https://pulp.plan.io/issues/3295
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-dev/attachments/20180131/2e7bd4b5/attachment.htm>


More information about the Pulp-dev mailing list