[Pulp-dev] Namespacing plugins, looking for feedback

David Davis daviddavis at redhat.com
Mon Dec 17 13:26:31 UTC 2018

Is it possible (under the current model, without namespacing) to have type
collisions in the database for master/detail models? Like what if two
plugins define two Contents with the same type or two Remotes with the same
type? This kind of leads me to believe we should namespace everything. On
the Ansible plugin for example, I started working on a git Remote[0].
Luckily I chose "ansible_git" as the type but I could see plugin writers
running into problems if they are not so careful.



On Sun, Dec 16, 2018 at 4:41 PM Tatiana Tereshchenko <ttereshc at redhat.com>

> There is an issue [0] of colliding type names in the content summary which
> evolved into more general namespacing problem for plugins.
> The suggested changes [1] are:
>  1. include plugin name into the content summary
> "content_summary": {
>     "pulp_rpm.package": 50,
>     "pulp_rpm.errata": 2,
>     "pulp_file.file": 5
> }
> 2. include plugin name into content endpoints
> /api/v3/content/file/files/ --> /api/v3/content/pulp_file/files/
> /api/v3/content/rpm/packages/ --> /api/v3/content/pulp_rpm/packages/
> /api/v3/content/rpm/errata/ --> /api/v3/content/pulp_rpm/errata/
> ...
> For the change #1, not only content summary output is changed but the type
> itself in the database. If the content type is used somewhere in the
> filters, it should be specified in that format: "plugin_name.plugin_type".
> Does it makes sense to extend the master model and have a plugin name field
> and a type field, instead of putting preformatted string into the type
> field?
> For the change #2, endpoints are namespaced only for the content endpoint
> and not for other endpoints related to master/detail models, like remotes,
> publishers, etc. It's inconsistent, however it makes the most sense to have
> it for content endpoints.
> Any concerns or thoughts?
> Thank you,
> Tanya
> [0] https://pulp.plan.io/issues/4185#note-8
> [1] https://github.com/pulp/pulp/pull/3801
> _______________________________________________
> Pulp-dev mailing list
> Pulp-dev at redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-dev/attachments/20181217/0e017131/attachment.htm>

More information about the Pulp-dev mailing list